Services and Modeling for Embedded Software Development
Embecosm divider strip
Prev  Next

11.2.  A TLM 2.0 Interface for JTAG Using a Payload Extension

11.2.1. JtagExtensionSC Extension Class Definition
11.2.2. JtagExtensionSC Extension Class Implementation

The SystemC TLM 2.0 generic payload is intended for use with models of conventional buses. The payload is a multiple of bytes long and transmitted over an interface that is a multiple of bytes wide.

This is not a good fit for bit-serial interfaces such as IEEE 1149.1 JTAG.

It is possible to build a completely new payload, customized to such an interface, and which would permit use of all the other TLM 2.0 infrastructure. However such a task is complex and time-consuming, and is not good for compatibility between models.

As an alternative, SystemC permits extension of the generic payload. There are two flavors of extension, ignorable extensions are used where the generic payload is still meaningful without the extension being present. Mandatory extensions are used where the information in the payload is essential to correct operation of targets and initiators.

Ignorable extensions are preferred wherever possible, since they maximize reusability of the interface. The C++ type system is used to enforce mandatory extensions, and their use requires sharing a defining type between all targets and initiators.

For the JTAG interface we use an ignorable extension. Where present, this specifies what type of transaction is required (reset, shift through the instruction register, shift through the data register) and the exact bit length of the register being shifted. The actual data is supplied as a byte vector in the generic payload as normal.

Where the extension data is not provided, the type of transaction is inferred from the generic payload's address: 0 for shifting through the instruction register, 1 for shifting through the data register and any other value for reset. The bit length is calculated as 8 times the generic payload data length.

In practice the extension will always be used, but by being ignorable, we allow the maximum possible reuse of the interface in applications.

Embecosm divider strip