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

7.4.1.  SystemC Processes

The method listening to the UART, rxMethod is sensitive to writes to the rx buffer. When triggered, the character is read from the buffer and immediately copied to the xterm. Although this is a blocking operating system write, it should return with minimal delay. In an environment where any blocking were a concern, a non-blocking write could be used instead.

The thread listening to the xterm, xtermThread sits in a perpetual loop, waiting on the SystemC event pointed to by ioEvent. This will safely allow the thread to yield to the SystemC scheduler until a character is ready.

When input is available, the event is notified (see Section 7.4.2). The thread can safely make an operating system read to get the character, knowing that data is definitely available.

Embecosm divider strip