From 9e001eddf21e8b008dff515ba4ad763a000ebe11 Mon Sep 17 00:00:00 2001 From: Lorenzo Leone Date: Wed, 9 Oct 2024 10:28:51 +0200 Subject: [PATCH] [HW]: Bugs Fix (#48) Fix Bugs: - [HW]: Fix typo in chimera_clu_domain Cfg struct refrence - [TB:] Delay JTAG start - [SW]: Fix define declaration --- bender.mk | 1 + chimera.mk | 1 + hw/chimera_clu_domain.sv | 3 ++- hw/chimera_memisland_domain.sv | 5 +++-- hw/chimera_pkg.sv | 1 + hw/chimera_top_wrapper.sv | 2 ++ sw/sw.mk | 2 ++ sw/tests/testCluster.c | 2 +- target/sim/src/vip_chimera_soc.sv | 2 +- 9 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bender.mk b/bender.mk index 3a7350a..5984911 100644 --- a/bender.mk +++ b/bender.mk @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # Moritz Scherer +# Lorenzo Leone COMMON_TARGS ?= COMMON_TARGS += -t snitch_cluster -t cv32a6_convolve -t cva6 -t rtl diff --git a/chimera.mk b/chimera.mk index 417e2c1..365f213 100644 --- a/chimera.mk +++ b/chimera.mk @@ -3,6 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # Moritz Scherer +# Lorenzo Leone CLINTCORES = 46 diff --git a/hw/chimera_clu_domain.sv b/hw/chimera_clu_domain.sv index 395c03c..d208b13 100644 --- a/hw/chimera_clu_domain.sv +++ b/hw/chimera_clu_domain.sv @@ -3,6 +3,7 @@ // SPDX-License-Identifier: SHL-0.51 // // Moritz Scherer +// Lorenzo Leone `define NRCORES(extClusterIdx) ChimeraClusterCfg.NrCores[extClusterIdx] `define PREVNRCORES(extClusterIdx) \ @@ -57,7 +58,7 @@ module chimera_clu_domain localparam int unsigned AxiWideDataWidth = Cfg.ChsCfg.AxiDataWidth * Cfg.MemIslNarrowToWideFactor; localparam int unsigned AxiWideSlvIdWidth = Cfg.MemIslAxiMstIdWidth + $clog2(Cfg.MemIslWidePorts); localparam int unsigned AxiSlvIdWidth = Cfg.ChsCfg.AxiMstIdWidth + $clog2( - cheshire_pkg::gen_axi_in(Cfg).num_in + cheshire_pkg::gen_axi_in(Cfg.ChsCfg).num_in ); // Isolated AXI signals diff --git a/hw/chimera_memisland_domain.sv b/hw/chimera_memisland_domain.sv index 0f4ae38..350514c 100644 --- a/hw/chimera_memisland_domain.sv +++ b/hw/chimera_memisland_domain.sv @@ -24,8 +24,9 @@ module chimera_memisland_domain ); // Define needed parameters - localparam axi_in_t AxiIn = gen_axi_in(Cfg.ChsCfg); // lleone: TODO: find a better solution - localparam int unsigned AxiSlvIdWidth = Cfg.ChsCfg.AxiMstIdWidth + $clog2(AxiIn.num_in); + localparam int unsigned AxiSlvIdWidth = Cfg.ChsCfg.AxiMstIdWidth + $clog2( + cheshire_pkg::gen_axi_in(Cfg.ChsCfg).num_in + ); localparam int unsigned WideSlaveIdWidth = $clog2(Cfg.MemIslWidePorts); localparam int unsigned WideDataWidth = Cfg.ChsCfg.AxiDataWidth * Cfg.MemIslNarrowToWideFactor; diff --git a/hw/chimera_pkg.sv b/hw/chimera_pkg.sv index 4622ba5..34b8bdb 100644 --- a/hw/chimera_pkg.sv +++ b/hw/chimera_pkg.sv @@ -3,6 +3,7 @@ // SPDX-License-Identifier: SHL-0.51 // // Moritz Scherer +// Lorenzo Leone package chimera_pkg; diff --git a/hw/chimera_top_wrapper.sv b/hw/chimera_top_wrapper.sv index 6f32df3..d060e68 100644 --- a/hw/chimera_top_wrapper.sv +++ b/hw/chimera_top_wrapper.sv @@ -3,6 +3,8 @@ // SPDX-License-Identifier: SHL-0.51 // // Moritz Scherer +// Lorenzo Leone + module chimera_top_wrapper import cheshire_pkg::*; diff --git a/sw/sw.mk b/sw/sw.mk index b15dadb..0c55342 100644 --- a/sw/sw.mk +++ b/sw/sw.mk @@ -3,6 +3,8 @@ # SPDX-License-Identifier: Apache-2.0 # # Moritz Scherer +# Lorenzo Leone + ifndef chim_sw_mk chim_sw_mk=1 diff --git a/sw/tests/testCluster.c b/sw/tests/testCluster.c index 130003e..1cc4a24 100644 --- a/sw/tests/testCluster.c +++ b/sw/tests/testCluster.c @@ -8,7 +8,7 @@ #include #define CLUSTERMEMORYSTART CLUSTER_0_BASE -#define CLUSTERDISTANCE CLUSTER_1_BASE - CLUSTER_0_BASE +#define CLUSTERDISTANCE (CLUSTER_1_BASE - CLUSTER_0_BASE) #define NUMCLUSTERS 5 #define TESTVAL 0x00E0D0C0 diff --git a/target/sim/src/vip_chimera_soc.sv b/target/sim/src/vip_chimera_soc.sv index 5f70920..28b5d25 100644 --- a/target/sim/src/vip_chimera_soc.sv +++ b/target/sim/src/vip_chimera_soc.sv @@ -215,7 +215,7 @@ module vip_chimera_soc jtag_idcode_t idcode; dm::dmcontrol_t dmcontrol = '{dmactive: 1, default: '0}; // Check ID code - repeat (100) @(posedge jtag_tck); + repeat (10000) @(posedge jtag_tck); jtag_dbg.get_idcode(idcode); if (idcode != DutCfg.DbgIdCode) $fatal(1, "[JTAG] Unexpected ID code: expected 0x%h, got 0x%h!", DutCfg.DbgIdCode, idcode);