Skip to content

feat(fpga_diff): support split-host UVHS workflows - #168

Open
klin02 wants to merge 3 commits into
mainfrom
uvhs-doc-new
Open

feat(fpga_diff): support split-host UVHS workflows#168
klin02 wants to merge 3 commits into
mainfrom
uvhs-doc-new

Conversation

@klin02

@klin02 klin02 commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Expose local pcie_remove and pcie_rescan targets for caller-owned split-host orchestration.
  • Provide a backend-neutral host_env entry point: Vivado emits no extra settings, while UVHS supplies ILA arm/upload hooks and the DDR fallback hook.
  • Keep ILA/DDR generation in ila_host_env.sh; with BIND_UART=1 by default, additionally call bind_uart.sh to bridge runtime /dev/ttyUSB0 to a unique host PTY and export its cleanup command.
  • Use fpga_top_debug.core_def.inter_soc_clk as the default gated ILA clock for every CPU profile.
  • Keep ILA clear inside every upload attempt instead of runtime cleanup.
  • Make backend-neutral runtime_stop release UVHS and do nothing for Vivado.
  • Derive PRJ_NAME from backend, CPU, and suffix, and stage a portable UVHS runtime database with copyable paths.
  • Validate the rebound XDMA driver, device nodes, permissions, and live PCI configuration after rescan.

Responsibility

env-scripts provides local programming, XDMA, host_env, UART, ILA, DDR, and runtime-control capabilities. Machine selection, SSH ordering, artifact deployment, and process lifecycle remain caller responsibilities.

The corresponding Minjie orchestration is tracked by OpenXiangShan/minjie-playground#31.

Validation

  • Rebased onto current main@d93f67e.
  • make -C fpga_diff -pn check_project_name CPU=kmh
  • bash -n fpga_diff/uvhs/runtime/ila_host_env.sh fpga_diff/uvhs/runtime/bind_uart.sh fpga_diff/tools/pcie-remove.sh fpga_diff/tools/pcie-rescan.sh
  • git diff --check origin/main...HEAD
  • Verified BIND_UART=0 runs only ila_host_env.sh and emits no UART or cleanup exports.
  • Verified the default BIND_UART=1 combines ILA hooks with the local UART path when runtime and host are the same machine.
  • Verified kmh, nutshell, and nanhu expand the same default UVHS_ILA_GATED_CLOCK.
  • Verified the generated ILA upload command orders ila_upload before ila_clear.
  • Verified Vivado runtime_stop succeeds as an empty backend implementation.
  • Retained the staged runtime artifact, custom REMOTE_ENV, and XDMA rescan checks from the earlier revision.

The final commit was not used for a new full board run.

Expose local XDMA controls and a backend-neutral fpga-host
environment for caller-owned orchestration. Derive UVHS project names
internally, stage portable runtime data, and validate XDMA rescans.

The UVHS host environment supplies ILA and DDR hooks plus a run-scoped
UART bridge. ILA upload clears capture state, while runtime release
remains a caller responsibility.
Reject an occupied runtime UART before binding it so stale readers
cannot split the serial byte stream. Use the C locale for nested SSH
commands and document the zsh-compatible cleanup trap.

Match the default ILA gated clocks to the 0804 runtime database while
preserving an override for other hardware.
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