From 9d6ab7b1563f5870252e6b6943d0251015af9a01 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Wed, 24 Mar 2021 10:11:06 +0000 Subject: [PATCH] - fixed bounds check error git-svn-id: http://moon:8086/svn/vhdl/trunk@1510 cc03376c-175c-47c8-b038-4cd826a8556b --- lib/JBUS/src/busmaster_async.vhd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/JBUS/src/busmaster_async.vhd b/lib/JBUS/src/busmaster_async.vhd index ccac16b..12ba678 100644 --- a/lib/JBUS/src/busmaster_async.vhd +++ b/lib/JBUS/src/busmaster_async.vhd @@ -137,7 +137,9 @@ proc_bus_read_counter: elsif cmd_read_en = '1' and read_fifo_empty = '1' then read_cnt <= read_cnt + 1; elsif cmd_read_en = '0' and read_fifo_empty = '0' and dout_re = '1' then - read_cnt <= read_cnt - 1; + if read_cnt > 0 then + read_cnt <= read_cnt - 1; + end if; end if; end if; end process;