-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimfifo_tb.vhd
More file actions
38 lines (33 loc) · 934 Bytes
/
simfifo_tb.vhd
File metadata and controls
38 lines (33 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/* VHDL 2008 */
library ieee;
context ieee.ieee_std_context;
package simfifo_pkg_c is new work.simfifo_pkg
generic map (DATA_WIDTH => 8);
library ieee;
context ieee.ieee_std_context;
use work.simfifo_pkg_c.all;
use ieee.numeric_std_unsigned.all;
entity simfifo_tb is
generic (FORCE_FAILURE: integer := 0);
end entity;
architecture simfifo_tb_a of simfifo_tb is
shared variable fifo: simfifo;
begin
process is
variable data: data_t;
variable pdata: data_t;
begin
for i in 1 to 5 loop
data := std_logic_vector(to_stdlogicvector(i, data_t'length));
fifo.push(data);
end loop;
while (0 /= fifo.get_level) loop
pdata := fifo.pop;
report to_string(pdata);
end loop;
assert 0 = FORCE_FAILURE
report "forcing failure"
severity failure;
wait;
end process;
end architecture;