-- Manchester decoder test bench -- Xilinx, Inc -- Jan 26, 2000 library ieee ; use ieee.std_logic_1164.all ; entity testbench is end ; architecture v1 of testbench is component md port (rst : in std_logic ; clk16x : in std_logic ; mdi : in std_logic ; rdn : in std_logic ; dout : out std_logic_vector (7 downto 0); data_ready : out std_logic ); end component ; signal rst : std_logic; signal clk : std_logic; signal mdi : std_logic; signal rdn : std_logic ; signal dout : std_logic_vector (7 downto 0); signal data_ready : std_logic; type test_record is record rst : std_logic ; rdn : std_logic ; mdi : std_logic ; end record ; type test_array is array(positive range<>) of test_record ; constant test_vectors : test_array := ( --rst, rdn, mdi ('1','0','0'), -- 40 ('0','0','1'), -- 80 ('0','1','1'), -- * 1 ('0','0','1'), -- * 2 ('0','0','1'), -- * 2 ('0','0','1'), -- * 3 ('0','0','1'), -- * 4 ('0','0','1'), -- * 5 ('0','0','1'), -- * 6 ('0','0','1'), -- * 7 ('0','0','1'), -- * 8 ('0','0','0'), -- * 9 ('0','0','0'), -- * 10 ('0','0','0'), -- * 11 ('0','0','0'), -- * 12 ('0','0','0'), -- * 13 ('0','0','0'), -- * 14 ('0','0','0'), -- * 15 ('0','0','0'), -- * 16 ('0','0','0'), -- * 1 bit 2 ('0','0','0'), -- * 2 ('0','0','0'), -- * 3 ('0','0','0'), -- * 4 ('0','0','0'), -- * 5 ('0','0','0'), -- * 6 ('0','0','0'), -- * 7 ('0','0','0'), -- * 8 ('0','0','1'), -- * 9 ('0','0','1'), -- * 10 ('0','0','1'), -- * 11 ('0','0','1'), -- * 12 ('0','0','1'), -- * 13 ('0','0','1'), -- * 14 ('0','0','1'), -- * 15 ('0','0','1'), -- * 16 ('0','1','1'), -- * 1 bit 3 ('0','0','1'), -- * 2 ('0','0','1'), -- * 2 ('0','0','1'), -- * 3 ('0','0','1'), -- * 4 ('0','0','1'), -- * 5 ('0','0','1'), -- * 6 ('0','0','1'), -- * 7 ('0','0','1'), -- * 8 ('0','0','0'), -- * 9 ('0','0','0'), -- * 10 ('0','0','0'), -- * 11 ('0','0','0'), -- * 12 ('0','0','0'), -- * 13 ('0','0','0'), -- * 14 ('0','0','0'), -- * 15 ('0','0','0'), -- * 16 ('0','0','0'), -- * 1 bit 4 ('0','0','0'), -- * 2 ('0','0','0'), -- * 3 ('0','0','0'), -- * 4 ('0','0','0'), -- * 5 ('0','0','0'), -- * 6 ('0','0','0'), -- * 7 ('0','0','0'), -- * 8 ('0','0','1'), -- * 9 ('0','0','1'), -- * 10 ('0','0','1'), -- * 11 ('0','0','1'), -- * 12 ('0','0','1'), -- * 13 ('0','0','1'), -- * 14 ('0','0','1'), -- * 15 ('0','0','1'), -- * 16 ('0','1','1'), -- * 1 bit 5 ('0','0','1'), -- * 2 ('0','0','1'), -- * 2 ('0','0','1'), -- * 3 ('0','0','1'), -- * 4 ('0','0','1'), -- * 5 ('0','0','1'), -- * 6 ('0','0','1'), -- * 7 ('0','0','1'), -- * 8 ('0','0','0'), -- * 9 ('0','0','0'), -- * 10 ('0','0','0'), -- * 11 ('0','0','0'), -- * 12 ('0','0','0'), -- * 13 ('0','0','0'), -- * 14 ('0','0','0'), -- * 15 ('0','0','0'), -- * 16 ('0','1','1'), -- * 1 bit 6 ('0','0','1'), -- * 2 ('0','0','1'), -- * 2 ('0','0','1'), -- * 3 ('0','0','1'), -- * 4 ('0','0','1'), -- * 5 ('0','0','1'), -- * 6 ('0','0','1'), -- * 7 ('0','0','1'), -- * 8 ('0','0','0'), -- * 9 ('0','0','0'), -- * 10 ('0','0','0'), -- * 11 ('0','0','0'), -- * 12 ('0','0','0'), -- * 13 ('0','0','0'), -- * 14 ('0','0','0'), -- * 15 ('0','0','0'), -- * 16 ('0','0','0'), -- * 1 bit 7 ('0','0','0'), -- * 2 ('0','0','0'), -- * 3 ('0','0','0'), -- * 4 ('0','0','0'), -- * 5 ('0','0','0'), -- * 6 ('0','0','0'), -- * 7 ('0','0','0'), -- * 8 ('0','0','1'), -- * 9 ('0','0','1'), -- * 10 ('0','0','1'), -- * 11 ('0','0','1'), -- * 12 ('0','0','1'), -- * 13 ('0','0','1'), -- * 14 ('0','0','1'), -- * 15 ('0','0','1'), -- * 16 ('0','0','0'), -- * 1 bit 8 ('0','0','0'), -- * 2 ('0','0','0'), -- * 3 ('0','0','0'), -- * 4 ('0','0','0'), -- * 5 ('0','0','0'), -- * 6 ('0','0','0'), -- * 7 ('0','0','0'), -- * 8 ('0','0','1'), -- * 9 ('0','0','1'), -- * 10 ('0','0','1'), -- * 11 ('0','0','1'), -- * 12 ('0','0','1'), -- * 13 ('0','0','1'), -- * 14 ('0','0','1'), -- * 15 ('0','0','1'), -- * 16 ('0','0','0'), -- * 1 bit 9 ('0','0','0'), -- * 2 ('0','0','0'), -- * 3 ('0','0','0'), -- * 4 ('0','0','0'), -- * 5 ('0','0','0'), -- * 6 ('0','0','0'), -- * 7 ('0','0','0'), -- * 8 ('0','0','1'), -- * 9 ('0','0','1'), -- * 10 ('0','0','1'), -- * 11 ('0','0','1'), -- * 12 ('0','0','1'), -- * 13 ('0','0','1'), -- * 14 ('0','0','1'), -- * 15 ('0','0','1'), -- * 16 ('0','1','1'), -- * 1 bit 10 ('0','0','1'), -- * 2 ('0','0','1'), -- * 2 ('0','0','1'), -- * 3 ('0','0','1'), -- * 4 ('0','0','1'), -- * 5 ('0','0','1'), -- * 6 ('0','0','1'), -- * 7 ('0','0','1'), -- * 8 ('0','0','0'), -- * 9 ('0','0','0'), -- * 10 ('0','0','0'), -- * 11 ('0','0','0'), -- * 12 ('0','0','0'), -- * 13 ('0','0','0'), -- * 14 ('0','0','0'), -- * 15 ('0','0','0') -- * 16 ) ; begin uut : md port map (rst,clk,mdi,rdn,dout,data_ready) ; process variable vector : test_record ; begin for index in test_vectors'range loop vector := test_vectors(index); rst <= vector.rst ; mdi <= vector.mdi ; rdn <= vector.rdn ; clk <= '0' ; wait for 20 ns ; clk <= '1' ; wait for 20 ns ; clk <= '0' ; end loop ; wait ; end process ; end ;