diff options
author | Josh Blum <josh@joshknows.com> | 2011-03-03 11:28:15 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-03-03 11:28:15 -0800 |
commit | 1745009767ceb72e5cba6f4bfc8517ef33fecdf6 (patch) | |
tree | 29a41852d074e0f99e3d8a40c3285338ff40bb9b /usrp2 | |
parent | 6cbbabde84c0e6e1396b6e26ee888cdcbe762caf (diff) | |
download | uhd-1745009767ceb72e5cba6f4bfc8517ef33fecdf6.tar.gz uhd-1745009767ceb72e5cba6f4bfc8517ef33fecdf6.tar.bz2 uhd-1745009767ceb72e5cba6f4bfc8517ef33fecdf6.zip |
ethfifo_reorg: switch buffer int2 lastline to work as a length parameter
Diffstat (limited to 'usrp2')
-rw-r--r-- | usrp2/fifo/buffer_int2.v | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usrp2/fifo/buffer_int2.v b/usrp2/fifo/buffer_int2.v index 765b125fb..c73456b74 100644 --- a/usrp2/fifo/buffer_int2.v +++ b/usrp2/fifo/buffer_int2.v @@ -32,12 +32,13 @@ module buffer_int2 ); reg [BUF_SIZE-1:0] rd_addr, wr_addr; + wire [BUF_SIZE-1:0] rd_addr_next = rd_addr + 1; wire [31:0] ctrl; wire wr_done, wr_error, wr_idle; wire rd_done, rd_error, rd_idle; wire we, en, go; - reg [BUF_SIZE-1:0] lastline; + reg [BUF_SIZE-1:0] rd_length; wire read = ctrl[3]; wire rd_clear = ctrl[2]; wire write = ctrl[1]; @@ -72,13 +73,13 @@ module buffer_int2 begin rd_addr <= 0; rd_state <= PRE_READ; - lastline <= ctrl[15+BUF_SIZE:16]; + rd_length <= ctrl[15+BUF_SIZE:16]; end PRE_READ : begin rd_state <= READING; - rd_addr <= rd_addr + 1; + rd_addr <= rd_addr_next; rd_occ <= 2'b00; rd_sop <= 1; rd_eop <= 0; @@ -88,8 +89,8 @@ module buffer_int2 if(rd_ready_i) begin rd_sop <= 0; - rd_addr <= rd_addr + 1; - if(rd_addr == lastline) + rd_addr <= rd_addr_next; + if(rd_addr_next == rd_length) begin rd_eop <= 1; // FIXME assign occ here |