- minor bugfix with read counter

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@984 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
2013-07-21 09:21:17 +00:00
parent 9ff2d32370
commit 8054829fcc
+3 -3
View File
@@ -1,5 +1,5 @@
-----------------------------------------------------------------------
-- $Header: /tmp/cvsroot/VHDL/lib/JBUS/src/busmaster_sync.vhd,v 1.4 2013-07-21 09:10:13 jens Exp $
-- $Header: /tmp/cvsroot/VHDL/lib/JBUS/src/busmaster_sync.vhd,v 1.5 2013-07-21 09:21:17 jens Exp $
-----------------------------------------------------------------------
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
@@ -123,9 +123,9 @@ proc_bus_read_counter:
if rising_edge(clk) then
if rst = '1' then
read_cnt <= 0;
elsif cmd_read_en = '1' and dout_re = '0' then
elsif cmd_read_en = '1' and read_fifo_empty = '1' then
read_cnt <= read_cnt + 1;
elsif cmd_read_en = '0' and dout_re = '1' and read_fifo_empty = '0' then
elsif cmd_read_en = '0' and read_fifo_empty = '0' and dout_re = '1' then
read_cnt <= read_cnt - 1;
end if;
end if;