Skip to content

Commit eebd80b

Browse files
committed
hw: Improve the cdc check and configuration
1 parent 06a79ff commit eebd80b

8 files changed

Lines changed: 29 additions & 10 deletions

File tree

‎Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
CHIM_ROOT ?= $(shell pwd)
1010

1111
# Tooling
12-
BENDER = bender-0.28.2 -d $(CHIM_ROOT)
12+
BENDER ?= bender -d $(CHIM_ROOT)
1313
VERIBLE_VERILOG_FORMAT ?= $(CHIM_UTILS_DIR)/verible-verilog/verible-verilog-format
1414

1515
# Set dependency paths only if dependencies have already been cloned

‎hw/chimera_clu_domain.sv‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ module chimera_clu_domain
185185
.narrow_out_req_t (narrow_out_req_t),
186186
.narrow_out_resp_t(narrow_out_resp_t),
187187
.wide_out_req_t (wide_out_req_t),
188-
.wide_out_resp_t (wide_out_resp_t)
188+
.wide_out_resp_t (wide_out_resp_t),
189+
.EnAxiCdc (ChimeraClusterCfg.EnAxiCdc[extClusterIdx])
189190
) i_chimera_cluster (
190191
.soc_clk_i(soc_clk_i),
191192
.clu_clk_i(clu_clk_i),

‎hw/chimera_pkg.sv‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ package chimera_pkg;
3030
logic [iomsb(ExtClusters):0] hasWideMasterPort;
3131
byte_bt [iomsb(ExtClusters):0] NrCores;
3232
cluster_type_e [iomsb(ExtClusters):0] ClusterType;
33+
logic[iomsb(ExtClusters):0] EnAxiCdc;
3334
} cluster_config_t;
3435

3536
// For each instantiated cluster, you need to specify three parameters:
@@ -40,7 +41,8 @@ package chimera_pkg;
4041
localparam cluster_config_t ChimeraClusterCfg = '{
4142
hasWideMasterPort: {1'b1, 1'b1, 1'b1, 1'b1, 1'b1},
4243
NrCores: {8'h9, 8'h9, 8'h9, 8'h9, 8'h9},
43-
ClusterType: {SNITCH, SNITCH, SNITCH, SNITCH, SNITCH}
44+
ClusterType: {SNITCH, SNITCH, SNITCH, SNITCH, SNITCH},
45+
EnAxiCdc: {1'b1, 1'b1, 1'b1, 1'b1, 1'b1}
4446
};
4547

4648
function automatic int _sumVector(byte_bt [iomsb(ExtClusters):0] vector, int vectorLen);

‎hw/chimera_top_wrapper.sv‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ module chimera_top_wrapper
315315
// This is the enable clk gate, i.e.
316316
// - enable = 1 -> clock is gated (off)
317317
// - enable = 0 -> clock is running (on)
318-
// It will be used to drive the actual clk eneable signal ine ach cluster.
318+
// It will be used to drive the actual clk eneable signal in each cluster.
319319
// For this reason it's inverted when connected to the cluster.
320320
assign cluster_clock_gate_en = {
321321
reg2hw.cluster_4_clk_gate_en,
@@ -336,7 +336,6 @@ module chimera_top_wrapper
336336
~reg2hw.reset_cluster_0.q
337337
};
338338

339-
// TODO: Double check that teh logic AND is sufficient!
340339
// The Rst used for each cluster is the AND gate among all different source of rst in the system that are:
341340
// - rst_ni: Global asynchronous reset coming from the PAD
342341
// - cluster_soft_rst_n: Software synchronous rst coming from the SoC configuration registers

‎hw/clusters/chimera_cluster.sv‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ module chimera_cluster
1717
parameter type narrow_out_req_t = logic,
1818
parameter type narrow_out_resp_t = logic,
1919
parameter type wide_out_req_t = logic,
20-
parameter type wide_out_resp_t = logic
20+
parameter type wide_out_resp_t = logic,
21+
parameter bit EnAxiCdc = 0
2122
) (
2223
input logic soc_clk_i,
2324
input logic clu_clk_i,
@@ -192,7 +193,7 @@ module chimera_cluster
192193
.clu_wide_out_req_t (axi_cluster_out_wide_req_t),
193194
.clu_wide_out_resp_t(axi_cluster_out_wide_resp_t),
194195
// Make sure the SoC and Clusters run at the same frequency if CDCs are disabled
195-
.EnAxiCdc (1'b0)
196+
.EnAxiCdc (EnAxiCdc)
196197

197198
) i_cluster_axi_adapter (
198199
.soc_clk_i(soc_clk_i),

‎iis-env.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
44
# SPDX-License-Identifier: SHL-0.51
55

6+
export BENDER='bender-0.29.1'
67
export VSIM="questa-2022.3 vsim"
78
export VOPT="questa-2022.3 vopt"
89
export VLIB="questa-2022.3 vlib"
910
export BASE_PYTHON=/usr/local/anaconda3/bin/python3.11
10-
export CHS_SW_GCC_BINROOT=/usr/pack/riscv-1.0-kgf/riscv64-gcc-12.2.0/bin
11+
export CHS_SW_32_GCC_BINROOT=/usr/pack/riscv-1.0-kgf/default/bin
1112
export RISCV_GCC_BINROOT=/usr/pack/riscv-1.0-kgf/pulp-gcc-2.5.0/bin
1213
export CC=/usr/pack/gcc-11.2.0-af/linux-x64/bin/gcc
1314
export CXX=/usr/pack/gcc-11.2.0-af/linux-x64/bin/g++
1415
export CMAKE=cmake-3.28.3
1516
export SN_LLVM_BINROOT=/usr/scratch2/vulcano/colluca/tools/riscv32-snitch-llvm-almalinux8-15.0.0-snitch-0.2.0/bin
16-
export BENDER='bender-0.29.1'
1717

1818
# Create the python venv
1919
if [ ! -d ".venv" ]; then

‎target/sim/src/fixture_chimera_soc.sv‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ module fixture_chimera_soc #(
2222

2323
localparam chimera_cfg_t DutCfg = ChimeraCfg[SelectedCfg];
2424
localparam cheshire_cfg_t ChsCfg = DutCfg.ChsCfg;
25+
localparam time ClkPeriodClu = 2ns;
26+
localparam time ClkPeriodSys = 5ns;
2527

2628
`CHESHIRE_TYPEDEF_ALL(, ChsCfg)
2729
`CHIMERA_TYPEDEF_ALL(, DutCfg)
@@ -157,6 +159,8 @@ module fixture_chimera_soc #(
157159

158160
vip_chimera_soc #(
159161
.DutCfg (ChsCfg),
162+
.ClkPeriodClu (ClkPeriodClu),
163+
.ClkPeriodSys (ClkPeriodSys),
160164
// Determine whether we preload the hyperram model or not User preload. If 0, the memory model
161165
// is not preloaded at time 0.
162166
.HypUserPreload (`HYP_USER_PRELOAD),
@@ -169,4 +173,16 @@ module fixture_chimera_soc #(
169173
.*
170174
);
171175

176+
177+
//////////////////
178+
// CDCs check //
179+
/////////////////
180+
initial begin
181+
for (int extClusterIdx = 0; extClusterIdx < ExtClusters; extClusterIdx++) begin: gen_cdc_check
182+
if (!ChimeraClusterCfg.EnAxiCdc[extClusterIdx] && (ClkPeriodClu != ClkPeriodSys)) begin
183+
$fatal(1, "ClusterIdx:%d, EnAxiCDC = %d: Missing CDCs", extClusterIdx, ChimeraClusterCfg.EnAxiCdc[extClusterIdx]);
184+
end
185+
end
186+
end
187+
172188
endmodule

‎target/sim/src/vip_chimera_soc.sv‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module vip_chimera_soc
2121
parameter type axi_ext_mst_rsp_t = logic,
2222
// Timing
2323
parameter time ClkPeriodClu = 2ns,
24-
parameter time ClkPeriodSys = 2ns,
24+
parameter time ClkPeriodSys = 5ns,
2525
parameter time ClkPeriodJtag = 20ns,
2626
parameter time ClkPeriodRtc = 30518ns,
2727
parameter int unsigned RstCycles = 5,

0 commit comments

Comments
 (0)