- read_counter now decremented, if local side really has read

Committed on the Free edition of March Hare Software CVSNT Server.
Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


git-svn-id: http://moon:8086/svn/vhdl/trunk@983 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2013-07-21 09:10:13 +00:00
parent 1926d23b44
commit 9ff2d32370
2 changed files with 25 additions and 8 deletions
+17 -3
View File
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------
-- $Header: /tmp/cvsroot/VHDL/lib/JBUS/src/busmaster_sync.vhd,v 1.3 2013-05-28 11:23:15 jens Exp $
-- $Header: /tmp/cvsroot/VHDL/lib/JBUS/src/busmaster_sync.vhd,v 1.4 2013-07-21 09:10:13 jens Exp $
-----------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
@@ -103,15 +103,29 @@ begin
CYC_O <= cycle_busy;
cmd_cycle_finished <= not cycle_busy;
-- proc_bus_read_counter:
-- process(clk)
-- begin
-- if rising_edge(clk) then
-- if rst = '1' then
-- read_cnt <= 0;
-- elsif cmd_read_en = '1' and read_fifo_we = '0' then
-- read_cnt <= read_cnt + 1;
-- elsif cmd_read_en = '0' and read_fifo_we = '1' then
-- read_cnt <= read_cnt - 1;
-- end if;
-- end if;
-- end process;
proc_bus_read_counter:
process(clk)
begin
if rising_edge(clk) then
if rst = '1' then
read_cnt <= 0;
elsif cmd_read_en = '1' and read_fifo_we = '0' then
elsif cmd_read_en = '1' and dout_re = '0' then
read_cnt <= read_cnt + 1;
elsif cmd_read_en = '0' and read_fifo_we = '1' then
elsif cmd_read_en = '0' and dout_re = '1' and read_fifo_empty = '0' then
read_cnt <= read_cnt - 1;
end if;
end if;