My current view of the low level software interface between the resource manager (Norman) and state machine stream processor follows. These functions hide an implementation based on message passing. It consists of a function to initalize a generic flood interface, which will be called to setup each transfer. Other functions allocate process id's on the state machine, and actually invoke the execution of a function with a given set of parameters.
These functions should be located in /cheops/local/src/lib/device/stm.c Prototypes and definitions should be in /cheops/local/include/sys/statemach.h
/* stm_flood This function will initialize a common set of flood control interface registers in either Boswell or Jonson, selected by the lowest bit of pbank. If successful, a 0 is returned. A negative return value indicates error */ long stm_flood_setup( int pbank, /* stream processor id [0-5] */ long mode, /* flood mode (src/dst, etc.) long start, /* ptr to data buf (in FLEX adr space) */ long size, /* number of shorts being transferred */ int ok_sel, /* OK channel to use */ int delay); /* pipeline delay value */ /* stm_exec This function will start the execution of a given process, with the specified parameters. ( old stm_update_args ) If the execution was succeful, a 0 is returned. A negative error code is returned if execution was not succesful. */ long stm_exec( int pbank, /* stream processor id [0-5] */ char pid, /* process id - identifies code segment */ parameter_st *args ); /* pointer to parameter structure */ /* stm_alloc_pid This function allocates a process id from the 603 state machine. A size (in bytes) of the process code/data space is requested. If no process ID could be allocated, a negative value is returned. */ char stm_alloc_pid( int pbank, /* stream processor id [0-5] */ long size ); /* req. size of code/data seg, in bytes */ /* stm_free_pid This function freeates a process id from the 603 state machine. A size (in bytes) of the process code/data space is requested. If somethinge goes wrong a negative value is returned, otherwise a 0 indicates successful completion. */ long stm_free_pid( int pbank, /* stream processor id [0-5] */ char pid ); /* process id - identifies code segment */ /* stm_get_heap This function provides information required to initialize the shared memory manager. A pointer (in the P2 address space) to a pointer (in the state machine address space) to the base of the heap and a pointer to the heap size are passed as arguments, and the variables they point to initialized by the function. A zero is returned if no error occured, a negative value otherwise. */ long stm_get_heap( int pbank, /* stream processor id [0-5] */ long *base_ptr, /* location of start pointer */ long *size_ptr ); /* location of size */
Please send comments regarding this proposal to wad@media.mit.edu