Skip to content

Commit

Permalink
Export SRAM instances outside of the VeeR RTL
Browse files Browse the repository at this point in the history
Internal-tag: [#52130]
Signed-off-by: Robert Szczepanski <[email protected]>
  • Loading branch information
robertszczepanski committed Dec 12, 2023
1 parent 97ffac3 commit a6ff235
Show file tree
Hide file tree
Showing 16 changed files with 1,131 additions and 506 deletions.
2 changes: 1 addition & 1 deletion configs/veer.config
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ our %config = (#{{{
},
"testbench" => { # Testbench only
"TOP" => "tb_top",
"RV_TOP" => "`TOP.rvtop",
"RV_TOP" => "`TOP.rvtop_wrapper.rvtop",
"CPU_TOP" => "`RV_TOP.veer",
"clock_period" => "100",
"build_ahb_lite" => "$ahb",
Expand Down
30 changes: 22 additions & 8 deletions design/el2_mem.sv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//********************************************************************************
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 Western Digital Corporation or its affiliates.
// Copyright (c) 2023 Antmicro <www.antmicro.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,14 +42,7 @@ import el2_pkg::*;
output logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_rd_data_lo,
output logic [pt.DCCM_FDATA_WIDTH-1:0] dccm_rd_data_hi,

//`ifdef pt.DCCM_ENABLE
input el2_dccm_ext_in_pkt_t [pt.DCCM_NUM_BANKS-1:0] dccm_ext_in_pkt,

//`endif

//ICCM ports
input el2_ccm_ext_in_pkt_t [pt.ICCM_NUM_BANKS-1:0] iccm_ext_in_pkt,

input logic [pt.ICCM_BITS-1:1] iccm_rw_addr,
input logic iccm_buf_correct_ecc, // ICCM is doing a single bit error correct cycle
input logic iccm_correction_state, // ICCM is doing a single bit error correct cycle
Expand Down Expand Up @@ -89,6 +83,7 @@ import el2_pkg::*;
output logic [pt.ICACHE_NUM_WAYS-1:0] ic_rd_hit,
output logic ic_tag_perr, // Icache Tag parity error

el2_mem_if.veer_sram_src mem_export,

input logic scan_mode

Expand All @@ -97,10 +92,28 @@ import el2_pkg::*;
logic active_clk;

Check warning on line 92 in design/el2_mem.sv

View workflow job for this annotation

GitHub Actions / format-review

[verible-verilog-format] reported by reviewdog 🐶 Raw Output: design/el2_mem.sv:92:- logic active_clk; design/el2_mem.sv:93:- rvoclkhdr active_cg ( .en(1'b1), .l1clk(active_clk), .* ); design/el2_mem.sv:94:- design/el2_mem.sv:95:- el2_mem_if mem_export_local (); design/el2_mem.sv:96:- design/el2_mem.sv:97:- assign mem_export .clk = clk; design/el2_mem.sv:98:- assign mem_export_local.clk = clk; design/el2_mem.sv:99:- design/el2_mem.sv:100:- assign mem_export .iccm_clken = mem_export_local.iccm_clken; design/el2_mem.sv:101:- assign mem_export .iccm_wren_bank = mem_export_local.iccm_wren_bank; design/el2_mem.sv:102:- assign mem_export .iccm_addr_bank = mem_export_local.iccm_addr_bank; design/el2_mem.sv:103:- assign mem_export .iccm_bank_wr_data = mem_export_local.iccm_bank_wr_data; design/el2_mem.sv:104:- assign mem_export_local.iccm_bank_dout = mem_export. iccm_bank_dout; design/el2_mem.sv:105:- design/el2_mem.sv:106:- assign mem_export .dccm_clken = mem_export_local.dccm_clken; design/el2_mem.sv:107:- assign mem_export .dccm_wren_bank = mem_export_local.dccm_wren_bank; design/el2_mem.sv:108:- assign mem_export .dccm_addr_bank = mem_export_local.dccm_addr_bank; design/el2_mem.sv:109:- assign mem_export .dccm_wr_data_bank = mem_export_local.dccm_wr_data_bank; design/el2_mem.sv:110:- assign mem_export_local.dccm_bank_dout = mem_export .dccm_bank_dout; design/el2_mem.sv:111:- design/el2_mem.sv:112:- // DCCM Instantiation design/el2_mem.sv:113:- if (pt.DCCM_ENABLE == 1) begin: Gen_dccm_enable design/el2_mem.sv:114:- el2_lsu_dccm_mem #(.pt(pt)) dccm ( design/el2_mem.sv:115:- .clk_override(dccm_clk_override), design/el2_mem.sv:116:- .dccm_mem_export(mem_export_local.veer_dccm), design/el2_mem.sv:117:- .* design/el2_mem.sv:118:- ); design/el2_mem.sv:119:- end else begin: Gen_dccm_disable design/el2_mem.sv:120:- assign dccm_rd_data_lo = '0; design/el2_mem.sv:121:- assign dccm_rd_data_hi = '0; design/el2_mem.sv:122:- end design/el2_mem.sv:123:- design/el2_mem.sv:124:-if ( pt.ICACHE_ENABLE ) begin: icache design/el2_mem.sv:125:- el2_ifu_ic_mem #(.pt(pt)) icm ( design/el2_mem.sv:126:- .clk_override(icm_clk_override), design/el2_mem.sv:91:+ logic active_clk; design/el2_mem.sv:92:+ rvoclkhdr active_cg ( design/el2_mem.sv:93:+ .en(1'b1), design/el2_mem.sv:94:+ .l1clk(active_clk),
rvoclkhdr active_cg ( .en(1'b1), .l1clk(active_clk), .* );

el2_mem_if mem_export_local ();

assign mem_export .clk = clk;
assign mem_export_local.clk = clk;

assign mem_export .iccm_clken = mem_export_local.iccm_clken;
assign mem_export .iccm_wren_bank = mem_export_local.iccm_wren_bank;
assign mem_export .iccm_addr_bank = mem_export_local.iccm_addr_bank;
assign mem_export .iccm_bank_wr_data = mem_export_local.iccm_bank_wr_data;
assign mem_export_local.iccm_bank_dout = mem_export. iccm_bank_dout;

assign mem_export .dccm_clken = mem_export_local.dccm_clken;
assign mem_export .dccm_wren_bank = mem_export_local.dccm_wren_bank;
assign mem_export .dccm_addr_bank = mem_export_local.dccm_addr_bank;
assign mem_export .dccm_wr_data_bank = mem_export_local.dccm_wr_data_bank;
assign mem_export_local.dccm_bank_dout = mem_export .dccm_bank_dout;

// DCCM Instantiation
if (pt.DCCM_ENABLE == 1) begin: Gen_dccm_enable
el2_lsu_dccm_mem #(.pt(pt)) dccm (
.clk_override(dccm_clk_override),
.dccm_mem_export(mem_export_local.veer_dccm),
.*
);
end else begin: Gen_dccm_disable
Expand All @@ -127,7 +140,8 @@ if (pt.ICCM_ENABLE) begin : iccm
el2_ifu_iccm_mem #(.pt(pt)) iccm (.*,
.clk_override(icm_clk_override),
.iccm_rw_addr(iccm_rw_addr[pt.ICCM_BITS-1:1]),
.iccm_rd_data(iccm_rd_data[63:0])
.iccm_rd_data(iccm_rd_data[63:0]),
.iccm_mem_export(mem_export_local.veer_iccm)
);
end
else begin
Expand Down
7 changes: 5 additions & 2 deletions design/el2_veer_wrapper.sv
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright 2020 Western Digital Corporation or its affiliates.
// Copyright (c) 2023 Antmicro <www.antmicro.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -292,8 +293,6 @@ import el2_pkg::*;

// all of these test inputs are brought to top-level; must be tied off based on usage by physical design (ie. icache or not, iccm or not, dccm or not)

input el2_dccm_ext_in_pkt_t [pt.DCCM_NUM_BANKS-1:0] dccm_ext_in_pkt,
input el2_ccm_ext_in_pkt_t [pt.ICCM_NUM_BANKS-1:0] iccm_ext_in_pkt,
input el2_ic_data_ext_in_pkt_t [pt.ICACHE_NUM_WAYS-1:0][pt.ICACHE_BANKS_WAY-1:0] ic_data_ext_in_pkt,
input el2_ic_tag_ext_in_pkt_t [pt.ICACHE_NUM_WAYS-1:0] ic_tag_ext_in_pkt,

Expand All @@ -315,6 +314,9 @@ import el2_pkg::*;

input logic [31:4] core_id,

// Memory Export Interface
el2_mem_if.veer_sram_src el2_mem_export,

// external MPC halt/run interface
input logic mpc_debug_halt_req, // Async halt request
input logic mpc_debug_run_req, // Async run request
Expand Down Expand Up @@ -694,6 +696,7 @@ import el2_pkg::*;
el2_mem #(.pt(pt)) mem (
.clk(active_l2clk),
.rst_l(core_rst_l),
.mem_export(el2_mem_export),
.*
);

Expand Down
Loading

0 comments on commit a6ff235

Please sign in to comment.