t27.aiEnglish

Какой это чип?

Вы узнаете

Как чип называет себя в 32 битах и как эти биты читать.

Прежде чем что-то загружать, спросите плату, какой на ней чип. По JTAG каждый чип отвечает 32-битным IDCODE: версия, номер детали, производитель и постоянная 1 в бите 0. Битстрим, собранный для другой детали, чип отвергнет, так что эта проверка экономит вам полдня. Декодер делит биты на эти четыре поля и ищет деталь в таблице самого openFPGALoader.

Попробуйте

Нажмите пресет стенда, затем переверните один бит номера детали и посмотрите, какое это было бы устройство. В спеке действие idcode-cfg называет IDCODE, который возвращает исправный XC7A100T: раскодируйте его и сравните номер детали с чипом стенда.

Открыть интерактивный урок →

JTAG IDCODE decoder: 32 bits, four fields, one device
JTAG IDCODE decoder: 32 bits, four fields, one device ↗

Paste a 32-bit JTAG IDCODE: version, part number, JEDEC manufacturer and the fixed 1 in bit 0 as clickable bits, then the device from openFPGALoader's own table.

specs/tools/tri/fpga.t27

// SPDX-License-Identifier: Apache-2.0
; specs/tools/tri/fpga.t27 -- tool tri/fpga, the `tri fpga` command of the tri CLI
; Source of truth for the tool card on t27.ai (#/tools?tool=tri/fpga).
; Extracted from the clap #[derive(Subcommand)] enums in cli/tri/src (witness source-parse:
; cargo was not run, the enum and its /// docs were read at commit 3cb7a4352492).
; Layer 5 of the ladder Specs -> Skills -> Crons -> Agents -> Tools. ASCII only (L3).
; phi^2 + 1/phi^2 = 3 | TRINITY

module tool_tri_fpga;

pub const KIND : str = "tool";
pub const FAMILY : str = "tri-cli";
pub const ID : str = "tri/fpga";
pub const REPO : str = "gHashTag/t27";
pub const QUALIFIED_ID : str = "gHashTag/t27:tri/fpga";
pub const SCHEMA : u32 = 2;
pub const COMMAND : str = "tri fpga";
; clap enum variant and where the dispatch lands
pub const VARIANT : str = "Commands::Fpga";
pub const SOURCE : str = "cli/tri/src/fpga.rs";
pub const ENTRY : str = "cli/tri/src/main.rs";
; The clap about text (first /// paragraph), as `tri --help` would print it.
pub const ABOUT : str = "FPGA programming via the in-tree DLC10 driver (pure Rust).";
pub const ABOUT_SOURCE : str = "clap /// doc on Commands::Fpga (cli/tri/src/main.rs; module cli/tri/src/fpga.rs)";
; Nested subcommands (kebab-case as clap derives them) and their first /// paragraph ("" when none).
pub const ACTIONS : [35]str = ["idcode", "idcode-cfg", "sram", "program", "flash-id", "status", "debug", "load-sram", "stat", "read-xadc", "synth-gf16", "program-flash", "dump-flash", "bit-config", "round-trip-verify", "boot-log", "cold-por", "smoke-gate", "boot-protocol", "patch-cor0", "cclk-variants", "cclk-sweep", "sweep-report", "measure-cclk", "flash-status", "proxy-load", "proxy-status", "spi-raw", "ir-probe", "flash-id-debug", "build-proxy", "setup-openxc7-chipdb", "measured-to-lean", "pvt-envelope", "build-proxy-docker"];
pub const ACTIONS_ABOUT : [35]str = ["Read and print the JTAG IDCODE of the attached DLC10 cable target.", "Read the configuration IDCODE register via the Type-1 CFG_IN/CFG_OUT protocol. On a healthy XC7A100T this must return 0x13631093 (same as the JTAG IDCODE). If 0x00000000 is returned while `idcode` works, the read_cfg_reg implementation is broken.", "Program FPGA SRAM (volatile -- lost on power-cycle).", "Program the on-board SPI flash (non-volatile / persistent).", "Read the SPI flash JEDEC ID via the JTAG-to-SPI bridge.", "Read the raw CFG_OUT status register.", "Decode 7-series configuration registers for DONE=LOW diagnosis.", "Load a bitstream into FPGA SRAM using openFPGALoader with a Digilent FTDI cable. This is the canonical path for the QMTech Wukong V1 / XC7A200T board because the in-tree `dlc10` driver only supports Xilinx DLC10 cables (VID=0x03FD), not the attached Digilent cable (VID=0x0403:0x6014).", "Read and decode the FPGA STAT register via openFPGALoader.", "Read the FPGA XADC sensors (temperature, VCCINT, VCCAUX) via openFPGALoader and print a JSON object. The board must be powered and connected through a supported cable such as `digilent_hs2`.", "Synthesize the GF16 4x4 matrix design through the openXC7 toolchain. Output is written to `<build_dir>/gf16_matmul4x4_top.bit`.", "Program the on-board SPI flash (non-volatile) using openFPGALoader's JTAG-to-SPI bridge. Requires a matching `spiOverJtag` bitstream for the exact FPGA package; the XC7A200T-FGG676 bridge is present in recent openFPGALoader distributions but flash boot may still depend on board mode pins (see docs/reports/FPGA_LOOP_EVIDENCE_2026-07-04.md).", "Dump SPI flash contents to a file via openFPGALoader's JTAG-to-SPI bridge.", "Parse the .bit header and print the configuration registers that affect Master SPI boot (COR0, COR1, WBSTAR, TIMER, CTL0, CTL1, IDCODE, BSPI).", "Program the given .bit to SPI flash, dump the same region back, and compare the dumped bytes against the bitstream payload. This verifies the openFPGALoader write path is bit-perfect for the raw bitstream.", "Guided cold-POR boot experiment. Programs flash, asks the user to physically power-cycle the board, then captures STAT without a JTAG reset and prints a decision-tree diagnosis.", "Deterministic cold-POR boot experiment with optional relay control. With `--relay-port MOCK` the command writes a deterministic, clearly labeled mock boot log so CI can exercise the cold-POR JSON path without touching hardware. Real relay ports are reserved for Variant A/B.", "Board-less smoke gate for the FPGA path. Runs `tri fpga bit-config` on the GF16 demo bitstream and, if yosys is available, a synthesis smoke check on the demo Verilog. Requires no physical board.", "Print or interactively confirm the cold-POR boot protocol. This is the standalone version of the instructions embedded in `boot-log` and `cclk-sweep`; use it to verify the operator steps before a physical power-cycle.", "Patch the raw OSCFSEL field (COR0[22:17]) of a 7-series .bit file.", "Generate a set of OSCFSEL variants from a single input .bit file. Outputs one file per requested value to the given directory.", "Automated cold-POR CCLK sweep. Generates OSCFSEL variants, programs each to flash, prompts for the physical power-cycle, captures STAT, and writes JSON logs. The only manual step is disconnecting/reconnecting the cable and power-cycling the board.", "Read all `build/fpga/boot-log-*.json` files and produce a sweep report identifying the first working CCLK variant.", "Print DSLogic / oscilloscope instructions for measuring the FPGA CCLK output during Master SPI configuration. Optionally parse a DSView CSV export or run a live capture via `sigrok-cli` with a connected logic analyzer (e.g., the Digilent FTDI cable as `ftdi-la`).", "Read the SPI flash status register via openFPGALoader's JTAG-to-SPI bridge. Decodes WIP, WEL, and QE bits to help diagnose boot-from-flash failures.", "Diagnostic: load *only* the proxy bridge bitstream (or any other bitstream) into FPGA SRAM, report STAT, leave TAP in RTI. Does NOT touch SPI flash. Useful for verifying the bridge actually reaches DONE=HIGH before debugging SPI semantics.", "Diagnostic: read IDCODE + STAT *without* touching the FPGA. Run this immediately after `tri fpga proxy-load` to confirm the bridge is alive. Also confirms IR=USER1 select is accepted.", "Diagnostic: shift raw hex bytes through the USER1 BSCAN as a single SPI transaction. Reads `--rx N` MISO bytes after the TX stream. Requires the proxy bridge to be already loaded (`tri fpga proxy-load` first).", "Diagnostic: probe the IR capture pattern after selecting an IR. A healthy 7-series TAP always captures `0b000001` into the IR shift register. Anything else means the JTAG chain is broken or the cable is mis-driving TMS.", "Diagnostic: drive the full JEDEC-read flow end-to-end with maximum instrumentation, **including** the 0xAB Release-Power-down and 0x66+0x99 software-reset recovery attempts. Equivalent to `flash-id --verbose` plus auto-recovery.", "Build the QMTech XC7A100T-FGG676 JTAG-to-SPI proxy bitstream via the openXC7 open-source toolchain (yosys + nextpnr-himbaechel + prjxray). Requires `yosys`, `nextpnr-himbaechel`, `fasm2frames.py` and `xc7frames2bit` on PATH. With `--install`, the produced `.bit` is copied to `fpga/tools/bscan_spi_xc7a100t.bit` so the embedded `BSCAN_SPI_XC7A100T` constant picks it up on the next rebuild.", "Clone the openXC7 `nextpnr-xilinx` repo and build a chipdb (`.bba`) for the requested 7-series part, then install it into `~/.local/share/nextpnr/himbaechel-xilinx/`.", "Generate a Lean 4 theorem from a `tri fpga measure-cclk --json` output. The theorem proves that the measured `(frequency, duty)` pair satisfies `measured_cclk_satisfies_flash_spec` and links it to `transaction_satisfies_flash_spec`. Useful for turning a real capture into a machine-checked proof without manual copy-paste.", "Print the PVT-derated N25Q128_3V SCK low/high bound for a supplied operating context. Also prints the margin over the nominal 6 ns bound and warns if the context is outside the documented operating envelope.", "Build the QMTech XC7A100T-FGG676 proxy bitstream via a Docker container running Xilinx Vivado. Clones our `openFPGALoader` fork (`feat/qmtech-xc7a100t-board`) into `target/openfpgaloader-fork/` and runs `make` inside `spiOverJtag/`. On Apple Silicon (arm64), the container runs under x86_64 emulation via `--platform linux/amd64`. With `--install`, the produced `bscan_spi_xc7a100tfgg676.bit.gz` is decompressed and copied to `fpga/tools/bscan_spi_xc7a100t.bit` and its SHA256 is printed."];
; Top-level arguments/flags of the command itself, "<name>: doc".
pub const ARGS : [0]str = [];
; Agent letters that own this command, only where a source line names it (AGENTS_NOTE cites it).
pub const AGENTS : [2]str = ["T", "K"];
pub const AGENTS_NOTE : str = "docs/agents/AGENTS_ALPHABET.md \"Who holds a tool, and who holds a skill\" binds every tool to the Queen (T). Domain lead K: ABOUT \"FPGA programming via the in-tree DLC10 driver (pure Rust)\" with 35 actions for JTAG IDCODE, SRAM/flash programming, bitstream config and \"Synthesize the GF16 4x4 matrix design through the openXC7 toolchain\" -- K's Kernel / FPGA domain and its \"Synthesis is verified\" exit invariant.";
; From the about text (long about when the doc has more than one paragraph); no marketing.
pub const WHEN_TO_USE : str = "FPGA programming via the in-tree DLC10 driver (pure Rust).";
pub const WITNESS : str = "source-parse";
pub const ENABLED : bool = true;

test basic_constants {
    assert KIND == "tool";
    assert ENABLED == true;
    assert SCHEMA == 2;
    assert VARIANT == "Commands::Fpga";
}

Открыть спеку урока в плеере ↗

Все уроки