CLI Reference¶
Page in flux. Refreshed 2026-04-24 to match pccx-lab HEAD.
The single pccx_analyze umbrella binary described in the
pre-Phase-1 revision of this page was not re-landed when the
workspace split moved code into crates/. Today pccx-lab ships four
smaller Rust binaries, spread across the crates that own each
surface. Each one covers a piece of what pccx_analyze used to
multiplex; the rest (research-list export, analyzer-id explain,
--compare regression gate, synth runner) awaits re-landing inside
the appropriate crate.
Binaries distributed across crates¶
Binary |
Source crate |
Build command |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Release artefacts still land in the workspace-wide
target/release/ directory.
pccx_cli¶
Headless trace-inspection CLI — the surface any CI pipeline that only needs per-core utilisation, bottleneck windows, roofline verdicts, or a Markdown summary should target today.
Synopsis¶
pccx_cli <path/to/trace.pccx>
[--util]
[--roofline]
[--bottleneck <ratio>]
[--windows <cycles>]
[--threshold <ratio>]
[--report-md]
[--source <script>]
Flag reference¶
Flag |
Behaviour |
|---|---|
|
Print per-core MAC utilisation bar chart. |
|
Print arithmetic intensity + compute/memory-bound verdict. |
|
Legacy per-event DMA hotspot filter (default |
|
Sliding-window size for the new bottleneck detector (default 256). |
|
Share-of-window threshold (default |
|
Emit a |
|
Run a |
There are no --json, --compare, --research-list, --explain,
or --run-synth modes today. The previous documentation described
those flags as part of a unified pccx_analyze binary that was
deferred — they are tracked for re-landing but are not callable in the
current tree.
Example — pretty trace inspection¶
pccx_cli ./dummy_trace.pccx --util --roofline --report-md
The --report-md output is the same Markdown document
pccx-reports::render_markdown produces; consumers that just want the
Rust API should skip the binary and call it directly.
generator¶
Generates a demo .pccx trace for development and testing. Used by
the UI’s first-run flow and by CI smoke tests.
Synopsis¶
generator [output_path] [tiles] [cores]
Defaults: dummy_trace.pccx, tiles=100, cores=32. Constructs an
NpuTrace via pccx_core::simulator::generate_realistic_trace,
wraps it in a PccxFile with the current HardwareModel::pccx_reference()
metadata, and writes it to disk.
from_xsim_log¶
Converts a Xilinx xsim simulation log into a .pccx trace the UI
can load. Invoked automatically by hw/sim/run_verification.sh in
the RTL repo; not normally run by hand.
Synopsis¶
from_xsim_log --log <xsim.log> --output <out.pccx>
[--core-id <u32>] [--testbench <name>]
Recognised patterns (emitted by the pccx-FPGA testbenches):
Log pattern |
Emitted events |
|---|---|
|
|
|
|
pccx_golden_diff¶
End-to-end correctness gate that compares a candidate .pccx
trace against a JSONL reference profile.
Synopsis¶
pccx_golden_diff --emit-profile <trace.pccx> [--tolerance-pct N] > ref.jsonl
pccx_golden_diff --check ref.jsonl <trace.pccx> [--json]
Two modes:
--emit-profile— self-calibration. Loads a known-good trace, buckets it byAPI_CALLboundary, and writes a JSONL reference with observed counts + configurable tolerance.--check— regression gate. Loads a reference JSONL + candidate trace, runsgolden_diff::diff, prints a one-line verdict + per-step metric table, exits 1 if any step drifts outside its tolerance.
Tolerances live on the reference rows so the PyTorch-side reference pipeline (forthcoming) controls strictness without flag explosion on the pccx-lab side.
Board bringup scripts (RTL repo)¶
Under pccx-FPGA-NPU-LLM-kv260/scripts/board/ — independent of
pccx-lab, listed here for convenience:
Script |
Purpose |
|---|---|
|
SSH reachability + kernel + fpga_manager + free RAM. |
|
scp .bit to |
|
Run |
|
Pull a |
|
Orchestrates the above four in sequence. |
Surfaces not yet re-landed¶
Tracked for future re-landing in whichever crate makes the most sense
(likely a combination of pccx-reports and a new analytics crate):
--jsonadjacently-tagged structured output.--compare BASE CANDregression gate with--threshold-pct.--run-synth,--dry-run,--parse-onlyVivado wrapper (the RTL repo’shw/vivado/build.shstill works standalone).--research-listcitation-registry exporter (see research lineage for why this is pending).--explain <id>long-form analyzer / strategy documentation.
Exit codes¶
The four binaries follow the conventional Rust shape: 0 on success,
non-zero on runtime failure. pccx_golden_diff --check exits 1
when any row drifts outside its tolerance — the canonical CI regression
gate for now.
Cite this page¶
@misc{pccx_lab_cli_2026,
title = {pccx-lab command-line binaries after the Phase 1 workspace split: pccx\_cli, generator, from\_xsim\_log, pccx\_golden\_diff},
author = {Kim, Hyunwoo},
year = {2026},
howpublished = {\url{https://pccxai.github.io/pccx/en/docs/Lab/cli.html}},
note = {Part of pccx: \url{https://pccxai.github.io/pccx/}}
}
Each binary’s source lives under its owning crate at https://github.com/pccxai/pccx-lab.