summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-02-25 18:38:35 -0800
committerMatt Ettus <matt@ettus.com>2010-02-25 18:38:35 -0800
commitd808829fee0c93f22c2ff3b34d0772d7cb91df5c (patch)
treee507e966747d3359da5d5c83319e21907fb67609
parent2f9b93f32ed8e561a0e92e2e32af03707475011c (diff)
downloaduhd-d808829fee0c93f22c2ff3b34d0772d7cb91df5c.tar.gz
uhd-d808829fee0c93f22c2ff3b34d0772d7cb91df5c.tar.bz2
uhd-d808829fee0c93f22c2ff3b34d0772d7cb91df5c.zip
corrected logic
-rw-r--r--usrp2/gpmc/dbsm.v24
1 files changed, 7 insertions, 17 deletions
diff --git a/usrp2/gpmc/dbsm.v b/usrp2/gpmc/dbsm.v
index 0f27be46a..ff61859ec 100644
--- a/usrp2/gpmc/dbsm.v
+++ b/usrp2/gpmc/dbsm.v
@@ -56,28 +56,18 @@ module dbsm
full <= 0;
end
else
- if(write_done)
- if(writeable[write_sel]==(NUM_BUFS-1))
- begin
- write_sel <= 0;
- if(read_sel == 0)
- full <= 1;
- end
+ if(write_done & writeable[write_sel])
+ if(write_sel ==(NUM_BUFS-1))
+ write_sel <= 0;
else
- begin
- write_sel <= write_sel + 1;
- if(read_sel == write_sel + 1)
- full <= 1;
- end // else: !if(writeable[write_sel]==(NUM_BUFS-1))
- else if(read_done)
- full <= 0;
-
+ write_sel <= write_sel + 1;
+
always @(posedge clk)
if(reset | clear)
read_sel <= 0;
else
- if(read_done)
- if(readable[read_sel]==(NUM_BUFS-1))
+ if(read_done & readable[read_sel])
+ if(read_sel==(NUM_BUFS-1))
read_sel <= 0;
else
read_sel <= read_sel + 1;