JTAG asks the chip
You will learn
How a cable finds the chip on a board and reads its IDCODE.
JTAG is the cable protocol for talking to the chip on a board. Before programming, the tool shifts out the IDCODE of every device on the chain. This recording decodes the codes our bench answers with, and shows what an even code means: no IDCODE at all. Compare it with the decoder from lesson 2.
Try it
Find which IDCODE belongs to an XC7A200T and which to an XC7A100T. In the spec frame, HELP_LINE says how tri fpga-jtag reads a chain with no answer: what does it blame for all ones, and what for all zeros?

IDCODEs decoded offline: 0x03636093 is an XC7A200T, 0x13631093 an XC7A100T, and an even code is no IDCODE at all (BYPASS or a broken shift). Self-test: 17 of 17 ok.
specs/tools/trios/tri/fpga-jtag.t27
// SPDX-License-Identifier: Apache-2.0
; specs/tools/trios/tri/fpga-jtag.t27 -- tool gHashTag/BrowserOS:tri/fpga-jtag, the `tri fpga-jtag` command of the trios loop CLI
; Generated by apps/website/scripts/tools-from-trios-tri.mjs from gHashTag/BrowserOS:trios/bin/tri at 7366096248df; do not edit.
; The CLI the loop timers run (`tri drift` holds ~/.local/bin/tri to the tracked copy). It is another program than
; the Rust tri of gHashTag/t27 and the Zig tri of gHashTag/trinity, so the ID is repository-qualified.
; A card is data and carries no test block. ASCII only (L3). phi^2 + 1/phi^2 = 3 | TRINITY
module tool_trios_tri_fpga_jtag;
pub const KIND : str = "tool";
pub const FAMILY : str = "tri-cli";
pub const ID : str = "gHashTag/BrowserOS:tri/fpga-jtag";
pub const REPO : str = "gHashTag/BrowserOS";
pub const QUALIFIED_ID : str = "gHashTag/BrowserOS:tri/fpga-jtag";
pub const SCHEMA : u32 = 2;
pub const COMMAND : str = "tri fpga-jtag";
; The case arm of the dispatcher and the first line of it that does the work.
pub const VARIANT : str = "case arm `fpga-jtag)`, line 1933";
pub const SOURCE : str = "trios/bin/tri";
pub const ENTRY : str = "trios/bin/tri";
pub const SOURCE_COMMIT : str = "7366096248dfb09893e9a7d1a0f1c56ced13d16e";
pub const ROUTED : bool = true;
pub const DISPATCH : str = "exec python3 \"$HOME/skills/ax7203-board-loop/scripts/board.py\" jtag \"$@\"";
pub const DOCUMENTED : bool = true;
pub const HELP_LINE : str = "tri fpga-jtag [--load] [--expect XC7A100T] | --decode HEX | --self-test -- JTAG chain behind a Xilinx Platform Cable USB II (DLC10, 03fd): fxload only on --load (no sudo), xc3sprog -c xpc -j, each IDCODE named; no chain -> raw TDO shift classified (all ones = nothing drives TDO: VREF/ribbon/orientation; all zeros = TDO held low: cable). Never programs. Exit 0 chain, 1 none, 2 no cable";
pub const CATEGORY : str = "AX7203 board (tern_tc: receipts, UART, formats)";
pub const ABOUT : str = "JTAG chain behind a Xilinx Platform Cable USB II (DLC10, 03fd): fxload only on --load (no sudo), xc3sprog -c xpc -j, each IDCODE named; no chain -> raw TDO shift classified (all ones = nothing drives TDO: VREF/ribbon/orientation; all zeros = TDO held low: cable). Never programs. Exit 0 chain, 1 none, 2 no cable";
pub const ABOUT_SOURCE : str = "`tri help` (the heredoc under the help arm of trios/bin/tri)";
pub const ACTIONS : [0]str = [];
pub const ACTIONS_ABOUT : [0]str = [];
pub const ARGS : [7]str = ["[--load]", "[--expect XC7A100T]", "|", "--decode", "HEX", "|", "--self-test"];
pub const AGENTS : [0]str = [];
pub const AGENTS_NOTE : str = "No source binds an agent letter to this command: the trios CLI is not named by docs/agents/AGENTS_ALPHABET.md or .claude/agents/*.md of gHashTag/t27.";
pub const WHEN_TO_USE : str = "JTAG chain behind a Xilinx Platform Cable USB II (DLC10, 03fd): fxload only on --load (no sudo), xc3sprog -c xpc -j, each IDCODE named; no chain -> raw TDO shift classified (all ones = nothing drives TDO: VREF/ribbon/orientation; all zeros = TDO held low: cable). Never programs. Exit 0 chain, 1 none, 2 no cable";
; public/term/tri-fpga-jtag/meta.json lists 4 run(s) of `tri fpga-jtag`; recorded with the live ~/.local/bin/tri,
; not a build of SOURCE_COMMIT. The site plays it at the end of this card.
pub const CAST : str = "term/tri-fpga-jtag/session.cast";
pub const WITNESS : str = "source-parse";
pub const WITNESS_SOURCE : str = "gHashTag/BrowserOS:trios/bin/tri at 7366096248dfb09893e9a7d1a0f1c56ced13d16e, read as text (the help heredoc and the top-level case arms); the CLI was not run";
pub const ENABLED : bool = true;
All lessons
Module 1 · The chip
What an FPGA is, which chip we use, and how its pins meet the board.
Module 2 · Numbers in hardware
Bits, trits and number formats, and what arithmetic costs in logic.
Module 3 · Your t27 program
Write a spec, test it, and see why compiling is not the same as being right.
Module 4 · Inside t27c
How the compiler reads a spec and what it writes, including the native t27b.
Module 5 · From spec to hardware
The Verilog t27c writes, the cells it becomes, and what one LUT does.
Module 6 · Reading synthesis
What yosys reports about your design, and which warnings matter.
Module 7 · Place, route, timing
Where the cells land on the die, and whether the clock is met.
Module 8 · The bitstream
How a routed design becomes the bits the chip loads, with no Vivado.
Module 9 · On the board
Ask the chip who it is, load the bits, and check them.