Skip to content

Cleanup + SW verification framework (chimera-sdk) - #90

Draft
Xeratec wants to merge 14 commits into
pulp-platform:mainfrom
Xeratec:dev/cleanup
Draft

Cleanup + SW verification framework (chimera-sdk)#90
Xeratec wants to merge 14 commits into
pulp-platform:mainfrom
Xeratec:dev/cleanup

Conversation

@Xeratec

@Xeratec Xeratec commented Jul 16, 2026

Copy link
Copy Markdown
Member

Cleanup and software-verification groundwork, stacked on top of the 64-bit Cheshire upgrade.

Depends on #84 (64-bit CVA6 upgrade). Merge #84 first — until then this PR's diff
includes the #84 commits. Base will effectively collapse to just the commits below once
#84 lands.

Changes

  • sw: SoC verification framework + chimera-sdk integration
  • sw: fix uartSimple test; general cleanup and chimera-sdk update
  • hw/cluster: give snitch_cluster its FP-subsystem config; expose snitch_cluster_pkg
  • build: pin peakrdl-rawheader
  • test: raise the snRT per-test simulation timeout to 3000s
  • Add Claude project files

Own commits (on top of #84)

  • 48f2d5e sw: SoC verification framework + chimera-sdk integration
  • 3fbd6b1 Fix uartSimple test
  • c728ebe Cleanup and update chimera-sdk
  • 0ad9e5f fix(cluster): give snitch_cluster its FP-subsystem config
  • d8570bc build: expose snitch_cluster_pkg for the cluster FP config; pin peakrdl-rawheader
  • 5c26f84 test: raise snrt per-test sim timeout to 3000s
  • 1863d16 Init Claude files

Xeratec and others added 14 commits July 7, 2026 15:52
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>

@Lore0599 Lore0599 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +297 to +303
.NrHyperBanks (1),

.DMANumAxInFlight(3),
.DMAReqFifoDepth (3),
.DMANumAxInFlight (3),
.DMAReqFifoDepth (3),
.DMANumChannels (1),
.NumExpWideTcdmPorts(1),
.EnableDMAMulticast (1),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think these parameters can be taken from teh snitch cluster_pkg.sv

Comment on lines +310 to +375
.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),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general comment on this file: I think we could improve it in 2 ways:

  • keep using the snitch_cluster as the main instantiated module, but take the parameters form teh generated snitch_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.

Comment thread docs/software.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants