source: PROJECT_CORE_MPI/MPI_HCL/TRUNK/CORE_MPI/fifo_256_fwft_tb.vhd @ 127

Last change on this file since 127 was 127, checked in by rolagamo, 10 years ago

première mise à jour

File size: 1.8 KB
Line 
1LIBRARY ieee  ; 
2LIBRARY unisim  ; 
3LIBRARY work  ; 
4USE ieee.std_logic_1164.all  ; 
5USE ieee.std_logic_arith.all  ; 
6USE ieee.STD_LOGIC_UNSIGNED.all  ; 
7USE unisim.VCOMPONENTS.all  ; 
8USE work.CoreTypes.all  ; 
9ENTITY fifo_256_fwft_tb  IS 
10END ; 
11 
12ARCHITECTURE fifo_256_fwft_tb_arch OF fifo_256_fwft_tb IS
13  SIGNAL dout   :  std_logic_vector (7 downto 0)  ; 
14  SIGNAL srst   :  STD_LOGIC  ; 
15  SIGNAL rd_en   :  STD_LOGIC  ; 
16  SIGNAL clk   :  STD_LOGIC:='0'  ; 
17  SIGNAL full   :  STD_LOGIC  ; 
18  SIGNAL empty   :  STD_LOGIC  ; 
19  SIGNAL wr_en   :  STD_LOGIC  ; 
20  SIGNAL din   :  std_logic_vector (7 downto 0)  ; 
21  COMPONENT FIFO_256_FWFT 
22    PORT ( 
23      dout  : out std_logic_vector (7 downto 0) ; 
24      srst  : in STD_LOGIC ; 
25      rd_en  : in STD_LOGIC ; 
26      clk  : in STD_LOGIC ; 
27      full  : out STD_LOGIC ; 
28      empty  : out STD_LOGIC ; 
29      wr_en  : in STD_LOGIC ; 
30      din  : in std_logic_vector (7 downto 0) ); 
31  END COMPONENT ; 
32BEGIN
33  DUT  : FIFO_256_FWFT 
34    PORT MAP ( 
35      dout   => dout  ,
36      srst   => srst  ,
37      rd_en   => rd_en  ,
38      clk   => clk  ,
39      full   => full  ,
40      empty   => empty  ,
41      wr_en   => wr_en  ,
42      din   => din   ) ; 
43 
44
45
46clk <= not clk after 5 ns;
47srst<='0','1' after 10 ns,'0' after 100 ns;
48
49input_data:process
50begin
51 
52  wr_en<='0';
53  wait for 10 ns;
54  srst<='0';
55  wr_en<='1';
56  for i in 0 to 10 loop
57  din<=conv_std_logic_vector(i,8);
58  wait for 10 ns;
59end loop;
60  wr_en<='0';
61  wait for 10 ns;
62 
63  for i in 11 to 20 loop
64   wr_en<='1'; 
65  din<=conv_std_logic_vector(i,8);
66  wait for 10 ns;
67  wr_en<='0';
68  wait for 10 ns;
69end loop;
70  --wait;
71end process;
72
73output_data:process(clk,empty)
74begin
75 -- if rising_edge(clk) then
76  if empty='0' then 
77        rd_en<='1';
78else
79  rd_en<='0';
80end if;
81   
82--end if;
83end process;
84
85end fifo_256_fwft_tb_arch;
Note: See TracBrowser for help on using the repository browser.