library IEEE; use IEEE.std_logic_1164.all; package CONV_PACK_counter is -- define attributes attribute ENUM_ENCODING : STRING; end CONV_PACK_counter; library IEEE; use IEEE.std_logic_1164.all; use work.CONV_PACK_counter.all; entity counter is port( Clock, CLR : in std_logic; Q : out std_logic_vector (3 downto 0)); end counter; architecture SYN_archi of counter is component GTECH_BUF port( A : in std_logic; Z : out std_logic); end component; component GTECH_NOT port( A : in std_logic; Z : out std_logic); end component; component SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT generic ( ac_as_q, ac_as_qn, sc_ss_q : integer ); port( clear, preset, enable, data_in, synch_clear, synch_preset, synch_toggle, synch_enable, next_state, clocked_on : in std_logic; Q, QN : buffer std_logic ); end component; signal X_Logic1_port, X_Logic0_port, Clock_port, CLR_port, Q_3_port, Q_2_port, Q_1_port, Q_0_port, N0, net14649, N1, N2, N3, N4, n_1000, n_1001, n_1002, n_1003 : std_logic; begin Clock_port <= Clock; CLR_port <= CLR; Q <= ( Q_3_port, Q_2_port, Q_1_port, Q_0_port ); tmp_reg_3_inst : SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT generic map ( ac_as_q => 1, ac_as_qn => 2, sc_ss_q => 5 ) port map ( clear => CLR_port, preset => X_Logic0_port, enable => X_Logic0_port, data_in => X_Logic0_port, synch_clear => X_Logic0_port, synch_preset => X_Logic0_port, synch_toggle => X_Logic0_port, synch_enable => X_Logic1_port, next_state => N4, clocked_on => Clock_port, Q => Q_3_port, QN => n_1000); tmp_reg_2_inst : SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT generic map ( ac_as_q => 1, ac_as_qn => 2, sc_ss_q => 5 ) port map ( clear => CLR_port, preset => X_Logic0_port, enable => X_Logic0_port, data_in => X_Logic0_port, synch_clear => X_Logic0_port, synch_preset => X_Logic0_port, synch_toggle => X_Logic0_port, synch_enable => X_Logic1_port, next_state => N3, clocked_on => Clock_port, Q => Q_2_port, QN => n_1001); tmp_reg_1_inst : SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT generic map ( ac_as_q => 1, ac_as_qn => 2, sc_ss_q => 5 ) port map ( clear => CLR_port, preset => X_Logic0_port, enable => X_Logic0_port, data_in => X_Logic0_port, synch_clear => X_Logic0_port, synch_preset => X_Logic0_port, synch_toggle => X_Logic0_port, synch_enable => X_Logic1_port, next_state => N2, clocked_on => Clock_port, Q => Q_1_port, QN => n_1002); tmp_reg_0_inst : SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT generic map ( ac_as_q => 1, ac_as_qn => 2, sc_ss_q => 5 ) port map ( clear => CLR_port, preset => X_Logic0_port, enable => X_Logic0_port, data_in => X_Logic0_port, synch_clear => X_Logic0_port, synch_preset => X_Logic0_port, synch_toggle => X_Logic0_port, synch_enable => X_Logic1_port, next_state => N1, clocked_on => Clock_port, Q => Q_0_port, QN => n_1003); add_31 : process ( Q_3_port, Q_2_port, Q_1_port, Q_0_port, X_Logic0_port, X_Logic1_port ) variable A : SIGNED( 3 downto 0 ); variable B : SIGNED( 3 downto 0 ); variable Z : SIGNED( 3 downto 0 ); begin A := ( Q_3_port, Q_2_port, Q_1_port, Q_0_port ); B := ( X_Logic0_port, X_Logic0_port, X_Logic0_port, X_Logic1_port ); Z := A + B; ( N4, N3, N2, N1 ) <= Z; end process; X_Logic1_port <= '1'; X_Logic0_port <= '0'; I_0 : GTECH_NOT port map( A => CLR_port, Z => N0); B_0 : GTECH_BUF port map( A => N0, Z => net14649); end SYN_archi; library IEEE; use IEEE.std_logic_1164.all; entity SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT is generic ( ac_as_q, ac_as_qn, sc_ss_q : integer ); port( clear, preset, enable, data_in, synch_clear, synch_preset, synch_toggle, synch_enable, next_state, clocked_on : in std_logic; Q, QN : buffer std_logic ); end SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT; architecture RTL of SYNOPSYS_BASIC_SEQUENTIAL_ELEMENT is begin process ( preset, clear, enable, data_in, clocked_on ) begin -- Check the value of inputs (asynchronous first) if ( ( ( preset /= '1' ) and ( preset /= '0' ) ) or ( ( clear /= '1' ) and ( clear /= '0' ) ) ) then Q <= 'X'; elsif ( clear = '1' and preset = '1' ) then case ac_as_q is when 2 => Q <= '1'; when 1 => Q <= '0'; when others => Q <= 'X'; end case; case ac_as_qn is when 2 => QN <= '1'; when 1 => QN <= '0'; when others => QN <= 'X'; end case; elsif ( clear = '1' ) then Q <= '0'; elsif ( preset = '1' ) then Q <= '1'; elsif ( ( enable /= '1' ) and ( enable /= '0' ) ) then Q <= 'X'; elsif ( enable = '1' ) then Q <= data_in; elsif ( ( clocked_on /= '1' ) and ( clocked_on /= '0' ) ) then Q <= 'X'; elsif ( clocked_on'event and clocked_on = '1' ) then if ( ( ( synch_preset /= '1' ) and ( synch_preset /= '0' ) ) or ( ( synch_clear /= '1' ) and ( synch_clear /= '0' ) ) ) then Q <= 'X'; elsif ( synch_clear = '1' and synch_preset = '1' ) then case sc_ss_q is when 2 => Q <= '1'; when 1 => Q <= '0'; when others => Q <= 'X'; end case; elsif ( synch_clear = '1' ) then Q <= '0'; elsif ( synch_preset = '1' ) then Q <= '1'; elsif ( ( ( synch_toggle /= '1' ) and ( synch_toggle /= '0' ) ) or ( ( synch_enable /= '1' ) and ( synch_enable /= '0' ) ) ) then Q <= 'X'; elsif ( synch_enable = '1' and synch_toggle = '1' ) then Q <= 'X'; elsif ( synch_toggle = '1' ) then Q <= QN; elsif ( synch_enable = '1' ) then Q <= next_state; end if; end if; end process; end RTL;