[BB-FIFO]
- renamed ports - added quick 'n dirty half full git-svn-id: http://moon:8086/svn/vhdl/trunk@1349 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
+31
-29
@@ -37,8 +37,9 @@ architecture behave of tb_bbfifo is
|
||||
signal clk : std_logic := '1';
|
||||
signal re : std_logic := '0';
|
||||
signal we : std_logic := '0';
|
||||
signal ready : std_logic;
|
||||
signal avail : std_logic;
|
||||
signal dout_vld : std_logic;
|
||||
signal full : std_logic;
|
||||
signal half_full : std_logic;
|
||||
signal din : unsigned(7 downto 0) := (others => '0');
|
||||
signal dout : unsigned(7 downto 0);
|
||||
signal dout_reg : unsigned(7 downto 0);
|
||||
@@ -54,14 +55,15 @@ inst_bbfifo : entity work.bbfifo
|
||||
)
|
||||
PORT MAP
|
||||
(
|
||||
rst => rst,
|
||||
clk => clk,
|
||||
re => re,
|
||||
we => we,
|
||||
ready => ready,
|
||||
avail => avail,
|
||||
din => din,
|
||||
dout => dout
|
||||
rst => rst,
|
||||
clk => clk,
|
||||
re => re,
|
||||
we => we,
|
||||
full => full,
|
||||
half_full => half_full,
|
||||
dout_vld => dout_vld,
|
||||
din => din,
|
||||
dout => dout
|
||||
);
|
||||
|
||||
|
||||
@@ -74,7 +76,7 @@ CLK_GEN: process
|
||||
RE_GEN: process
|
||||
begin
|
||||
wait for 2*CLK_PERIOD;
|
||||
wait until rising_edge(clk) and avail = '1';
|
||||
wait until rising_edge(clk) and dout_vld = '1';
|
||||
re <= '1';
|
||||
dout_reg <= dout;
|
||||
wait until rising_edge(clk);
|
||||
@@ -91,45 +93,45 @@ STIMULUS: process
|
||||
wait for 3*CLK_PERIOD;
|
||||
rst <= '0';
|
||||
din <= X"10";
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '0';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '0';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '1';
|
||||
din <= din + 1;
|
||||
wait until rising_edge(clk) and ready = '1';
|
||||
wait until rising_edge(clk) and full = '0';
|
||||
we <= '0';
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user