**1. What is JTAG?** JTAG = Joint Test Action Group, standardized as IEEE 1149.1. ![XEM8320-CXX-JTAG](https://hackmd.io/_uploads/SJ5ZNp-Kll.png) Originally created for boundary scan testing of PCBs (checking pin connections without probes). Later extended for programming/configuration and debugging in chips like [FPGAs](https://www.ampheo.com/c/fpgas-field-programmable-gate-array), [MCUs](https://www.ampheo.com/c/microcontrollers), and [CPLDs](https://www.ampheo.com/c/cplds-complex-programmable-logic-devices). It uses a standard 4/5-wire interface: * TDI (Test Data In) * TDO (Test Data Out) * TCK (Test Clock) * TMS (Test Mode Select) * (optional TRST = reset) **2. Uses of JTAG in FPGA Context** **A) Configuration (Programming the FPGA)** JTAG provides a universal way to load the bitstream into the FPGA’s configuration memory. You can configure: * Volatile SRAM-based FPGAs (e.g., [Xilinx 7-Series](https://www.vemeko.com/product/#xilinx), [Intel Cyclone](https://www.vemeko.com/cyclone-fpga/)): bitstream disappears after power-down. * Non-volatile flash connected to FPGA (QSPI, BPI, etc.): JTAG can indirectly program the flash, so the FPGA auto-loads after reset. Tools like Xilinx Vivado Hardware Manager or Intel Quartus Programmer use JTAG cables (e.g., Xilinx Platform Cable USB, USB Blaster). **B) Debugging** Many FPGA toolchains allow: * Signal observation: e.g., Xilinx ILA (Integrated Logic Analyzer) cores send internal signals out via JTAG (no extra I/O pins needed). * Memory/register access: peek/poke registers in soft CPUs (MicroBlaze, Nios II) over JTAG. * Debugging embedded processors inside [SoC](https://www.ampheo.com/c/system-on-chip-soc) FPGAs (e.g., Zynq Cortex-A9, Intel SoC FPGAs). **C) Boundary Scan (Board Testing)** Using the 1149.1 boundary-scan cells in I/O pins, you can: Test interconnects between FPGA and other [ICs](https://www.onzuu.com/category/integrated-circuits-ics) on a PCB. Verify solder joints without physical probing. Useful in manufacturing test and hardware bring-up. D) Chain Configuration * Multiple JTAG devices can be connected in a daisy chain: FPGAs, CPLDs, microcontrollers, etc. * One JTAG cable can then program/test the whole chain. **3. Why is JTAG so important for FPGAs?** * Universal access: Works even if other interfaces (like SPI flash, SelectMAP, etc.) are not set up yet. * Safe debugging: Lets you analyze internal FPGA signals without extra I/O pins. * Board bring-up: Detects shorts, opens, and connectivity issues early. * Processor debug: Required for SoC FPGAs when debugging ARM cores. **4. Typical Workflow Example (Xilinx 7-Series)** 1. Connect FPGA board with a JTAG programmer (e.g., Platform Cable USB). 2. In Vivado Hardware Manager, detect device via JTAG chain. 3. Download bitstream → FPGA configures instantly. 4. Optionally program external QSPI flash via JTAG. 5. Insert an ILA core into design → capture waveforms over JTAG while FPGA runs. **In summary:** The FPGA JTAG interface is used to configure/program the [FPGA](https://www.ampheoelec.de/c/fpgas-field-programmable-gate-array), debug internal logic, perform boundary scan testing, and program attached non-volatile memories. It’s the standard and most versatile access port for FPGA development and production.