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

4.3.  Modeling the OpenRISC 1000 Debug Unit

4.3.1. How JTAG is used by the OpenRISC 1000 Debug Unit
4.3.2. DebugUnitSC class
4.3.3. SprCache class
4.3.4. MemCache class

The OpenRISC 1000 Debug Unit model provides a higher level abstraction of the debug interface to the OpenRISC 1000, and sits above the JTAG interface. It allows access to main memory and special purpose registers (SPRs) together with control of the CPU reset and stall lines. These are all mapped onto lower level JTAG register accesses using the Embecosm cycle accurate SystemC JTAG interface.

The Debug Unit model also offers higher level caching functions. The JTAG clock typically has a period ten times greater than the main system clock. Combined with the serial nature of JTAG this means that accessing a single register or memory location can take many hundreds of system clock cycles.

While the processor is stalled, registers and memories do not change, so caching is possible and can greatly increase performance. This is provided through the SprCache and MemCache classes.

The class diagram in Figure 4.4 shows the relationship between these components.

Class Diagram for the Debug Unit model

Figure 4.4.  Class Diagram for the Debug Unit model


The main GdbServerSC class is responsible for creating the DebugUnitSC instance, passing in the SystemC FIFO used to connect to the SystemC JTAG interface. The Debug Unit in turn instantiates the SprCache and MemCache instances.

[Note]Note

There are at least two different variants of the OpenRISC 1000 Debug Unit. This application note describes the version used within the OpenRISC 1000 Reference Platform System-on-Chip (ORPSoC). An alternative implementation by Igor Mohor is simpler and more recent. Where the two need to be distinguished, they will be referred to as the ORPSoC Debug Unit and Mohor Debug Unit respectively. Where not thus qualified, the ORPSoC Debug Unit is the implementation being referred to.

Embecosm divider strip