snooping response handling fix

This commit is contained in:
Blaise Tine
2020-05-14 23:05:46 -04:00
parent bcb9514799
commit d623ef4029
13 changed files with 174 additions and 154 deletions

View 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

View File

@@ -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