Skip to content

Truncation of usage_o port in fifo_v3 when parameter DEPTH is a power of 2 #69

@WRoenninger

Description

@WRoenninger

The usage_o port of fifo_v3 has currently a width of $clog(DEPTH).
This causes the pointer to wrap around to all zeros, if the FIFO has a power of 2 DEPTH and is full. This is an issue for the following exapmle:

localparam int unsigned Depth     = 32'd16;
localparam logic [3:0]  Threshold = 4'hF;
logic [3:0] usage;
if (usage > threshold) begin
  /* do something */
end

This if statement would not trigger in this case.
This could be resolved by assigning the whole status_cnt_q to the usage_o port instead of the truncated one as is currently the case.

The workaround I am using currently is prepending the full_o signal to the ussage_o, however this causes jumps in this new usage pointer value when the FIFO is not configured to a power of 2 DEPTH.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions