So what's this good for?
Well mostly during development and for debugging, since one can view and change signals of the core via JTAG. No additional IOs are necessary as the main TAP of the FPGA is used.
That's particularly helpful when all other interfaces like USB & RS232 are already in use for user data transmissions and you can't disrupt those transfers while debugging.
How does it work?
There are 2 (Spartan) or 4 (Virtex) instructions called USER1, USER2, ... You shift one of those into the Instruction register. Using the BSCAN-primitive you then realize the corresponding data register(s) in your core.
Example
Here's a simple example for the Digilent Nexys Board. Only USER1 is implemented as USER2 works exactly the same way. You can read the states of the switches from the 8 bit data register. The bits you shift into the register while reading will be shown on the LEDs of the board.
More details!
Let's have a look at the example. SEL1 tells you that there's currently the USER1 instruction in the instruction register. Once the JTAG state machine gets into the CAPTURE state, you have to prepare the contents of the data register as they will be shifted out soon. The shifting is clocked by DRCK1 as you can see. Once the old data is shifted out and the new data is there, we get to UPDATE state. That's when you can handle the data provided by the user. That's pretty much it.
References:
- http://www.xilinx.com/itp/xilinx5/data/docs/lib/lib0061_45.html
- http://www.xilinx.com/support/answers/10703.htm
I added USER1/... support in my xilprg fork. It looks like this:
xilprg> user 1 1 0x23"user 1 1 0x23" means: For device 1 (xc3s1000) do a USER1 instruction with a DR value of 0x23. The output (80) is hex, which means that switch 7 is on and the others are off.
Opening 'Znuh's JTAG via USB' ...
Identifying chain contents ...
'1' xc3s1000 Xilinx Spartan-3
'2' xcf04s Xilinx XCF00S Platform Flash
2 device(s) found.
USER1: 80
That's it?
Only 8 bit DR supported so far, but I'm working on some thingies:
- Spartan3AN SPI-Flash access via USER1/2 with xilprg
- external USER1/2 interface via TCP or so
- Assume you got a microcontroller softcore in your FPGA. You can then attach GDB via the USERx-interface of xilprg to your core!
- Or you can include a logic analyzer in your design for debugging.
- There are lots of possibilities. You can attach nearly any custom software.

No comments:
Post a Comment