Preface

As part of my thesis, I needed a JTAG library running on the ARM processor (of the external controller) to communicate with the configuration logic of another device (DUT) connected through GPIO - JTAG header.

Both DUT and external controller are in Zynq7000 platform. Specifically in ZYBO Z7 board with zynq 7010 fpga.

The setup is the following.

alt text

As you can see the external controller is connected with 4 GPIO pins to the target’s JTAG TAP port. From PL side of the external controller, the only module needed is the AXI2JTAG which transfers the internal registers (TDI, TMS, TDO) of the module to the target fpga.

After some research to find a lightweight and easy to use library I ended up writing my own custom driver.

I wanted to have the following 6 functionalities.

  1. read N bits from jtag register.
  2. write N bits in jtag register.
  3. read a word (32 bits) from configuration logic.
  4. write a word from configuration logic.
  5. read N frames (101 words) from configuration memory starting from address FRAD.
  6. write N frames to configuration memory starting from address FRAD.

Introduction

To fully understand the source code of the library you need to know how to work with JTAG in Xilinx’s Zynq7000 platform. I assume that you have already read the following chapters from ug470 (7 Series FPGAs Configuration).

  • Ch. 1: Configuration Overview
  • Ch. 5: Configuration Details
  • Ch. 6: Readback and Configuration
  • Ch. 10: Advanced JTAG Usage

Otherwise, if you just want to use the library then read the API below.

API

Currently (commit 6db4a61c) the library is tested only in ZYBO Z7 board with Zynq-7010 fpga. To port to another platform changes might be needed. Most of the macros are located to jtag_platform.h file but might be necessary to change some internal logic of the library in file jtag.c.

Gitlab repository.

I could generate a Doxygen documentation based on the comments and publish it with GitLab pages. But to keep the repository simple and clean with only the necessary files I decided to stay with simple comments.

I believe that the jtag.h file has the information needed for someone in order to use the library. For any additional information pull request a change or write down in comments.

Leave a Comment Cancel reply