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

3.2.1.  TAP Action Classes

TAP actions are represented by the abstract C++ class, TapAction. The three specific actions for reset, scan IR and scan DR are sub-classed from this. Figure 3.1 shows this relationship and summarizes the public interface as a class diagram.

Class diagram for JtagAction and subclasses

Figure 3.1.  Class diagram for JtagAction and subclasses


TapActionReset

This class represents a reset action for the TAP controller. There are no publicly accessible member variables of this class. The public methods are:

  • TapActionReset (sc_core::sc_event *_doneEvent)
    		

    The constructor for new TAP reset actions. It is passed a pointer to a SystemC event in _doneEvent, which will be notified when the action is complete.

TapActionIRScan

This class represents the action of scanning a value through the instruction register. There are no publicly accessible member variables of this class. The public methods are:

  • TapActionIRScan (sc_core::sc_event *_doneEvent,
                     uint32_t           _iRegIn,
                     int                _iRegSize)
    		

    The constructor for new TAP IR scan actions. It is passed a pointer to a SystemC event in _doneEvent, which will be notified when the action is complete.

    The value to be scanned in (which will form the sequence of bits on TDI) is represented as a 32-bit integer in iRegIn. The actual number of bits to be scanned is an integer in _iRegSize.

    32-bits seems a reasonable limit for the size of instruction register in any realistic JTAG architecture.

  • uint32_t  getIRegOut ();
    		

    On completion of the action (as signaled through the SystemC event pointed to by _doneEvent this method will return the information that was scanned out of the instruction register. That is the sequence of bits that have appeared on TDO

    As noted above, in the case of the instruction register this is not the actual value of the instruction, but some status bits about the interface.

TapActionDRScan

This class represents the action of scanning a value through a data register. This is more complex, because data registers are potentially very large—often larger than the 64-bits the largest integer that can be held in a single C++ variable.

To support this, values are represented as an array of 64-bit unsigned integers (uint64_t). However, for efficient handling of smaller data registers, variants are provided which represent the register in a single 64-bit uint64_t.

There are no publicly accessible member variables of this class. The public methods are:

  • TapActionDRScan (sc_core::sc_event *_doneEvent,
                     uint64_t           _dRegInArray[],
                     int                _dRegSize)
    		

    The constructor for new DR scan actions. It is passed a SystemC event in _doneEvent, which will be notified when the action is complete.

    The value to be scanned in (which will form the sequence of bits on TDI) is represented as an array of 64-bit unsigned integers in dRegInArray. The actual number of bits to be scanned is an integer in _dRegSize.

    This interface allows data registers of any size to be handled. However if this constructor is used for a small value it will automatically use the more efficient constructor described next.

  • TapActionDRScan (sc_core::sc_event *_doneEvent,
                     uint64_t           _dRegIn,
                     int                _dRegSize)
    		

    An alternative constructor for smaller registers (up to 64-bits). This is for use where the data to be scanned in is up to 64-bits long. It can be used for larger registers, so long as the actual value to be scanned in is only 64 bits or fewer.

    The constructor is passed a SystemC event in _doneEvent, which will be notified when the action is complete.

    The value to be scanned in (which will form the sequence of bits on TDI) is supplied as a 64-bit unsigned integer in dRegIn. The actual number of bits to be scanned is an integer in _dRegSize.

  • ~TapActionDRScan ()
    		

    The destructor for DR scan actions. When handling more than 64 bits, arrays are allocated for internal data. If such arrays have been created, the destructor deletes them.

  • void  getDRegOut (uint64_t  dRegArray[])
    		

    On completion of the action (as signaled through the SystemC event pointed to by _doneEvent this method will return the information that was scanned out of the instruction register. That is, the sequence of bits that have appeared on TDO

    The result is copied into the uint64_t array supplied in dRegArray. This interface can be used, even if this is a small register that can be held in a single variable. The result will be copied into dRegArray[0].

  • uint64_t  getDRegOut ();
    		

    On completion of the action (as signaled through the SystemC event pointed to by _doneEvent this method will return the information that was scanned out of the instruction register. That is, the sequence of bits that have appeared on TDO.

    The value returned can be no larger than 64-bits. However this call may be used with a larger data register, in which case it will return the least significant 64 bits.

Embecosm divider strip