Cleanup + SW verification framework (chimera-sdk) - #90
Conversation
Squashed the migration/framework work (9 commits) into one block for a cleaner history and an easier rebase over the eventual 64-bit revert: - Vendor chimera-sdk as a submodule (sw/deps/chimera-sdk) with a containerized build (scripts/sdk_container.sh, sw/sw.mk: `make chim-sw*`). - pytest+ctest SoC test framework (test/, scripts/sim_runner.sh): per-test run dirs, SIM_TIMEOUT watchdog + per-test overrides, pytest-xdist parallelism, and a pre-optimized vsim snapshot (chim-opt) for parallel-safe batch runs. - Retire the old sw/ layer: remove sw/tests (migrated to the SDK) and sw/lib; keep sw/include + sw/link for the Snitch bootrom (bootrom migration is a TODO). - Switch the Python environment to uv (.python-version, uv.lock; setuptools<81 for reggen's pkg_resources). - Verification docs, TODO.md, and .vscode IntelliSense config. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
chimera_cluster instantiates snitch_cluster directly (not the generated snitch_cluster_wrapper) and enables RVF/RVD/Xssr/Xfrep/XF* per core, but left the FP-subsystem sizing at snitch_cluster's defaults of 0 (NumFPOutstandingLoads/Mem, NumSsrs/NumSsrsMax, SsrRegs/SsrCfgs, NumSequencerInstr/Loops). A zero-sized FP subsystem makes FP offloads fault with an illegal instruction (e.g. the `fsd` in a cluster function prologue) even though double is nominally enabled -- this is the matmul cluster failure. Integrate the missing parameters from the generated wrapper: source the config-derived pieces (Hive, SsrRegs, SsrCfgs, FPUImplementation, AtomicIdWidth) from snitch_cluster_pkg, size the per-core arrays on NrCores (the DMA core is the last one), and set XDivSqrt=0 to match FPUImplementation (no div/sqrt unit) and the wrapper. Chimera's SoC-integration overrides (TCDM/DMA/ICache sizing, external bootrom, Cfg-derived widths, PMA) are kept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…dl-rawheader - bender.mk: add the `snitch_cluster_wrapper` target so the generated snitch_cluster_pkg (Hive/SsrRegs/SsrCfgs/FPUImplementation) is compiled. - chimera_cluster: import snitch_cluster_pkg for those config parameters. - pyproject/uv.lock: pin peakrdl-rawheader==0.1.3 -- the snitch_cluster version in use relies on the rawheader 0.1 output format (0.2.x changed it). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
snrt is the slowest test (~1305s in RTL now that the cluster FP subsystem is correctly configured and real FP executes); the 1200s cap tripped it. 3000s gives comfortable margin. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Thank you very much; great to have a great SDK now 💪!
I left some minor comments. Also, a general question: I didn't read all the documentation files that you've added. I suppose they have been generated with AI. Have you read them? Are we 100% sure of the content?
For instance, I think the software one is out of date; it does not match the SDK integration.
| .WideIdWidthIn (WideMasterIdWidth), | ||
| .NarrowUserWidth (Cfg.ChsCfg.AxiUserWidth), | ||
| .WideUserWidth (Cfg.ChsCfg.AxiUserWidth), | ||
| .AtomicIdWidth (snitch_cluster_pkg::AtomicIdWidth), |
There was a problem hiding this comment.
Thismakes totally sense to me.
If I'm not missing something, I believe it would make sense to use the generated snitch_cluster_pkg types also for the otehr cluster parameters, e.g., WideMasterIdWidth, NarrowUserWidthetc...
In this way, we should be sure that the cluster instances use teh correct types and eventual mismatches should be handled at the SoC level with proper adapter sizing.
| .NrHyperBanks (1), | ||
|
|
||
| .DMANumAxInFlight(3), | ||
| .DMAReqFifoDepth (3), | ||
| .DMANumAxInFlight (3), | ||
| .DMAReqFifoDepth (3), | ||
| .DMANumChannels (1), | ||
| .NumExpWideTcdmPorts(1), | ||
| .EnableDMAMulticast (1), |
There was a problem hiding this comment.
Again, I think these parameters can be taken from teh snitch cluster_pkg.sv
| .RVE ({NrCores {1'b0}}), | ||
| .RVF ({NrCores {1'b1}}), | ||
| .RVD ({NrCores {1'b1}}), | ||
| // Div/sqrt is not built into FPUImplementation (matches the generated wrapper). | ||
| .XDivSqrt({NrCores {1'b0}}), | ||
| .XF16 ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .XF16ALT ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .XF8 ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .XF8ALT ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .XFVEC ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .XFDOTP ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .Xdma ({1'b1, {(NrCores - 1) {1'b0}}}), | ||
| .Xssr ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .Xfrep ({1'b0, {(NrCores - 1) {1'b1}}}), | ||
| .Xcopift ({NrCores {1'b1}}), | ||
|
|
||
| .FPUImplementation(snitch_cluster_pkg::FPUImplementation), | ||
|
|
||
| // FP subsystem sizing — required so the enabled FPU/SSR/FREP have non-zero | ||
| // resources (the snitch_cluster defaults are 0, which breaks FP offloads). | ||
| .NumIntOutstandingLoads(NumIntOutstandingLoads), | ||
| .NumIntOutstandingMem (NumIntOutstandingMem), | ||
| .RegisterOffloadReq (1), | ||
| .RegisterOffloadRsp (1), | ||
| .RegisterCoreReq (1), | ||
| .RegisterCoreRsp (1), | ||
| .NumFPOutstandingLoads (NumFPOutstandingLoads), | ||
| .NumFPOutstandingMem (NumFPOutstandingMem), | ||
| .NumDTLBEntries (NumDTLBEntries), | ||
| .NumITLBEntries (NumITLBEntries), | ||
|
|
||
| .NumSsrsMax (3), | ||
| .NumSsrs (NumSsrs), | ||
| .SsrMuxRespDepth(SsrMuxRespDepth), | ||
| .SsrRegs (snitch_cluster_pkg::SsrRegs), | ||
| .SsrCfgs (snitch_cluster_pkg::SsrCfgs), | ||
|
|
||
| .NumSequencerInstr(NumSequencerInstr), | ||
| .NumSequencerLoops(NumSequencerLoops), | ||
| .Hive (snitch_cluster_pkg::Hive), | ||
|
|
||
| .Topology (snitch_pkg::LogarithmicInterconnect), | ||
| .Radix (2), | ||
| .NumSwitchNets (4), | ||
| .SwitchLfsrArbiter(0), | ||
|
|
||
| .RegisterOffloadReq(1), | ||
| .RegisterOffloadRsp(1), | ||
| .RegisterCoreReq (1), | ||
| .RegisterCoreRsp (1), | ||
| .RegisterTCDMCuts (0), | ||
| .RegisterExtWide ('0), | ||
| .RegisterExtNarrow ('0), | ||
| .RegisterExpNarrow (0), | ||
| .RegisterFPUReq (1), | ||
| .RegisterFPUIn (0), | ||
| .RegisterFPUOut (0), | ||
| .RegisterSequencer (0), | ||
| .IsoCrossing (0), | ||
|
|
||
| .NarrowXbarLatency(axi_pkg::CUT_ALL_PORTS), | ||
| .WideXbarLatency (axi_pkg::CUT_ALL_PORTS), | ||
| .WideMaxMstTrans (32), | ||
| .WideMaxSlvTrans (32), | ||
| .NarrowMaxMstTrans(4), | ||
| .NarrowMaxSlvTrans(4), | ||
|
|
||
| .CaqDepth (8), | ||
| .CaqTagWidth (16), | ||
| .DebugSupport(0), |
There was a problem hiding this comment.
A general comment on this file: I think we could improve it in 2 ways:
- keep using the
snitch_clusteras the main instantiated module, but take the parameters form teh generatedsnitch_cluster_pkg(most of them should be contained there) - we could change the approach and generate and instantiate the
snitch_cluster_wrapper.
I'm open to both approaches.
There was a problem hiding this comment.
I think this file is out of date, it does not reflect the structure after integration of the chimera-sdk
| parameter real TTest = 0.9, | ||
| // UART | ||
| parameter int unsigned UartBaudRate = 115200, | ||
| parameter int unsigned UartBaudRate = 9600, |
Cleanup and software-verification groundwork, stacked on top of the 64-bit Cheshire upgrade.
Changes
sw: SoC verification framework +chimera-sdkintegrationsw: fixuartSimpletest; general cleanup andchimera-sdkupdatehw/cluster: givesnitch_clusterits FP-subsystem config; exposesnitch_cluster_pkgbuild: pinpeakrdl-rawheadertest: raise the snRT per-test simulation timeout to 3000sOwn commits (on top of #84)
48f2d5esw: SoC verification framework + chimera-sdk integration3fbd6b1Fix uartSimple testc728ebeCleanup and update chimera-sdk0ad9e5ffix(cluster): give snitch_cluster its FP-subsystem configd8570bcbuild: expose snitch_cluster_pkg for the cluster FP config; pin peakrdl-rawheader5c26f84test: raise snrt per-test sim timeout to 3000s1863d16Init Claude files