minor update
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
`endif
|
`endif
|
||||||
|
|
||||||
`ifndef NUM_THREADS
|
`ifndef NUM_THREADS
|
||||||
`define NUM_THREADS 8
|
`define NUM_THREADS 4
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
`ifndef NUM_BARRIERS
|
`ifndef NUM_BARRIERS
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
`endif
|
`endif
|
||||||
|
|
||||||
`ifndef L1_BLOCK_SIZE
|
`ifndef L1_BLOCK_SIZE
|
||||||
`define L1_BLOCK_SIZE 16
|
`define L1_BLOCK_SIZE (`NUM_THREADS * 4)
|
||||||
`endif
|
`endif
|
||||||
|
|
||||||
`ifndef STARTUP_ADDR
|
`ifndef STARTUP_ADDR
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ module VX_io_arb #(
|
|||||||
input wire [WORD_WIDTH-1:0] io_rsp_data_out,
|
input wire [WORD_WIDTH-1:0] io_rsp_data_out,
|
||||||
output wire io_rsp_ready_out
|
output wire io_rsp_ready_out
|
||||||
);
|
);
|
||||||
|
if (NUM_REQS > 1) begin
|
||||||
|
|
||||||
wire [NUM_REQS-1:0] valids;
|
wire [NUM_REQS-1:0] valids;
|
||||||
for (genvar i = 0; i < NUM_REQS; i++) begin
|
for (genvar i = 0; i < NUM_REQS; i++) begin
|
||||||
assign valids[i] = (| io_req_valid_in[i]);
|
assign valids[i] = (| io_req_valid_in[i]);
|
||||||
@@ -50,7 +52,7 @@ module VX_io_arb #(
|
|||||||
|
|
||||||
wire [NUM_REQS-1:0][(`NUM_THREADS + TAG_OUT_WIDTH + (`NUM_THREADS * ADDR_WIDTH) + 1 + (`NUM_THREADS * WORD_SIZE) + (`NUM_THREADS * WORD_WIDTH))-1:0] data_in;
|
wire [NUM_REQS-1:0][(`NUM_THREADS + TAG_OUT_WIDTH + (`NUM_THREADS * ADDR_WIDTH) + 1 + (`NUM_THREADS * WORD_SIZE) + (`NUM_THREADS * WORD_WIDTH))-1:0] data_in;
|
||||||
for (genvar i = 0; i < NUM_REQS; i++) begin
|
for (genvar i = 0; i < NUM_REQS; i++) begin
|
||||||
assign data_in[i] = {{io_req_valid_in[i], io_req_tag_in[i], REQS_BITS'(i)}, io_req_addr_in[i], io_req_rw_in[i], io_req_byteen_in[i], io_req_data_in[i]};
|
assign data_in[i] = {io_req_valid_in[i], {io_req_tag_in[i], REQS_BITS'(i)}, io_req_addr_in[i], io_req_rw_in[i], io_req_byteen_in[i], io_req_data_in[i]};
|
||||||
end
|
end
|
||||||
|
|
||||||
wire [`NUM_THREADS-1:0] io_req_tmask_out;
|
wire [`NUM_THREADS-1:0] io_req_tmask_out;
|
||||||
@@ -75,8 +77,6 @@ module VX_io_arb #(
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if (NUM_REQS > 1) begin
|
|
||||||
|
|
||||||
wire [REQS_BITS-1:0] rsp_sel = io_rsp_tag_out[REQS_BITS-1:0];
|
wire [REQS_BITS-1:0] rsp_sel = io_rsp_tag_out[REQS_BITS-1:0];
|
||||||
|
|
||||||
for (genvar i = 0; i < NUM_REQS; i++) begin
|
for (genvar i = 0; i < NUM_REQS; i++) begin
|
||||||
@@ -92,6 +92,14 @@ module VX_io_arb #(
|
|||||||
`UNUSED_VAR (clk)
|
`UNUSED_VAR (clk)
|
||||||
`UNUSED_VAR (reset)
|
`UNUSED_VAR (reset)
|
||||||
|
|
||||||
|
assign io_req_valid_out = io_req_valid_in;
|
||||||
|
assign io_req_tag_out = io_req_tag_in;
|
||||||
|
assign io_req_addr_out = io_req_addr_in;
|
||||||
|
assign io_req_rw_out = io_req_rw_in;
|
||||||
|
assign io_req_byteen_out = io_req_byteen_in;
|
||||||
|
assign io_req_data_out = io_req_data_in;
|
||||||
|
assign io_req_ready_in = io_req_ready_out;
|
||||||
|
|
||||||
assign io_rsp_valid_in = io_rsp_valid_out;
|
assign io_rsp_valid_in = io_rsp_valid_out;
|
||||||
assign io_rsp_tag_in = io_rsp_tag_out;
|
assign io_rsp_tag_in = io_rsp_tag_out;
|
||||||
assign io_rsp_data_in = io_rsp_data_out;
|
assign io_rsp_data_in = io_rsp_data_out;
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ module VX_mem_arb #(
|
|||||||
input wire [DATA_WIDTH-1:0] rsp_data_in,
|
input wire [DATA_WIDTH-1:0] rsp_data_in,
|
||||||
output wire rsp_ready_in
|
output wire rsp_ready_in
|
||||||
);
|
);
|
||||||
|
if (NUM_REQS > 1) begin
|
||||||
|
|
||||||
wire [NUM_REQS-1:0][(TAG_OUT_WIDTH + ADDR_WIDTH + 1 + DATA_SIZE + DATA_WIDTH)-1:0] data_in;
|
wire [NUM_REQS-1:0][(TAG_OUT_WIDTH + ADDR_WIDTH + 1 + DATA_SIZE + DATA_WIDTH)-1:0] data_in;
|
||||||
for (genvar i = 0; i < NUM_REQS; i++) begin
|
for (genvar i = 0; i < NUM_REQS; i++) begin
|
||||||
assign data_in[i] = {{req_tag_in[i], REQS_BITS'(i)}, req_addr_in[i], req_rw_in[i], req_byteen_in[i], req_data_in[i]};
|
assign data_in[i] = {{req_tag_in[i], REQS_BITS'(i)}, req_addr_in[i], req_rw_in[i], req_byteen_in[i], req_data_in[i]};
|
||||||
@@ -65,8 +67,6 @@ module VX_mem_arb #(
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
if (NUM_REQS > 1) begin
|
|
||||||
|
|
||||||
wire [REQS_BITS-1:0] rsp_sel = rsp_tag_in [REQS_BITS-1:0];
|
wire [REQS_BITS-1:0] rsp_sel = rsp_tag_in [REQS_BITS-1:0];
|
||||||
|
|
||||||
for (genvar i = 0; i < NUM_REQS; i++) begin
|
for (genvar i = 0; i < NUM_REQS; i++) begin
|
||||||
|
|||||||
14
hw/rtl/cache/VX_cache.v
vendored
14
hw/rtl/cache/VX_cache.v
vendored
@@ -6,13 +6,13 @@ module VX_cache #(
|
|||||||
// Size of cache in bytes
|
// Size of cache in bytes
|
||||||
parameter CACHE_SIZE = 8092,
|
parameter CACHE_SIZE = 8092,
|
||||||
// Size of line inside a bank in bytes
|
// Size of line inside a bank in bytes
|
||||||
parameter BANK_LINE_SIZE = 64,
|
parameter BANK_LINE_SIZE = 16,
|
||||||
// Number of banks
|
// Number of banks
|
||||||
parameter NUM_BANKS = 4,
|
parameter NUM_BANKS = 4,
|
||||||
// Size of a word in bytes
|
// Size of a word in bytes
|
||||||
parameter WORD_SIZE = 4,
|
parameter WORD_SIZE = 4,
|
||||||
// Number of Word requests per cycle
|
// Number of Word requests per cycle
|
||||||
parameter NUM_REQS = 4,
|
parameter NUM_REQS = NUM_BANKS,
|
||||||
|
|
||||||
// Core Request Queue Size
|
// Core Request Queue Size
|
||||||
parameter CREQ_SIZE = 4,
|
parameter CREQ_SIZE = 4,
|
||||||
@@ -39,14 +39,14 @@ module VX_cache #(
|
|||||||
// Enable cache flush
|
// Enable cache flush
|
||||||
parameter FLUSH_ENABLE = 1,
|
parameter FLUSH_ENABLE = 1,
|
||||||
|
|
||||||
// core request tag size
|
|
||||||
parameter CORE_TAG_WIDTH = 4,
|
|
||||||
|
|
||||||
// size of tag id in core request tag
|
// size of tag id in core request tag
|
||||||
parameter CORE_TAG_ID_BITS = 0,
|
parameter CORE_TAG_ID_BITS = $clog2(MSHR_SIZE),
|
||||||
|
|
||||||
|
// core request tag size
|
||||||
|
parameter CORE_TAG_WIDTH = CORE_TAG_ID_BITS,
|
||||||
|
|
||||||
// dram request tag size
|
// dram request tag size
|
||||||
parameter DRAM_TAG_WIDTH = 28,
|
parameter DRAM_TAG_WIDTH = (32 - $clog2(BANK_LINE_SIZE)),
|
||||||
|
|
||||||
// Snooping request tag width
|
// Snooping request tag width
|
||||||
parameter SNP_TAG_WIDTH = 1
|
parameter SNP_TAG_WIDTH = 1
|
||||||
|
|||||||
33
hw/rtl/cache/VX_cache_core_rsp_merge.v
vendored
33
hw/rtl/cache/VX_cache_core_rsp_merge.v
vendored
@@ -62,6 +62,7 @@ module VX_cache_core_rsp_merge #(
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end else begin
|
end else begin
|
||||||
|
|
||||||
always @(*) begin
|
always @(*) begin
|
||||||
@@ -80,6 +81,7 @@ module VX_cache_core_rsp_merge #(
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
wire stall = ~core_rsp_ready && (| core_rsp_valid);
|
wire stall = ~core_rsp_ready && (| core_rsp_valid);
|
||||||
@@ -100,19 +102,40 @@ module VX_cache_core_rsp_merge #(
|
|||||||
for (genvar i = 0; i < NUM_BANKS; i++) begin
|
for (genvar i = 0; i < NUM_BANKS; i++) begin
|
||||||
assign per_bank_core_rsp_ready[i] = core_rsp_bank_select[i] && ~stall;
|
assign per_bank_core_rsp_ready[i] = core_rsp_bank_select[i] && ~stall;
|
||||||
end
|
end
|
||||||
|
|
||||||
end else begin
|
end else begin
|
||||||
|
|
||||||
`UNUSED_VAR (clk)
|
`UNUSED_VAR (clk)
|
||||||
`UNUSED_VAR (reset)
|
`UNUSED_VAR (reset)
|
||||||
|
|
||||||
if (NUM_REQS > 1) begin
|
if (NUM_REQS > 1) begin
|
||||||
|
|
||||||
assign core_rsp_valid[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_valid;
|
reg [NUM_REQS-1:0] core_rsp_valid_unqual;
|
||||||
|
reg [`CORE_REQ_TAG_COUNT-1:0][CORE_TAG_WIDTH-1:0] core_rsp_tag_unqual;
|
||||||
|
reg [NUM_REQS-1:0][`WORD_WIDTH-1:0] core_rsp_data_unqual;
|
||||||
|
|
||||||
if (CORE_TAG_ID_BITS != 0) begin
|
if (CORE_TAG_ID_BITS != 0) begin
|
||||||
assign core_rsp_tag = per_bank_core_rsp_tag[0];
|
always @(*) begin
|
||||||
end else begin
|
core_rsp_valid_unqual = 0;
|
||||||
assign core_rsp_tag[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_tag[0];
|
core_rsp_tag_unqual = per_bank_core_rsp_tag[0];
|
||||||
|
core_rsp_data_unqual = 'x;
|
||||||
|
core_rsp_valid_unqual[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_valid;
|
||||||
|
core_rsp_data_unqual[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_data[0];
|
||||||
end
|
end
|
||||||
assign core_rsp_data[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_data[0];
|
end else begin
|
||||||
|
always @(*) begin
|
||||||
|
core_rsp_valid_unqual = 0;
|
||||||
|
core_rsp_tag_unqual = 'x;
|
||||||
|
core_rsp_data_unqual = 'x;
|
||||||
|
core_rsp_valid_unqual[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_valid;
|
||||||
|
core_rsp_tag_unqual[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_tag[0];
|
||||||
|
core_rsp_data_unqual[per_bank_core_rsp_tid[0]] = per_bank_core_rsp_data[0];
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
assign core_rsp_valid = core_rsp_valid_unqual;
|
||||||
|
assign core_rsp_tag = core_rsp_tag_unqual;
|
||||||
|
assign core_rsp_data = core_rsp_data_unqual;
|
||||||
assign per_bank_core_rsp_ready[0] = core_rsp_ready;
|
assign per_bank_core_rsp_ready[0] = core_rsp_ready;
|
||||||
|
|
||||||
end else begin
|
end else begin
|
||||||
|
|||||||
Reference in New Issue
Block a user