snooping response handling fix
This commit is contained in:
56
hw/rtl/libs/VX_matrix_arbiter.v
Normal file
56
hw/rtl/libs/VX_matrix_arbiter.v
Normal file
@@ -0,0 +1,56 @@
|
||||
`include "VX_define.vh"
|
||||
|
||||
module VX_matrix_arbiter #(
|
||||
parameter N = 0
|
||||
) (
|
||||
input wire clk,
|
||||
input wire reset,
|
||||
input wire [N-1:0] inputs,
|
||||
output wire [N-1:0] grant
|
||||
);
|
||||
|
||||
reg [N-1:1][N-1:0] pri;
|
||||
|
||||
always @(posedge clk) begin
|
||||
if (reset) begin
|
||||
integer i, j;
|
||||
for (i = 0; i < N; ++i) begin
|
||||
for (j = 0; j < N; ++j) begin
|
||||
pri[i][j] <= 1;
|
||||
end
|
||||
end
|
||||
end else begin
|
||||
integer i, j;
|
||||
for (i = 0; i < N; ++i) begin
|
||||
if (grant[i]) begin
|
||||
for (j = 0; j < N; ++j) begin
|
||||
if (j > i)
|
||||
pri[j][i] <= 1;
|
||||
else if (j < i)
|
||||
pri[i][j] <= 0;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
genvar i, j;
|
||||
|
||||
for (i = 0; i < N; ++i) begin
|
||||
|
||||
wire [N-1:0] dis;
|
||||
|
||||
for (j = 0; j < N; ++j) begin
|
||||
if (j > i) begin
|
||||
assign dis[j] = inputs[j] & pri[j][i];
|
||||
end else if (j < i) begin
|
||||
assign dis[j] = inputs[j] & ~pri[i][j];
|
||||
end else begin
|
||||
assign dis[j] = 0;
|
||||
end
|
||||
end
|
||||
|
||||
assign grant[i] = inputs[i] & ~(| dis);
|
||||
end
|
||||
|
||||
endmodule
|
||||
@@ -16,7 +16,7 @@ module VX_priority_encoder #(
|
||||
found_r = 0;
|
||||
for (i = `NUM_WARPS-1; i >= 0; i = i - 1) begin
|
||||
if (valids[i]) begin
|
||||
index_r = i[`NW_BITS-1:0];
|
||||
index_r = `NW_BITS'(i);
|
||||
found_r = 1;
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user