/litex:litex-csr-debugfrom litex
Debug a running LiteX SoC from the host via CSRs and bus using litex_server, litex_cli --json, or litex_mcp; read/write registers and add status counters.
Ships in litex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Registers before traces: a counter, a sticky flag or an FSM state read from the host answers most questions without a rebuild per probe.
litex_server --uart --uart-port=/dev/ttyUSBx --bind-port=1240 # or --jtag, --udp --udp-ip=..., --pcie
litex_cli --csr-csv=build/<board>/csr.csv --port=1240 --ident --json
litex_cli --csr-csv=build/<board>/csr.csv --port=1240 --regs --filter=ctrl --json
ctrl_scratch reads back 0x12345678 after reset; ctrl_bus_errors counts accesses that hit
nothing. With litex_mcp (litex_mcp --csr-csv=build/<board>/csr.csv --port=1240), call
litex_check() first: link, identifier, ctrl_scratch and read latency in one result.
| Need | CLI | MCP tool |
|---|---|---|
| Registers by name | --regs --filter=<prefix> --json | litex_read_registers(filter) |
| One register | --read <name or address> --json | litex_read_register(name) |
| Memory | --read 0x40000000 --length=64 --json (bytes) | litex_read_memory(address, length) (words) |
| What exists | the csr.csv/csr.json of the build | litex_list_registers, litex_list_memory_regions, litex_list_constants |
--json prints one object ({"schema": 1, ...}); errors come as {"error": ...} with exit
code 1, and a read timeout is an error instead of a silent 0.
litex_cli --write <name or address> <value>; through MCP, litex_write_register(name, value) and
litex_write_memory(address, words) only exist when the server runs with --allow-write. A
write can reset a core, start a DMA or reconfigure a PHY: say what it does before doing it.
| Register | Answers |
|---|---|
| Counter (events, errors, timeouts) | How often, and does it move when I do X? |
| Sticky flag, cleared by software | Did it ever happen since I last looked? |
| FSM state snapshot | Where is it stuck? |
| History buffer (last N states) | How far did it get? |
In Migen: a CSRStatus driven by the signal (self.errors = CSRStatus(32), then
self.comb += self.errors.status.eq(error_count)), a CSRStorage for a control; signals from
another clock domain cross with MultiReg (levels) or PulseSynchronizer (events) before the
CSR. Rebuild with --no-compile first to see the new names in csr.csv.
--bind-port,
--ident before anything else.litex_cli/litescope_cli read csr.csv from the current directory unless --csr-csv is
given; the build writes it in build/<platform>/. A stale csr.csv gives wrong addresses.self.get_csr_address("name");
self.csr.address_map(name, origin=True) is a CSR-local offset.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub enjoy-digital/litex --plugin litex6 skills in this plugin
/litescope-captureCapture internal signals of a running LiteX SoC with the LiteScope logic analyzer (add a narrow probe to the target, rebuild, trigger, read the capture as data or VCD) through litescope_cli --json or the litex_mcp scope tools. Use when a question about timing, a handshake or a state sequence cannot be answered by polling registers./litex-bringupBring up a LiteX SoC on a new or unfamiliar board, one layer at a time (clock, UART and BIOS, host bridge, DRAM, Ethernet, then the other peripherals), or check the same loop in simulation first. Use when a board does not boot, when adding a board target, or when asked to get a LiteX design running on hardware./litex-build-and-loadBuild a LiteX SoC (a LiteX-Boards target or a target script), check what it generates, read the build result and load the bitstream on the board. Use when asked to build, elaborate, compile, load or flash a LiteX design, or to find the command line for a board, a CPU and a set of cores./litex-timing-triageTriage a LiteX build that fails timing or fails in the toolchain: read the parsed reports (WNS/TNS, per-clock results, failing paths, utilization, errors), classify the failing paths (logic depth, clock crossing, I/O, congestion) and pick the fix in the Python design. Use after a Vivado, Quartus, Gowin, Efinity or nextpnr build of a LiteX design reports negative slack or errors, or when a design works at a lower clock only./litex-upstream-a-fixTurn a fix or an addition made for a project (a patched LiteX file, a copied core, a board target change, a workaround subclass) into a clean pull request against the LiteX repository it belongs to, with a test and a verification report. Use when a project needed to change LiteX, LiteX-Boards or a Lite* core, when asked to "upstream", "send back" or "contribute" a change, or before ending a task that left a local patch of the framework.Other plugins' skills for the same job