| Line 1... |
Line 1... |
--! Test serial_receiver module
|
--! @file
|
|
--! @brief Test serial_receiver module module
|
|
|
|
--! Use standard library and import the packages (std_logic_1164,std_logic_unsigned,std_logic_arith)
|
LIBRARY ieee;
|
LIBRARY ieee;
|
USE ieee.std_logic_1164.ALL;
|
USE ieee.std_logic_1164.ALL;
|
|
|
--! Use CPU Definitions package
|
--! Use CPU Definitions package
|
use work.pkgDefinitions.all;
|
use work.pkgDefinitions.all;
|
|
|
ENTITY testSerial_receiver IS
|
ENTITY testSerial_receiver IS
|
END testSerial_receiver;
|
END testSerial_receiver;
|
|
|
|
--! @brief Test serial_receiver module module
|
|
--! @details Receive some simulated byte stream and verify received values
|
ARCHITECTURE behavior OF testSerial_receiver IS
|
ARCHITECTURE behavior OF testSerial_receiver IS
|
|
|
-- Component Declaration for the Unit Under Test (UUT)
|
-- Component Declaration for the Unit Under Test (UUT)
|
|
|
COMPONENT serial_receiver
|
COMPONENT serial_receiver
|
| Line 96... |
Line 101... |
serial_in <= '1';
|
serial_in <= '1';
|
wait for baudClk_period;
|
wait for baudClk_period;
|
|
|
-- Stop bit here
|
-- Stop bit here
|
serial_in <= '1';
|
serial_in <= '1';
|
|
---wait until data_ready = '1';
|
|
assert data_byte = X"C4" report "Wrong result... expected 0xC4" severity failure;
|
wait for baudClk_period * 8;
|
wait for baudClk_period * 8;
|
|
|
-- Receive 0x55 value (01010101)
|
-- Receive 0x55 value (01010101)
|
-- Start bit here
|
-- Start bit here
|
serial_in <= '0';
|
serial_in <= '0';
|
| Line 123... |
Line 130... |
wait for baudClk_period;
|
wait for baudClk_period;
|
|
|
-- Stop bit here
|
-- Stop bit here
|
serial_in <= '1';
|
serial_in <= '1';
|
wait for baudClk_period * 1;
|
wait for baudClk_period * 1;
|
|
---wait until data_ready = '1';
|
|
assert data_byte = X"55" report "Wrong result... expected 0x55" severity failure;
|
|
|
-- Stop Simulation
|
-- Stop Simulation
|
assert false report "NONE. End of simulation." severity failure;
|
assert false report "NONE. End of simulation." severity failure;
|
|
|
wait;
|
wait;
|