Skip to content

Commit

Permalink
util_axis_fifo: Fix the FIFO level generation in ASYNC mode
Browse files Browse the repository at this point in the history
The FIFO functions in 'first fall through' mode, adjust the fifo level
generation so it take into account the valid data which sits on the bus,
waiting for ready, too.
  • Loading branch information
Istvan Csomortani authored and Csomi committed Jan 29, 2019
1 parent b221718 commit b2d86ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/util_axis_fifo/util_axis_fifo.v
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ end else begin
wire [ADDRESS_WIDTH-1:0] m_axis_raddr;
wire _m_axis_ready;
wire _m_axis_valid;
wire [ADDRESS_WIDTH:0] _m_axis_level;

wire s_mem_write;
wire m_mem_read;
Expand Down Expand Up @@ -158,7 +159,7 @@ end else begin
.m_axis_ready(_m_axis_ready),
.m_axis_valid(_m_axis_valid),
.m_axis_raddr(m_axis_raddr),
.m_axis_level(m_axis_level),
.m_axis_level(_m_axis_level),

.s_axis_aclk(s_axis_aclk),
.s_axis_aresetn(s_axis_aresetn),
Expand Down Expand Up @@ -188,6 +189,10 @@ end else begin

assign _m_axis_ready = ~valid || m_axis_ready;
assign m_axis_valid = valid;
// the util_axis_fifo is functioning in 'first write fall through' mode,
// which means that we need to assure that the value of the level reflects
// the actual FIFO level plus the available data, which sits on the bus
assign m_axis_level = (m_axis_valid) ? _m_axis_level + 1'b1 : _m_axis_level;

end else begin

Expand Down

0 comments on commit b2d86ba

Please sign in to comment.