1 ------------------------------------------------------------------------------- 3 --! @brief Delay-line test bench 4 ------------------------------------------------------------------------------- 9 --! Using IEEE standard logic components 10 USE ieee.std_logic_1164.
ALL;
12 --! @brief delay-line test bench 14 END ENTITY delay_line_tb;
16 --! Architecture tb of delay_line_tb entity 19 --! Stimulus record type 21 name : (1 TO 20);
--! Stimulus name 22 rst : (0 TO 7);
--! rst input to uut 24 sig_out : (0 TO 7);
--! Expected signal output 27 --! Stimulus array type 30 --! Test bench clock period 37 name => "Hold in reset ", 50 -- Signals to delay-line uut 51 SIGNAL clk : ;
--! Clock 52 SIGNAL rst : ;
--! Reset 53 SIGNAL sig_in : ;
--! Signal in to uut 54 SIGNAL sig_out : ;
--! Signal out from uut 58 --! Instantiate delay_line as unit under test 70 --! @brief Clock generation process 74 -- Low for 1/2 clock period 78 -- High for 1/2 clock period 84 --! @brief Stimulus process to drive PWM unit under test 85 pr_stimulus :
PROCESS IS 88 -- Initialize entity inputs 95 -- Log start of stimulus 98 -- Loop for test stimulus 100 -- Set inputs then wait for clock to rise 103 WAIT UNTIL clk = '1';
105 -- Wait for clk to fall 106 WAIT UNTIL clk = '0';
110 REPORT "At time " & 'image(t) 112 & " but got " & 'image(sig_out) 118 REPORT "Finished" SEVERITY note;
120 -- Finish the simulation 123 END PROCESS pr_stimulus;
in sig_instd_logic
Input signal.
std_logic_vector( 0 TO 7) sig_in
signal input
time := 10 ns c_clk_period
Test bench clock period.
countnatural range 1 TO natural'high:= 2
Delay length.
_library_ ieeeieee
Using IEEE library.
out sig_outstd_logic
Output signal.
t_stimulus
Stimulus record type.
in clk_instd_logic
Clock.
t_stimulus_array :=((name => "Hold in reset ",rst => "11111111",sig_in => "01010101",sig_out => "00000000"),(name => "Active ",rst => "00000000",sig_in => "01111000",sig_out => "00011110")) c_stimulus
Test stimulus.
string( 1 TO 20) name
Stimulus name.
std_logic_vector( 0 TO 7) rst
rst input to uut
in rst_instd_logic
Asynchronous reset.
array(natural range <> ) of t_stimulus t_stimulus_array
Stimulus array type.
std_logic_vector( 0 TO 7) sig_out
Expected signal output.