round robin arbiter + auto buffered queue + fixed dcache arbiter
This commit is contained in:
@@ -3,26 +3,20 @@
|
||||
module VX_priority_encoder #(
|
||||
parameter N
|
||||
) (
|
||||
input wire [N-1:0] valids,
|
||||
output wire [`LOG2UP(N)-1:0] index,
|
||||
output wire found
|
||||
input wire [N-1:0] data_in,
|
||||
output reg [`LOG2UP(N)-1:0] data_out,
|
||||
output reg valid_out
|
||||
);
|
||||
reg [`LOG2UP(N)-1:0] index_r;
|
||||
reg found_r;
|
||||
|
||||
integer i;
|
||||
always @(*) begin
|
||||
index_r = 0;
|
||||
found_r = 0;
|
||||
for (i = `NUM_WARPS-1; i >= 0; i = i - 1) begin
|
||||
if (valids[i]) begin
|
||||
index_r = `NW_BITS'(i);
|
||||
found_r = 1;
|
||||
data_out = 0;
|
||||
valid_out = 0;
|
||||
for (i = N-1; i >= 0; i = i - 1) begin
|
||||
if (data_in[i]) begin
|
||||
data_out = `LOG2UP(N)'(i);
|
||||
valid_out = 1;
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assign index = index_r;
|
||||
assign found = found_r;
|
||||
|
||||
endmodule
|
||||
Reference in New Issue
Block a user