strange_steve
Newbie level 4
its been a while since ive done some VHDL am trying to see whats wrong with this synchronizer code
for some reason in sim my arrays have all 'U' and my 'sync_out' is XXXX '
and yet my sync_in is valid known value, what am i missing here
----------------------------------------------------------------------------------
for some reason in sim my arrays have all 'U' and my 'sync_out' is XXXX '
and yet my sync_in is valid known value, what am i missing here
----------------------------------------------------------------------------------
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity sync_16 is port ( rst : in std_logic; sync_out_clk : in std_logic; sync_in : in std_logic_vector(15 downto 0); sync_out : out std_logic_vector(15 downto 0) ); end sync_16; --////////////////////////////////////////////////////////////////////////////// architecture sync_16_arch of sync_16 is --////////////////////////////////////////////////////////////////////////////// ------------------------------------------------------ -- sync signals begin ------------------------------------------------------ type sync_array is array (0 to 3) of std_logic_vector(15 downto 0); signal sync_z : sync_array; ------------------------------------------------------ -- sync signals end ------------------------------------------------------ --////////////////////////////////////////////////////////////////////////////// begin --////////////////////////////////////////////////////////////////////////////// sync_z(0) <= sync_in(15 downto 0); sync_out <= sync_z(2); process (sync_out_clk, rst) is begin if (rst = '1') then for i in 1 to 3 loop sync_z(i) <= (others => '0'); end loop; elsif rising_edge(sync_out_clk) then for j in 1 to 3 loop sync_z(j) <= sync_z(j-1); end loop; end if; end process; --////////////////////////////////////////////////////////////////////////////// end architecture sync_16_arch; --///////////////////////////////////////
Last edited by a moderator: