Vitis [0]: jtag = session.jtag_targets()
1 Digilent JTAG-SMT2NC 210308A7B222 ()
2 xczu9 (idcode 24738093 irlen 12 fpga)
3 arm_dap (idcode 5ba00477 irlen 4)
Users can filter on the JTAG Targets
Vitis [0]: jtag = session.jtag_target(filter='name==arm_dap')
3 arm_dap (idcode 5ba00477 irlen 4)
Users can return the target properties for a jtag target using the –target_properties (or -t) switch
Vitis [0]: jtag = session.jtag_target('-t', filter='name==arm_dap')
Vitis [0]: print(jtag)
{'jsn-JTAG-SMT2NC-210308A7B222-5ba00477-0': {'target_ctx': 'jsn-JTAG-SMT2NC-210308A7B222-5ba00477-0', 'level': 1, 'node_id': 3, 'is_open': 1, 'is_active': 1, 'is_current': 0, 'name': 'arm_dap', 'jtag_cable_name': 'Digilent JTAG-SMT2NC 210308A7B222', 'state': '', 'jtag_cable_manufacturer': 'Digilent', 'jtag_cable_product': 'JTAG-SMT2NC', 'jtag_cable_serial': '210308A7B222', 'idcode': '5ba00477', 'irlen': '4', 'is_fpga': 0, 'is_pdi_programmable': 0}}
This is a nested dict. If users wanted to get the idcode, then they would need traverse through the key
Vitis [0]: print(jtag["jsn-JTAG-SMT2NC-210308A7B222-5ba00477-0"]["idcode"])
Users can make this more dynamic.
Vitis [0]: key = list(jtag.keys())
Vitis [0]: print(jtag[key[0]]["idcode"])
5ba00477
Users can use this info to determine the arch of the target device.
Vitis [0]: if idcode == '4ba00477':
...: print('zynq')
...: elif idcode == '5ba00477':
...: print('zynqmp')
...: elif idcode == '6ba00477':
...: print('versal')
...: else:
...: print('error: unknown dap')
...: