CS452 - Real-Time Programming - Spring 2012

Lecture 31

- Power On

Public Service Annoucements

  1. Final exam date: 9.00 August 7 to 11.30 August 9

Power On

Initial state

ARM

Cirrus

Technologic

The following things, which are described in the Technologic documentation, manual & circuit diagram, are properties of the TS7200

  1. Boot control bits, set to normal boot, 32-bit bus width, sychronous boot device, internal, watchdog timer disabled.
  2. Physical memory map
  3. In the AHB registers is a 16K block of ROM from 0x80090000 to 0x80093fff

Pre-pre-boot Sequence

  1. Jump to 0x80090018.
  2. Turn on LEDs
  3. Make the CPU completely vanilla. E.g.,
  4. Turn off watchdog timer
  5. Configure external clocks (needed for serial boot)
  6. Acquire boot state configuration inputs
  7. Using boot state configure

    These are configured with very conservative parameters

  8. Clear boot mode `memory map'
  9. Toggle LEDs
  10. Switch
  11. In the first two cases the 2048 bytes contains a memory test followed by a loader.
  12. The Mac FIFO code is used for premature death in the pre-boot also.

Pre-boot Sequence

This code knows all about the EP9302, and all about the TS7200.

  1. Sets up a stack in the ethernet buffer
  2. Sets the CPSR to a vanilla state: no interrupts, svc mode
  3. Copies 80 words of code from flash to the ethernet buffer
  4. Initializes memory controllers for the memory it has
  5. Configures GPIO.
  6. Turns off the watchdog timer
  7. Sets up the appropriate serial port for a monitor
  8. loads RedBoot

Can Message Passing be Made Type Safe?

Dynamically

Yes, even including type extension and polymorphism, but

Statically

No,

CSP

To formal methods people CSP is a calculus for reasoning about the correctness of multi-process/threaded/tasking (MPTT) systems. Active research has been ongoing for forty years with several goals

For programmers the claim has been and is made that CSP provides a superior method for structuring MPTT systems. (`Superior' in the sense of `easier to design, implement and understand'.)

Primitives

In CSP there are two communication primitives. In the notation of occam 2/Go, they are

  1. read
    keyboard ? ch
    ch = <- keyboard
  2. write
    keyboard ! duh
    keyboard <- duh

The communication primitives require something new, called a channel.

CHAN OF CHAR keyboard
keyboard chan char

The Transputer

Use many co-operating, medium capability microCPUs to do a big job.

Problem is communication

Communication requires either

What about real-time?

The transputer was an early, now vanished, example of a real-time system based on plentiful small granularity communication. Your kernel is another example.

Transputer hardware

Occam 2

Basic idea

  1. processes (tasks)
  2. CSP channels
  3. time

Combining processes

  1. sequential
  2. conditional
  3. looping
  4. parallel
  5. alternation

Time

Can you Build a Server with Type-Checking?

Outer
Scope
|
| CHAN OF REQUEST request
|
| Server 
| Scope
| |
| | REQUEST sreq
| | CHAN OF REPLY srep
| |
| | request ? sreq
| | srep := sreq.reply
| |
| | srep ! sresult
| |
| |
| |
| Client
| Scope
| |
| | REQUEST creq
| | CHAN OF REPLY crep
| |
| | creq.reply := crep
| | request ! creq
| |
| | crep ? cresult
| |
 

The Result

You can write a type-safe server, BUT

BUT

with this structure excessive code in the client weakens synchronization, which might not be what you want.


Return to: