CLOCK attribute

Top  Previous  Next

The kernel maintains an internal clock, usually ticking at the rate of 1 tick per millisecond. This clock tick is used in scheduling compute-bound threads and as the timebase for the <timer.h> functions. The rate is achieved by configuring one of the C6000’s internal timers (TIMER0) with a rate derived from the processor’s clock speed. This clock speed is one of the values provided by the processor type. TIMER1 is unused by Diamond.

 

The configurer has a default setting for each processor type it understands. For processors running at unusual clock speeds, you should specify a CLOCK= attribute in either a PROCESSOR or PROCTYPE declaration so that the kernel clock interrupt rate can be adjusted. For example, the following indicates a processor running at 300MHz rather than 200MHz:

 

processor faster MyProc200 clock=300

 

Dragons003Note that the argument to the CLOCK= attribute is expressed in Megahertz, not Hertz; CLOCK=300M would be rejected by the configurer.

 

The following variant is also allowed:

 

processor faster MyProc200 clock=off

 

CLOCK=OFF is equivalent to CLOCK=0. Both forms stop the kernel from using the timer hardware at all. This makes both hardware timers available for you to use directly, rather than TIMER1 only, but disables Diamond’s time-slicing of equal-priority threads and the timer.h functions. The scheduler will still operate correctly with time-slicing disabled, but threads will always run until they explicitly call a function that may suspend them (e.g. chan_in_message).