Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reintroduced SelectCfg parameter #46

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions hw/chimera_pkg.sv
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,22 @@ ExtClusters
return chimera_cfg;
endfunction : gen_chimera_cfg

function automatic chimera_cfg_t gen_chimera_cfg_UPF;
function automatic chimera_cfg_t gen_chimera_cfg_isolate();
chimera_cfg_t chimera_cfg;
chimera_cfg = gen_chimera_cfg();
// Override the isolation params
chimera_cfg.IsolateClusters = 1;

return chimera_cfg;
endfunction : gen_chimera_cfg_UPF
endfunction : gen_chimera_cfg_isolate

localparam int NumCfgs = 2;
localparam int unsigned NumCfgs = 2;

localparam chimera_cfg_t [NumCfgs-1:0] ChimeraCfg = {
gen_chimera_cfg_isolate(), // 1: Configuration with Isolation for Power Managemenet
gen_chimera_cfg() // 0: Default configuration
};

localparam chimera_cfg_t [NumCfgs-1:0] ChimeraCfg = {gen_chimera_cfg(), gen_chimera_cfg_UPF};

localparam int unsigned RegDataWidth = 32;
localparam type addr_t = logic [ChimeraCfg[0].ChsCfg.AddrWidth-1:0];
Expand Down
3 changes: 2 additions & 1 deletion hw/chimera_top_wrapper.sv
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module chimera_top_wrapper
import chimera_pkg::*;
import chimera_reg_pkg::*;
#(
parameter chimera_cfg_t Cfg = '0
parameter int unsigned SelectedCfg = 0
) (
input logic soc_clk_i,
input logic clu_clk_i,
Expand Down Expand Up @@ -70,6 +70,7 @@ module chimera_top_wrapper
`include "chimera/typedef.svh"

// Cheshire config
localparam chimera_cfg_t Cfg = ChimeraCfg[SelectedCfg];
localparam cheshire_cfg_t ChsCfg = Cfg.ChsCfg;

`CHESHIRE_TYPEDEF_ALL(, ChsCfg)
Expand Down
4 changes: 2 additions & 2 deletions target/sim/src/fixture_chimera_soc.sv
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module fixture_chimera_soc #(
import tb_cheshire_pkg::*;
import chimera_pkg::*;

localparam chimera_cfg_t DutCfg = ChimeraCfg[1];
localparam chimera_cfg_t DutCfg = ChimeraCfg[SelectedCfg];
localparam cheshire_cfg_t ChsCfg = DutCfg.ChsCfg;

`CHESHIRE_TYPEDEF_ALL(, ChsCfg)
Expand Down Expand Up @@ -61,7 +61,7 @@ module fixture_chimera_soc #(
logic [ 3:0] spih_sd_en;

chimera_top_wrapper #(
.Cfg(DutCfg)
.SelectedCfg(SelectedCfg)
) dut (
.soc_clk_i (soc_clk),
.clu_clk_i (clu_clk),
Expand Down
2 changes: 1 addition & 1 deletion target/sim/vsim/start.chimera_soc.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if {![info exists VOPTARGS]} {
}

set flags "-permissive -suppress 3009 -suppress 8386 -error 7 "
if {[info exists SELCFG]} { append flags "-GSelectedCfg=${SELCFG} " }
if {[info exists SELCFG]} { append flags "-gSelectedCfg=${SELCFG} " }

set pargs ""
if {[info exists BOOTMODE]} { append pargs "+BOOTMODE=${BOOTMODE} " }
Expand Down
Loading