Skip to content

Commit

Permalink
Reintroduced SelectCfg parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lore0599 committed Oct 4, 2024
1 parent 55b8c51 commit ccd9845
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
10 changes: 7 additions & 3 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 chimera_cfg_t [NumCfgs-1:0] ChimeraCfg = {gen_chimera_cfg(), gen_chimera_cfg_UPF};
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 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

0 comments on commit ccd9845

Please sign in to comment.