Skip to content

Commit 57e1306

Browse files
committed
id_queue: Simplify existence lookup for Verilator speed-up
1 parent 9afda9a commit 57e1306

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/id_queue.sv

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -362,22 +362,10 @@ module id_queue #(
362362
// Exists Lookup
363363
for (genvar k = 0; k < NUM_CMP_PORTS; k++) begin: gen_lookup_port
364364
for (genvar i = 0; i < CAPACITY; i++) begin: gen_lookup
365-
data_t exists_match_bits;
366-
for (genvar j = 0; j < $bits(data_t); j++) begin: gen_mask
367-
always_comb begin
368-
if (linked_data_q[i].free) begin
369-
exists_match_bits[j] = 1'b0;
370-
end else begin
371-
if (!exists_mask_i[k][j]) begin
372-
exists_match_bits[j] = 1'b1;
373-
end else begin
374-
exists_match_bits[j] =
375-
(linked_data_q[i].data[j] == exists_data_i[k][j]);
376-
end
377-
end
378-
end
379-
end
380-
assign exists_match[k][i] = (&exists_match_bits);
365+
// For a match, the entry needs to be occupied AND
366+
// the masked slot data needs to match the masked query data.
367+
assign exists_match[k][i] = !linked_data_q[i].free &&
368+
((linked_data_q[i].data & exists_mask_i[k]) == (exists_data_i[k] & exists_mask_i[k]));
381369
end
382370
always_comb begin
383371
exists_gnt_o[k] = 1'b0;

0 commit comments

Comments
 (0)