CS452 - Real-Time Programming - Spring 2013

Lecture 3 - Introduction

Public Service Annoucements

  1. Due date for assignment 0
  2. How to compile and run your first program
  3. How are you doing at finding a partner?
  4. Practical Details (pdf): if you haven't read this yet please do so before the final exam.

Communicating with the Train Controller

The train controller is a slow device. Why? What does slow mean in practice?

In contrast,

Flow Control

Polling Loops

Polling loops allow you to manage more than one condition/activity pair at the same time.

The basic polling loop

FOREVER {
  if( c1 ) a1;
  if( c2 ) a2;
  ...
  if( cN ) aN;
}

A Few Comments

Shallow computation

Worst case response time

What you put into an action matters a lot.

Suppose you put busy-wait I/O to the train controller into an action

Will you catch it in your testing?

When you Miss Deadlines

Testing more than once

Suppose you want a better response time for a1. Then try the loop

FOREVER {
  if( c1 ) a1;
  if( c2 ) a2;
  if( c1 ) a1;
  if( c3 ) a3;
  ...
  if( c1 ) a1;
  if( cN ) aN;
}

Worst case response time for a1

Breaking into pieces

Suppose the response time is still too long, because the execution of one action, say a2, is too long. Then you can break a2 into two parts

FOREVER {
  if( c1 ) a1;
  if( c2 ) { a2.1; half-done = TRUE; }
  if( c1 ) a1;
  if( half-done ) { a2.2; half-done = FALSE; }
  ...
}

This is strarting to get a little complicated and we haven't said anything about inter-action communication.


The Hardware/Software Provided

Provided and maintained by CSCF

TS-7200

Specific documentation from Technologic

System on Chip (SoC)

EP9302, designed and manufactured by Cirrus semiconductor

Memory

Byte addressable, word size 32 bits

Separate instruction and data caches

`COM' ports

Connected to UARTs

Only really two

Ethernet port

Busy wait ethernet code in RedBoot

Reset switch

EP-9302

Specific documentation from Cirrus

System on chip

Software

Compiler

GNU tool chain

RedBoot

Partial implementation

Returns when program terminates

Busy-wait IO

COM2 uses monitor; COM1 goes to train

  1. initialization
  2. output

input


Return to: