Services - tools - models - for embedded software development
Embecosm divider strip
Prev  Next

3.4.1.  JtagSC

In addition to the public instance variables which form part of the API, the main JTAG module maintains some private state.

Constructor and Destructor Implementation

The constructor initializes the current TAP action (currentTapAction) to NULL and allocates new instances of the FIFO (sc_fifo) and the TAP state machine (TapStateMachine).

It also declares the protected method processActions to be a SystemC method (SC_METHOD), sensitive to the rising TCK (tck.pos()). It is this method that is responsible for progressing the queued actions on each clock cycle.

The destructor deletes the FIFO and TAP state machine to free the memory on completion.

processActions

This function is declared in the constructor as a SystemC SC_METHOD. It is invoked on every rising edge of TCK.

TRST takes its value as the inverse of the System reset (since it is active low, while the latter is active high). If the system is in reset, there is nothing else to do and the method returns.

If there is no TAP action currently being processed (i.e. currentTapAction is NULL) then the method attempts a non-blocking read from the FIFO.

If no new action is available from the FIFO, then TMS is driven to the appropriate state to move towards the Run-Test/Idle state and the method returns.

Having obtained (or already in progress of) a TAP action, its process method is invoked. This takes the current state machine and TDO and returns (via parameters) new values of TDI and TMS. It returns success if this completes the action.

In the event of successful completion, the SystemC event associated with the action is notified, and currentTapAction marked null, so a new action will be obtained from the FIFO on the next cycle.

The state machine is then advanced to its next state (based on the value of TMS), and the values of TMS and TDI used to drive the SystemC signals in tdi_o and tms_o.

[Note]Note

This function is only called on the positive edge of the clock, although TDO changes on the negative edge. However the value will still be there at the positive edge in all practical designs, so an additional call (with the associated computational overhead) is not required.

Embecosm divider strip