Skip to content

feat(fpga_diff): add UVHS NutShell trace DDR - #152

Open
xiaokamikami wants to merge 8 commits into
uvhsfrom
feat/uvhs-cpu-trace-ddr
Open

feat(fpga_diff): add UVHS NutShell trace DDR#152
xiaokamikami wants to merge 8 commits into
uvhsfrom
feat/uvhs-cpu-trace-ddr

Conversation

@xiaokamikami

Copy link
Copy Markdown
Member

This PR adds passive NutShell commit tracing to dedicated UVHS DDR channels.
The trace path does not backpressure or stall the CPU. When the ingress FIFO is full, the current trace record is dropped, and the embedded sequence number exposes the gap.
The three-FPGA topology is:
F2: NutShell CPU, XDMA, and trace DDR channel 0
F1: trace DDR channel 1
F3: functional workload DDR
Usage
Build the trace-enabled NutShell target with:
cd fpga_diff

make uvhs_hejian_pcie_x4_nutshell_trace_all
CORE_DIR=/path/to/NutShell
SUFFIX=
The generated project is located at:
fpga_diff_uvhs_nutshell-
This target requires usable DDR cards for F1, F2, and F3.
Run FPGA DiffTest through the normal UVHS flow. Workloads are still written to the functional DDR through H2C; no separate workload-loading flow is introduced.
Trace data can be read through the UVHS runtime:
readmem
-rtl fpga_top_debug.core_def.U_CPU_TRACE.U_CPU_TRACE_CH0_DDR
-start 0 -end
-file trace-ch0.hex -hex

readmem
-rtl fpga_top_debug.core_def.U_CPU_TRACE.U_CPU_TRACE_CH1_DDR
-start 0 -end
-file trace-ch1.hex -hex
The default NutShell and probe targets remain unchanged. Trace RTL is only included when building uvhs_hejian_pcie_x4_nutshell_trace_all.

- select XSTop and standalone memory ports when NO_DIFF=1
- omit DiffTest, XDMA IP, and PCIe constraints from standalone projects
- keep DMA detection and JTAG programming shared with the normal flow
@xiaokamikami
xiaokamikami force-pushed the feat/uvhs-cpu-trace-ddr branch 2 times, most recently from affd34c to c65715f Compare August 10, 2026 08:37
klin02 and others added 7 commits August 13, 2026 15:17
- add UVHS IP export, frontend partitioning, backend, and runtime
  targets
- constrain XiangShan/CMN placement, DDR, XDMA, IMSIC, clocks,
  and TDM
- support generalBus flash/DDR access and detached hardware sessions
- add KMH ILA probes, trigger control, and gated-clock capture
- preserve Vivado, NO_DIFF, and RTL_INCLUDE file-list behavior

Co-authored-by: Kamimiao <fengkehan@bosc.ac.cn>
Add the reusable Hejian UVHS FPGA DiffTest build/runtime flow, preserve NutShell integration, and support the board-validated single-FPGA XiangShan configuration at 25 MHz.
@xiaokamikami
xiaokamikami force-pushed the feat/uvhs-cpu-trace-ddr branch from c65715f to db688ec Compare August 15, 2026 04:05
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