Skip to content

Commit 115aa96

Browse files
committed
id_queue: Expose full and empty status
1 parent 1e384c9 commit 115aa96

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/id_queue.sv

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ module id_queue #(
7676
input logic oup_req_i,
7777
output data_t oup_data_o,
7878
output logic oup_data_valid_o,
79-
output logic oup_gnt_o
79+
output logic oup_gnt_o,
80+
81+
output logic full_o,
82+
output logic empty_o
8083
);
8184

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

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

@@ -400,6 +405,10 @@ module id_queue #(
400405
end
401406
end
402407

408+
// Status interface
409+
assign full_o = full;
410+
assign empty_o = empty;
411+
403412
// Validate parameters.
404413
`ifndef COMMON_CELLS_ASSERTS_OFF
405414
`ASSERT_INIT(id_width_0, ID_WIDTH >= 1, "The ID must at least be one bit wide!")

0 commit comments

Comments
 (0)