In XJEASE the SET statement is the command to access pins via a JTAG device. XJEase works out via the BSDL files and netlist how to access a pin on a non JTAG device from a JTAG device.
The SET statement can perform both reading and writing of the pins. So:
Any signals which aren’t changed on a SET statement remain in the same state. All SET statements take one JTAG scan except if you are changing the direction of a bus from writing to reading:
You can set a bus to be tristate by doing the following:
Once a pin is in a state, setting it again is optimised away. So the following code only takes one JTAG scan:
You can combine accesses so that they all happen on the same JTAG scan by using a comma:
In the example above all the access happen on the same JTAG scan. There is however a difference in timing between the reading and writing. “readvalue := DATA;” happens first during the "Capture" State in the JTAG state machine. The actual outputting of nCS happens later. This delay is the delay of scanning the JTAG chain and moving the JTAG state machine to the "Update" state. This on a device with 300 bits in the scan chain and running at 10MHz will be about 30μs.
The Write-to-Write time
Providing the JTAG chain speed isn’t restricted due to lack of data then the write-to-write time is just over 30μs (it is a slightly longer path through the JTAG state machine):
The Write-to-Read time
The time between writing to one pin and reading another on the following scan is much faster as the time between the "Update" (write) and the "Capture" (Read) is only a few JTAG cycles around the state machine (about 0.3μs in our example). But as explained earlier – if the pin/bus being read is the one which was just written it will take a further complete scan to read the data.
So for SRAM based devices you could have the following read cycle:
The above takes a large number of JTAG scans. You can make it much quicker by combining SET statements:
If you can be sure nWE is logic 1 before starting then the first SET can be removed.