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

9.6.  Main Program for Temporal Decoupling

The main program, decoupSocMainSC.cpp is similar in structure to the main program used for the synchronous version (see Section 8.6). This time the headers for the versions of the Or1ksim wrapper and UART implementing temporal decoupling are used and the time to use as the system global quantum is defined as a parameter.

#include "Or1ksimDecoupSC.h"
#include "UartDecoupSC.h"
#include "TermSyncSC.h"

#define QUANTUM_US   100
	

Before any modules are instantiated, the system global quantum must be set. For the initial version a value of 100μs is selected, 10% of the time taken to transmit a character at 9600 baud, so there should be no awkward timing interactions.

  tgq->set( sc_core::sc_time( QUANTUM_US, sc_core::SC_US ));
	

Thereafter the program follows the same structure (but using the versions of the Or1ksim wrapper and UART with temporal decoupling).

The implementation of the SystemC main program for the decoupled SoC may be found in sys-models/decoup-soc/decoupSocMainSC.cpp in the distribution.

Embecosm divider strip