intel / aji_openocd

A customized copy of OpenOCD able to access the jtagd/jtagserver distributed with Quartus. At present it is restricted to accessing the ARM HPS. It will be relaxed in future release. Requires libaji_client (https://github.com/intel/libaji_client).
Other
11 stars 5 forks source link

If Multiple TAP has the same IDCODE, aji_openocd can only access SLD nodes on the first TAP in the chain #6

Open cinlyooi-intel opened 1 week ago

cinlyooi-intel commented 1 week ago

If, in your JTAG chain, you have more than one TAP with the same IDCODE, you can only access SLD nodes on the first chain.

For example, you have two identical Altera FPGA chip, say S10s, on the jtag chain. Both has one Nios V on it, you can only access the NiosV on the first TAP on the jtag chain. While OpenOCD will give you two ports, both ports refers to the NiosV on the first TAP.

For avoidance of doubt, you can access all the NiosVs on the first TAP.

cinlyooi-intel commented 1 week ago

The problem is, inside

Both call static AJI_ERROR jtagservice_device_index_by_idcode(const DWORD idcode, DWORD* tap_index) to find the "tap_index". As its name implied, it only examine and match "idcode", so if multiple TAP has the same "idcode", it will return the first one.

cinlyooi-intel commented 1 week ago

The best way to spot this bug is to look at OpenOCD initialization messages when it initialize the JTAG chain and the start of OpenOCD

"Virtual Tap/SLD node 0x08986E00 found at tap position 0 vtap position n"

when you have a NiosV instance that share the same SLD ID as your NiosV instance in your target TAP,

If not, OpenOCD should report that your NiosV instance is not found.