------------------------------------------------------------ -- UART Modeling: Receiver Part -- -- Test Bench #1 for UART Receiver -- by: Weijun Zhang, 11/2000 ------------------------------------------------------------ library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use work.my_package.all; entity test1_recei is end test1_recei; architecture bench1 of test1_recei is component recei is port( RRC: in std_logic; MR: in std_logic; RRI: in std_logic; SFD: in std_logic; RRD: in std_logic; DRR: in std_logic; CRL: in std_logic; CTRLWORD: in std_logic_vector(4 downto 0); OE: out std_logic; PE: out std_logic; FE: out std_logic; DR: out std_logic; RBR: out std_logic_vector(7 downto 0) ); end component; signal T_RRC,T_MR,T_RRI,T_SFD,T_RRD,T_DRR,T_CRL: std_logic; signal T_OE,T_PE,T_FE,T_DR: std_logic; signal T_RBR: std_logic_vector(7 downto 0); signal T_CTRLWORD: std_logic_vector(4 downto 0); begin Unit: recei port map( T_RRC,T_MR,T_RRI,T_SFD,T_RRD,T_DRR,T_CRL, T_CTRLWORD,T_OE,T_PE,T_FE,T_DR,T_RBR); clk_sig: process begin T_RRC <='1'; wait for 5 ns; T_RRC <= '0'; wait for 5 ns; end process; process begin T_MR <= '1'; -- initialization... T_CRL <= '1'; T_CTRLWORD <= "01101"; T_DRR <= '1'; T_RRD <= '0'; T_RRI <= '0'; T_SFD <= '0'; wait for 100 ns; T_CRL <= '0'; -- load ctrl word here wait for 60 ns; T_MR <= '0'; -- 1 start bit of data #1 wait for 160 ns; T_RRI <= '1'; wait for 160 ns; T_RRI <= '0'; wait for 320 ns; T_RRI <= '1'; wait for 480 ns; T_RRI <= '0'; -- even parity wait for 160 ns; T_RRI <= '1'; -- 2 stop bits wait for 360 ns; wait for 80 ns; -- a short delay here T_DRR <= '0'; wait for 80 ns; T_RRI <= '0'; -- 1 start bit of data #2 wait for 160 ns; T_RRI <= '1'; wait for 160 ns; T_RRI <= '0'; wait for 160 ns; T_DRR <= '1'; -- test function of DDR T_RRI <= '1'; wait for 160 ns; T_RRI <= '0'; wait for 320 ns; T_RRI <= '1'; wait for 160 ns; T_RRI <= '0'; -- even parity wait for 160 ns; T_RRI <= '1'; -- 2 stop bits wait for 480 ns; T_SFD <= '1'; -- test function of SFD and RRD wait for 320 ns; T_RRD <= '1'; wait; end process; end bench1; ---------------------------------------------------------------- configuration CFG_TB of test1_recei is for bench1 end for; end CFG_TB; ----------------------------------------------------------------