added support for write-through cache, removed cache snooping support
This commit is contained in:
231
hw/rtl/Vortex.v
231
hw/rtl/Vortex.v
@@ -22,30 +22,18 @@ module Vortex (
|
||||
input wire [`VX_DRAM_TAG_WIDTH-1:0] dram_rsp_tag,
|
||||
output wire dram_rsp_ready,
|
||||
|
||||
// Snoop request
|
||||
input wire snp_req_valid,
|
||||
input wire [`VX_DRAM_ADDR_WIDTH-1:0] snp_req_addr,
|
||||
input wire snp_req_inv,
|
||||
input wire [`VX_SNP_TAG_WIDTH-1:0] snp_req_tag,
|
||||
output wire snp_req_ready,
|
||||
|
||||
// Snoop response
|
||||
output wire snp_rsp_valid,
|
||||
output wire [`VX_SNP_TAG_WIDTH-1:0] snp_rsp_tag,
|
||||
input wire snp_rsp_ready,
|
||||
|
||||
// CSR Request
|
||||
input wire csr_io_req_valid,
|
||||
input wire [`VX_CSR_ID_WIDTH-1:0] csr_io_req_coreid,
|
||||
input wire [11:0] csr_io_req_addr,
|
||||
input wire csr_io_req_rw,
|
||||
input wire [31:0] csr_io_req_data,
|
||||
output wire csr_io_req_ready,
|
||||
input wire csr_req_valid,
|
||||
input wire [`VX_CSR_ID_WIDTH-1:0] csr_req_coreid,
|
||||
input wire [11:0] csr_req_addr,
|
||||
input wire csr_req_rw,
|
||||
input wire [31:0] csr_req_data,
|
||||
output wire csr_req_ready,
|
||||
|
||||
// CSR Response
|
||||
output wire csr_io_rsp_valid,
|
||||
output wire [31:0] csr_io_rsp_data,
|
||||
input wire csr_io_rsp_ready,
|
||||
output wire csr_rsp_valid,
|
||||
output wire [31:0] csr_rsp_data,
|
||||
input wire csr_rsp_ready,
|
||||
|
||||
// Status
|
||||
output wire busy,
|
||||
@@ -64,31 +52,21 @@ module Vortex (
|
||||
wire [`NUM_CLUSTERS-1:0][`L2DRAM_TAG_WIDTH-1:0] per_cluster_dram_rsp_tag;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_dram_rsp_ready;
|
||||
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_snp_req_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][`L2DRAM_ADDR_WIDTH-1:0] per_cluster_snp_req_addr;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_snp_req_inv;
|
||||
wire [`NUM_CLUSTERS-1:0][`L2SNP_TAG_WIDTH-1:0] per_cluster_snp_req_tag;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_snp_req_ready;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_req_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][11:0] per_cluster_csr_req_addr;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_req_rw;
|
||||
wire [`NUM_CLUSTERS-1:0][31:0] per_cluster_csr_req_data;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_req_ready;
|
||||
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_snp_rsp_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][`L2SNP_TAG_WIDTH-1:0] per_cluster_snp_rsp_tag;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_snp_rsp_ready;
|
||||
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_io_req_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][11:0] per_cluster_csr_io_req_addr;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_io_req_rw;
|
||||
wire [`NUM_CLUSTERS-1:0][31:0] per_cluster_csr_io_req_data;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_io_req_ready;
|
||||
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_io_rsp_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][31:0] per_cluster_csr_io_rsp_data;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_io_rsp_ready;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_rsp_valid;
|
||||
wire [`NUM_CLUSTERS-1:0][31:0] per_cluster_csr_rsp_data;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_csr_rsp_ready;
|
||||
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_busy;
|
||||
wire [`NUM_CLUSTERS-1:0] per_cluster_ebreak;
|
||||
|
||||
wire [`LOG2UP(`NUM_CLUSTERS)-1:0] csr_io_cluster_id = `LOG2UP(`NUM_CLUSTERS)'(csr_io_req_coreid >> `CLOG2(`NUM_CORES));
|
||||
wire [`NC_BITS-1:0] csr_io_core_id = `NC_BITS'(csr_io_req_coreid);
|
||||
wire [`LOG2UP(`NUM_CLUSTERS)-1:0] csr_cluster_id = `LOG2UP(`NUM_CLUSTERS)'(csr_req_coreid >> `CLOG2(`NUM_CORES));
|
||||
wire [`NC_BITS-1:0] csr_core_id = `NC_BITS'(csr_req_coreid);
|
||||
|
||||
for (genvar i = 0; i < `NUM_CLUSTERS; i++) begin
|
||||
VX_cluster #(
|
||||
@@ -96,130 +74,78 @@ module Vortex (
|
||||
) cluster (
|
||||
`SCOPE_BIND_Vortex_cluster(i)
|
||||
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
|
||||
.dram_req_valid (per_cluster_dram_req_valid [i]),
|
||||
.dram_req_rw (per_cluster_dram_req_rw [i]),
|
||||
.dram_req_byteen (per_cluster_dram_req_byteen[i]),
|
||||
.dram_req_addr (per_cluster_dram_req_addr [i]),
|
||||
.dram_req_data (per_cluster_dram_req_data [i]),
|
||||
.dram_req_tag (per_cluster_dram_req_tag [i]),
|
||||
.dram_req_ready (per_cluster_dram_req_ready [i]),
|
||||
.dram_req_valid (per_cluster_dram_req_valid [i]),
|
||||
.dram_req_rw (per_cluster_dram_req_rw [i]),
|
||||
.dram_req_byteen(per_cluster_dram_req_byteen[i]),
|
||||
.dram_req_addr (per_cluster_dram_req_addr [i]),
|
||||
.dram_req_data (per_cluster_dram_req_data [i]),
|
||||
.dram_req_tag (per_cluster_dram_req_tag [i]),
|
||||
.dram_req_ready (per_cluster_dram_req_ready [i]),
|
||||
|
||||
.dram_rsp_valid (per_cluster_dram_rsp_valid [i]),
|
||||
.dram_rsp_data (per_cluster_dram_rsp_data [i]),
|
||||
.dram_rsp_tag (per_cluster_dram_rsp_tag [i]),
|
||||
.dram_rsp_ready (per_cluster_dram_rsp_ready [i]),
|
||||
.dram_rsp_valid (per_cluster_dram_rsp_valid [i]),
|
||||
.dram_rsp_data (per_cluster_dram_rsp_data [i]),
|
||||
.dram_rsp_tag (per_cluster_dram_rsp_tag [i]),
|
||||
.dram_rsp_ready (per_cluster_dram_rsp_ready [i]),
|
||||
|
||||
.snp_req_valid (per_cluster_snp_req_valid [i]),
|
||||
.snp_req_addr (per_cluster_snp_req_addr [i]),
|
||||
.snp_req_inv (per_cluster_snp_req_inv [i]),
|
||||
.snp_req_tag (per_cluster_snp_req_tag [i]),
|
||||
.snp_req_ready (per_cluster_snp_req_ready [i]),
|
||||
.csr_req_valid (per_cluster_csr_req_valid [i]),
|
||||
.csr_req_coreid (csr_core_id),
|
||||
.csr_req_rw (per_cluster_csr_req_rw [i]),
|
||||
.csr_req_addr (per_cluster_csr_req_addr [i]),
|
||||
.csr_req_data (per_cluster_csr_req_data [i]),
|
||||
.csr_req_ready (per_cluster_csr_req_ready [i]),
|
||||
|
||||
.snp_rsp_valid (per_cluster_snp_rsp_valid [i]),
|
||||
.snp_rsp_tag (per_cluster_snp_rsp_tag [i]),
|
||||
.snp_rsp_ready (per_cluster_snp_rsp_ready [i]),
|
||||
.csr_rsp_valid (per_cluster_csr_rsp_valid [i]),
|
||||
.csr_rsp_data (per_cluster_csr_rsp_data [i]),
|
||||
.csr_rsp_ready (per_cluster_csr_rsp_ready [i]),
|
||||
|
||||
.csr_io_req_valid (per_cluster_csr_io_req_valid[i]),
|
||||
.csr_io_req_coreid (csr_io_core_id),
|
||||
.csr_io_req_rw (per_cluster_csr_io_req_rw [i]),
|
||||
.csr_io_req_addr (per_cluster_csr_io_req_addr[i]),
|
||||
.csr_io_req_data (per_cluster_csr_io_req_data[i]),
|
||||
.csr_io_req_ready (per_cluster_csr_io_req_ready[i]),
|
||||
|
||||
.csr_io_rsp_valid (per_cluster_csr_io_rsp_valid[i]),
|
||||
.csr_io_rsp_data (per_cluster_csr_io_rsp_data[i]),
|
||||
.csr_io_rsp_ready (per_cluster_csr_io_rsp_ready[i]),
|
||||
|
||||
.busy (per_cluster_busy [i]),
|
||||
.ebreak (per_cluster_ebreak [i])
|
||||
.busy (per_cluster_busy [i]),
|
||||
.ebreak (per_cluster_ebreak [i])
|
||||
);
|
||||
end
|
||||
|
||||
VX_csr_io_arb #(
|
||||
VX_csr_arb #(
|
||||
.NUM_REQS (`NUM_CLUSTERS),
|
||||
.DATA_WIDTH (32),
|
||||
.ADDR_WIDTH (12),
|
||||
.BUFFERED_REQ (`NUM_CLUSTERS >= 4),
|
||||
.BUFFERED_RSP (1)
|
||||
) csr_io_arb (
|
||||
) csr_arb (
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
|
||||
.request_id (csr_io_cluster_id),
|
||||
.request_id (csr_cluster_id),
|
||||
|
||||
// input requests
|
||||
.req_valid_in (csr_io_req_valid),
|
||||
.req_addr_in (csr_io_req_addr),
|
||||
.req_rw_in (csr_io_req_rw),
|
||||
.req_data_in (csr_io_req_data),
|
||||
.req_ready_in (csr_io_req_ready),
|
||||
.req_valid_in (csr_req_valid),
|
||||
.req_addr_in (csr_req_addr),
|
||||
.req_rw_in (csr_req_rw),
|
||||
.req_data_in (csr_req_data),
|
||||
.req_ready_in (csr_req_ready),
|
||||
|
||||
// output request
|
||||
.req_valid_out (per_cluster_csr_io_req_valid),
|
||||
.req_addr_out (per_cluster_csr_io_req_addr),
|
||||
.req_rw_out (per_cluster_csr_io_req_rw),
|
||||
.req_data_out (per_cluster_csr_io_req_data),
|
||||
.req_ready_out (per_cluster_csr_io_req_ready),
|
||||
.req_valid_out (per_cluster_csr_req_valid),
|
||||
.req_addr_out (per_cluster_csr_req_addr),
|
||||
.req_rw_out (per_cluster_csr_req_rw),
|
||||
.req_data_out (per_cluster_csr_req_data),
|
||||
.req_ready_out (per_cluster_csr_req_ready),
|
||||
|
||||
// input responses
|
||||
.rsp_valid_in (per_cluster_csr_io_rsp_valid),
|
||||
.rsp_data_in (per_cluster_csr_io_rsp_data),
|
||||
.rsp_ready_in (per_cluster_csr_io_rsp_ready),
|
||||
.rsp_valid_in (per_cluster_csr_rsp_valid),
|
||||
.rsp_data_in (per_cluster_csr_rsp_data),
|
||||
.rsp_ready_in (per_cluster_csr_rsp_ready),
|
||||
|
||||
// output response
|
||||
.rsp_valid_out (csr_io_rsp_valid),
|
||||
.rsp_data_out (csr_io_rsp_data),
|
||||
.rsp_ready_out (csr_io_rsp_ready)
|
||||
.rsp_valid_out (csr_rsp_valid),
|
||||
.rsp_data_out (csr_rsp_data),
|
||||
.rsp_ready_out (csr_rsp_ready)
|
||||
);
|
||||
|
||||
assign busy = (| per_cluster_busy);
|
||||
assign ebreak = (| per_cluster_ebreak);
|
||||
|
||||
wire snp_fwd_rsp_valid;
|
||||
wire [`L3DRAM_ADDR_WIDTH-1:0] snp_fwd_rsp_addr;
|
||||
wire snp_fwd_rsp_inv;
|
||||
wire [`L3SNP_TAG_WIDTH-1:0] snp_fwd_rsp_tag;
|
||||
wire snp_fwd_rsp_ready;
|
||||
|
||||
VX_snp_forwarder #(
|
||||
.CACHE_ID (`L3CACHE_ID),
|
||||
.NUM_REQS (`NUM_CLUSTERS),
|
||||
.SRC_ADDR_WIDTH (`L3DRAM_ADDR_WIDTH),
|
||||
.DST_ADDR_WIDTH (`L2DRAM_ADDR_WIDTH),
|
||||
.TAG_IN_WIDTH (`L3SNP_TAG_WIDTH),
|
||||
.TAG_OUT_WIDTH (`L2SNP_TAG_WIDTH),
|
||||
.SREQ_SIZE (`L3SREQ_SIZE),
|
||||
.BUFFERED (`NUM_CLUSTERS >= 4)
|
||||
) snp_forwarder (
|
||||
.clk (clk),
|
||||
.reset (reset),
|
||||
|
||||
.snp_req_valid (snp_req_valid),
|
||||
.snp_req_addr (snp_req_addr),
|
||||
.snp_req_inv (snp_req_inv),
|
||||
.snp_req_tag (snp_req_tag),
|
||||
.snp_req_ready (snp_req_ready),
|
||||
|
||||
.snp_rsp_valid (snp_fwd_rsp_valid),
|
||||
.snp_rsp_addr (snp_fwd_rsp_addr),
|
||||
.snp_rsp_inv (snp_fwd_rsp_inv),
|
||||
.snp_rsp_tag (snp_fwd_rsp_tag),
|
||||
.snp_rsp_ready (snp_fwd_rsp_ready),
|
||||
|
||||
.snp_fwdout_valid (per_cluster_snp_req_valid),
|
||||
.snp_fwdout_addr (per_cluster_snp_req_addr),
|
||||
.snp_fwdout_inv (per_cluster_snp_req_inv),
|
||||
.snp_fwdout_tag (per_cluster_snp_req_tag),
|
||||
.snp_fwdout_ready (per_cluster_snp_req_ready),
|
||||
|
||||
.snp_fwdin_valid (per_cluster_snp_rsp_valid),
|
||||
.snp_fwdin_tag (per_cluster_snp_rsp_tag),
|
||||
.snp_fwdin_ready (per_cluster_snp_rsp_ready)
|
||||
);
|
||||
|
||||
if (`L3_ENABLE) begin
|
||||
`ifdef PERF_ENABLE
|
||||
VX_perf_cache_if perf_l3cache_if();
|
||||
@@ -235,17 +161,13 @@ module Vortex (
|
||||
.CREQ_SIZE (`L3CREQ_SIZE),
|
||||
.MSHR_SIZE (`L3MSHR_SIZE),
|
||||
.DRSQ_SIZE (`L3DRSQ_SIZE),
|
||||
.SREQ_SIZE (`L3SREQ_SIZE),
|
||||
.CRSQ_SIZE (`L3CRSQ_SIZE),
|
||||
.DREQ_SIZE (`L3DREQ_SIZE),
|
||||
.SRSQ_SIZE (`L3SRSQ_SIZE),
|
||||
.DRAM_ENABLE (1),
|
||||
.FLUSH_ENABLE (1),
|
||||
.WRITE_ENABLE (1),
|
||||
.CORE_TAG_WIDTH (`L2DRAM_TAG_WIDTH),
|
||||
.CORE_TAG_ID_BITS (0),
|
||||
.DRAM_TAG_WIDTH (`L3DRAM_TAG_WIDTH),
|
||||
.SNP_TAG_WIDTH (`L3SNP_TAG_WIDTH)
|
||||
.DRAM_TAG_WIDTH (`L3DRAM_TAG_WIDTH)
|
||||
) l3cache (
|
||||
`SCOPE_BIND_Vortex_l3cache
|
||||
|
||||
@@ -286,18 +208,6 @@ module Vortex (
|
||||
.dram_rsp_tag (dram_rsp_tag),
|
||||
.dram_rsp_ready (dram_rsp_ready),
|
||||
|
||||
// Snoop request
|
||||
.snp_req_valid (snp_fwd_rsp_valid),
|
||||
.snp_req_addr (snp_fwd_rsp_addr),
|
||||
.snp_req_inv (snp_fwd_rsp_inv),
|
||||
.snp_req_tag (snp_fwd_rsp_tag),
|
||||
.snp_req_ready (snp_fwd_rsp_ready),
|
||||
|
||||
// Snoop response
|
||||
.snp_rsp_valid (snp_rsp_valid),
|
||||
.snp_rsp_tag (snp_rsp_tag),
|
||||
.snp_rsp_ready (snp_rsp_ready),
|
||||
|
||||
// Miss status
|
||||
`UNUSED_PIN (miss_vec)
|
||||
);
|
||||
@@ -346,13 +256,6 @@ module Vortex (
|
||||
.rsp_ready_in (dram_rsp_ready)
|
||||
);
|
||||
|
||||
`UNUSED_VAR (snp_fwd_rsp_addr)
|
||||
`UNUSED_VAR (snp_fwd_rsp_inv)
|
||||
|
||||
assign snp_rsp_valid = snp_fwd_rsp_valid;
|
||||
assign snp_rsp_tag = snp_fwd_rsp_tag;
|
||||
assign snp_fwd_rsp_ready = snp_rsp_ready;
|
||||
|
||||
end
|
||||
|
||||
`SCOPE_ASSIGN (reset, reset);
|
||||
@@ -366,14 +269,6 @@ module Vortex (
|
||||
`SCOPE_ASSIGN (dram_rsp_fire, dram_rsp_valid && dram_rsp_ready);
|
||||
`SCOPE_ASSIGN (dram_rsp_data, dram_rsp_data);
|
||||
`SCOPE_ASSIGN (dram_rsp_tag, dram_rsp_tag);
|
||||
`SCOPE_ASSIGN (snp_req_fire, snp_req_valid && snp_req_ready);
|
||||
`SCOPE_ASSIGN (snp_req_addr, `TO_FULL_ADDR(snp_req_addr));
|
||||
`SCOPE_ASSIGN (snp_req_inv, snp_req_inv);
|
||||
`SCOPE_ASSIGN (snp_req_tag, snp_req_tag);
|
||||
`SCOPE_ASSIGN (snp_rsp_fire, snp_rsp_valid && snp_rsp_ready);
|
||||
`SCOPE_ASSIGN (snp_rsp_tag, snp_rsp_tag);
|
||||
`SCOPE_ASSIGN (snp_rsp_fire, snp_rsp_valid && snp_rsp_ready);
|
||||
`SCOPE_ASSIGN (snp_rsp_tag, snp_rsp_tag);
|
||||
`SCOPE_ASSIGN (busy, busy);
|
||||
|
||||
`ifdef DBG_PRINT_DRAM
|
||||
|
||||
Reference in New Issue
Block a user