jtag_driver

The jtag_driver class is used to generate simulation input excitations for JTAG test logic. Once created, a jtag_driver instance can be shared by multiple user-defined classes for creating further JTAG control helper abstractions on top of jtag_driver to control different pieces of test logic over the same JTAG TAP. Note! jtag_kernel is used as a singleton. Therefore, if you have a python process which instantiates multiple jtag_kernel’s, only one will actually be created. This results in all jtag waveforms being merged into one. Use jtag_driver.clear() function to clear the jtag waveform to avoid it.

class jtag.driver.jtag_driver(*arg)
capture_and_shift_out(icode_str, tdr_width)

Capture parallel input to the currently selected Test Data Register and shift out the captured bits to TDO.

Parameters

icode_strstr

Binary string representation of the Instruction Register corresponding to the Test Data Register to be captured.

tdr_widthint

Width of the selected Test Data Register in bits.

clear()

Clear jtag waveform in the singleton python module.

drshift_to_idle()

Move the TAP controller FSM from ShiftDR state to Run-Test/Idle state.

Takes 2 cycles.

get_numpy_array()
get_remote_bitbang()
idle_to_drshift()

Move TAP controller FSM from Run-Test/Idle state to ShiftDR state.

Takes 3 cycles.

idle_to_irshift()

Move the TAP controller FSM from Run-Test/Idle state to Shift-IR state.

Takes 4 cycles.

init()
irshift_to_idle()

Move the TAP controller FSM from Shift-IR state to Run-Test/Idle state.

Takes 2 cycles.

jtag_cycle_tms(tms)

Cycle TCK once while holding TMS at given value.

Parameters

tmsint

TMS value during cycle (0 or 1)

jtag_cycle_tms_tdi(tms, tdi)

Cycle TCK once while holding TMS and TDI at given values.

Parameters

tmsint

TMS value during cycle (0 or 1)

tdiint, None

TDI value during cycle (0 or 1)

reset_tap()

Reset the TAP by asserting TRSTn.

reset_to_idle()

Move TAP controller FSM from Test-Logic-Reset state to Run-Test/Idle state.

Takes 7 cycles.

shift(tdi_str)

Shift given data to TDI.

Parameters

tdi_strstr

String representation of the binary number to be shifted in.

Takes len(tdi_string) cycles.

shift_data(tdi_str)

Shift data to the currently selected data register.

Takes len(tdi_str) + 5 cycles.

Parameters

tdi_strstr

String representation of the binary number to be shifted in.

shift_instruction(tdi_str)

Shift one insctruction to the instruction register. Assumes that the JTAG machine is currently in the Run-Test/Idle state.

Takes len(tdi_str) + 6 cycles.

Parameters

tdi_strstr

String representation of the binary number to be shifted in.

shift_to_chain(icode_str, tdi_str)

Shift data to a specific data register.

Takes len(icode_str) + len(tdi_str) + 11 cycles.

Parameters

tdi_strstr

String representation of the binary number to be shifted in.

icode_strstr

String representation of the binary number to be shifted into the Instruction Register, which selects the corresponding Test Data Register.

tms_reset()

Move TAP controller FSM to Test-Logic-Reset state from any other state by performing 5 TCK cycles while holding TMS = 1. Then cycle once more to latch any values generated at Test-Logic-Reset state.

Takes 6 cycles.

property trstn_polarity

JTAG asynchronous reset polarity indicated as 0 = active low or 1 = active high. Default is 0 = active low.

JTAG

The JTAG class represents the JTAG logic in a system. This entity is used to model the JTAG hardware in rtl simulations. Here it is used as an sv model to simulate the JTAG logic defined in the chisel submodule.

Role of section if __name__=="__main__"

This section is used for self-testing by executing the following steps:

  1. Instantiate JTAG as the DUT

  2. Instantiate jtag_driver

  3. Generate the simulation control sequence using jtag_driver helpers

  4. Connect the entity IOs together, and

  5. Invoke the digital simulator

class jtag.JTAG(*arg)

TheSyDeKick entity for modeling JTAG test logic

Attributes

IOSBundle

Members of this bundle are the IOs of the entity. See the documentation of thesdk package. The following members are defined for JTAG:

self.IOS.Members['in'] = IO() # pointer for input data
self.IOS.Members['out'] = IO() # pointer for output data
self.IOS.Members['jtag_tap_in'] = IO() # JTAG TAP input signals
self.IOS.Members['jtag_tap_out'] = IO() # JTAG TAP output signals
self.IOS.Members['control_write'] = IO() # Pointer for control IO for rtl simulations
modelstr

Hardcoded to 'sv' for rtl simulation.

__init__(*arg)

JTAG parameters and attributes

Parameters

*arg

If any arguments are defined, the first one should be the parent instance

init()

Re-initialize the structure if the attribute values have been changed after creation.

main()

The main python description of the operation. Unused for this entity.

run()

The default name of the method to be executed. This means: parameters and attributes control what is executed if run method is executed. By this we aim to avoid the need of documenting what is the execution method. It is always self.run().