Remove event feedback path (not logical path) in priority encoder

This commit is contained in:
Luke Wren 2021-11-28 02:19:01 +00:00
parent ba27dd838f
commit 800b21d2f5
1 changed files with 3 additions and 6 deletions

View File

@ -30,17 +30,14 @@ module hazard3_priority_encode #(
// First do a priority-select of the input bitmap. // First do a priority-select of the input bitmap.
reg [W_REQ-1:0] deny; reg [W_REQ-1:0] gnt_onehot;
always @ (*) begin: smear always @ (*) begin: smear
integer i; integer i;
deny[0] = 1'b0; for (i = 0; i < W_REQ; i = i + 1)
for (i = 1; i < W_REQ; i = i + 1) gnt_onehot[i] = req[i] && ~|(req & ~({W_REQ{1'b1}} << i));
deny[i] = deny[i - 1] || req[i - 1];
end end
wire [W_REQ-1:0] gnt_onehot = req & ~deny;
// As the result is onehot, we can now just OR in the representation of each // As the result is onehot, we can now just OR in the representation of each
// encoded integer. // encoded integer.