Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/id_queue.sv
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ module id_queue #(
input logic oup_req_i,
output data_t oup_data_o,
output logic oup_data_valid_o,
output logic oup_gnt_o
output logic oup_gnt_o,

output logic full_o,
output logic empty_o
);

// Capacity of the head-tail table, which associates an ID with corresponding head and tail
Expand Down Expand Up @@ -184,8 +187,10 @@ module id_queue #(
.empty_o ( )
);

// The queue is full if and only if there are no free items in the linked data structure.
// The queue is full if and only if there are no free entries in the linked data structure.
assign full = !(|linked_data_free);
// The queue is empty if and only if all entries in the linked data structure are free.
assign empty = &linked_data_free;
// Data potentially freed by the output.
assign oup_data_free_idx = head_tail_q[match_out_idx].head;

Expand Down Expand Up @@ -400,6 +405,10 @@ module id_queue #(
end
end

// Status interface
assign full_o = full;
assign empty_o = empty;

// Validate parameters.
`ifndef COMMON_CELLS_ASSERTS_OFF
`ASSERT_INIT(id_width_0, ID_WIDTH >= 1, "The ID must at least be one bit wide!")
Expand Down