Questions and requested (recommended) modifications to C40 DSP code.

No 1:

Change

volatile configuration *item = (configuration *)(CONFIGURATION_ADDRESS);

to

volatile configuration *ControlPar = (configuration *)(CONFIGURATION_ADDRESS);

in process.h

Reason : more clearer variable naming

No 2:

What is the meaning for the scheduler of the Time On and Time Off parameters. These parameters are not described in the available documentation.

No 3:

Is there a state transition diagram available of the task states. It is hard to understand from the code which states a task can be in and under which conditions.

No 4:

In general there are many different memory calculations used of which several are duplicated in different parts of the code. The main one is access to dual port memory, byte merging is duplicated in different parts of the code.

It is even the case that the same dual port memory location is read multiple times to extract specific bit fields. (Dual port memory is slow, so read it one time and extract bit fields from read value.)

No 5:

What is the reason for such a complex addressing mechanism for providing memory addresses (Immediate + MemID + Address (the 24-bit format)) instead of just one (physical) memory address.

No 6:

the pointer variable taskAttr is a global variable, it is however also used by several functions as a temporary variable for indexing though the task list.

This variable is also used in a case of NULL pointer addressing. (Entry() in schedule.c)

When the first iteration through the task list reveals no running tasks (taskAttr = NULL) the taskAttr pointer is used to check if the task has to be taken off queue.

The problem can easily solved by putting the test inside the for loop. This test must only be performed when a RUNNING task is changed to DONE.

No 7:

In void send (command, point, transfers) in comm.c the message queue is directly referenced. This in it self is not only doubtful but also performed wrong. It is referenced using [que - 1] with the possibility to address outside of the queue.

No 8:

The index pointer in the error queue is only increased until the end of the queue. This pointer is never reset to index 0. This buffer has to be changed to a true queue (FIFO).