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

9.5.2.  uartDecoupSC Module Class Implementation

The constructor just calls the base class constructor, passing on all its arguments.

The BusReadWrite callback has the same structure as the version in the base class. Like the base class it calls the original UartSC version to carry out most of the functionality.

[Caution]Caution

The call is therefore to the base class of the base class of this class. The call cannot be to the base class, since that would call wait, defeating the temporal decoupling.

The difference is in updating the delay. The synchronous base class waited to model the timing delay and set the delay in the response to zero. In this version the code just increments the delay (which is the local time offset) by the additional time to carry out the read or write.

  switch( payload.get_command() ) {

  case tlm::TLM_READ_COMMAND:
    delay += sc_core::sc_time( UART_READ_NS, sc_core::SC_NS );
    break;
	  

The implementation of the UART module class with decoupled timing, UartDecoupSC may be found in sys-models/decoup-soc/UartDecoupSC.cpp in the distribution.

Embecosm divider strip