------------------------------------------------------------ -- UART Modeling: Receiver Part -- -- Test Bench #3 for UART Receiver -- by: Weijun Zhang, 05/2001 ------------------------------------------------------------ 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 test3_recei is end test3_recei; architecture bench3 of test3_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 <= "00010"; 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 160 ns; T_RRI <= '0'; wait for 160 ns; T_RRI <= '1'; -- 1 stop bit wait for 160 ns; T_RRI <= '0'; -- 1 start bit of data #2 wait for 320 ns; T_RRI <= '1'; wait for 480 ns; T_RRI <= '0'; wait for 160 ns; T_RRI <= '1'; wait for 160 ns; -- stop bit of data #2 T_RRI <= '0'; -- 1 start bit of data #3 wait for 480 ns; T_RRI <= '1'; wait for 160 ns; T_RRI <= '0'; wait for 320 ns; T_RRI <= '1'; -- stop bit of data #3 wait for 160 ns; T_SFD <= '1'; -- test function of SFD and RRD wait for 160 ns; T_RRD <= '1'; wait; end process; end bench3; ----------------------------------------------------------------- configuration CFG_TB of test3_recei is for bench3 end for; end CFG_TB; -----------------------------------------------------------------