/************************************************************************************ * primParams.h * * synopsis: Defines primitive ids which are used to index the array of pointers to * primitive functions, structure tags for primitive data and reply data, * and prototypes of primitive functions. * * related files: * primitiveBuilding.txt: describes how to build primitives * primParams_pxl.h, primParams_sct.h: detector-specific versions of this file. * listManager.c: Routines which manage the execution of a primitive list and * writing the reply data. * primFuncts.c: Contains primitive execution functions common to the master and the * slaves and the function which initializes the primParameters array * of structures. * masterPrimFuncts.c/slavePrimFuncts.c: Contain primitive execution functions * specific to the master/slave DSP. * primFuncts.h: Declares the structure tag which communicates necessary information * to primitive functions. * * Damon Fasching, UW Madison fasching@wisconsin.cern.ch * Douglas Ferguson, UW Madison (510) 486-5230 dpferguson@lbl.gov * * modifications/bugs * - Split the primitive IDs into 3 sets, so that future primitives can * be placed in the appropriate section (common/slave/master) without * affecting the already existing primitive lists on the host machines. * Currently primitives must be added to the end of the entire list to * avoid ID changes of existing primitives & thus re-writes of the * primitive lists. Updated the example. 10.04.02 dpsf * - Moved rodConfiguration #defines to rodConfiguration.h, where * they belong. 11.04.02 dpsf * * - Split off detector-specific primitives into their own files. ************************************************************************************/ #ifndef PRIM_PARAMS #define PRIM_PARAMS #include "processor.h" #include "serialStreams.h" #include "scanControl.h" #include "bocStructure.h" #include "rodConfiguration.h" #include "router.h" //#include "primList.h" #if defined(SCT_ROD) #include "primParams_sct.h" #elif defined(PIXEL_ROD) #include "primParams_pxl.h" #endif #define PRIM_LIST_REVISION 112 /* default value for primitive parameters, function arguments, etc */ #define DEFAULT (0xFFFFFFFF) /************************************************************************************ * Primitives common to all DSPs go here * Note: some of these primitives (eventTrapSetup, triggerMask, setTrigger) are used * to coordinate the DSPs with each other or other electronics on the ROD (such as * the router). These primitives should be sent to the master DSP from the host; the * master DSP primitive will then set the appropriate board registers, etc. and pass * on the primitive to the slave DSP. The primitive passing software will not break * if the host sends one of these primitives directly to a slave, but slave * applications might break as a result of inconsistent parameter settings. ************************************************************************************/ #define COMMON_PRIMITIVES_BASE 0x0 /* Echo the primitive message body back in the reply message body. */ #define ECHO (COMMON_PRIMITIVES_BASE) #define R_ECHO 100 /* echo's input & output data is unstructured. */ /* * Set error severity mask - levels which are masked will not write an error message * to the text buffer. * IN: errMsgMask: value to set errMsgMask to; * DEFAULT means do not change the value * OUT: errMsgMaskOut->errMsgMask: value of errMsgMask at end of this routine */ #define SET_ERRMSG_MASK (1 + (ECHO)) #define R_SET_ERRMSG_MASK 100 struct SET_ERRMSG_MASK_IN { UINT32 errMsgMask; }; struct SET_ERRMSG_MASK_OUT { UINT32 errMsgMask; }; /* * Pause the execution of the primitive list. List execution will resume when the * RESUME bit is set in the command register. */ #define PAUSE_LIST (1 + (SET_ERRMSG_MASK)) #define R_PAUSE_LIST 100 /* eventTrapSetup: * Sets the event trapping parameters for a particular slave. They need to be set * in the slave DSP and in the router fpga. Common to Master/Slave, however * eventTrapSetup is intended to be a HOST to MASTER DSP primitive only; the master * DSP then sets up the router registers and passes a primitive list to call * eventTrapSetup on the slave DSP. Trap configuation is not independent, if only * one trap is used, it must be trap 0. The primary purpose for trap 1 is to have * a way of running short immediate tasks with a different function (like trapping * events) on the DSP, while it continues a task such as occupancy counting. */ #define EVENT_TRAP_SETUP (1 + (PAUSE_LIST)) #define R_EVENT_TRAP_SETUP 103 struct EVENT_TRAP_SETUP_IN { UINT32 slvBits, numberOfEvents, timeoutInUsec; UINT32 extRouterSetup, distribute; UINT32 releaseFrames, permitBackPressure, dataMode, sLink, format, trapStray, iterLimit; UINT32 trapConfig[2], trapExclusionFlag[2], trapFunction[2], trapMatch[2], trapModulus[2], trapRemainder[2]; }; struct EVENT_TRAP_SETUP_OUT { UINT32 errorCode; }; #define COLLECT_FOREVER 0 #define KEEP_EVENTS 0 #define TRAP_DISTRIB_PRIMARY 0 #define TRAP_DISTRIB_SECONDARY 1 #define TRAP_DISTRIB_BOTH 2 #define TRAP_DISTRIB_NEITHER 3 #define TRAP_FMT_NORMAL 0 #define TRAP_FMT_ERROR 1 /* Quickly set a section of the DSP's memory */ #define SET_MEMORY (1 + (EVENT_TRAP_SETUP)) #define R_SET_MEMORY 100 struct SET_MEMORY_IN { UINT32 *start, size, val; }; /* Quickly copy one section of the DSP's memory into another section */ #define COPY_MEMORY (1 + (SET_MEMORY)) #define R_COPY_MEMORY 100 struct COPY_MEMORY_IN { UINT32 *source, *destination, size; }; /* New memory test, designed to work with full code (ie not the memory-test mode) */ #define MEMORY_TEST (1 + (COPY_MEMORY)) #define R_MEMORY_TEST 102 struct MEMORY_TEST_IN { UINT32 *start, size, repetitions[6], errorsBeforeFail, continueOnError; UINT32 nReads, dmaFlag; }; struct MEMORY_TEST_OUT { UINT32 returnCode; }; /* Turn an LED on or off. */ #define SET_LED (1 + (MEMORY_TEST)) #define R_SET_LED 104 struct SET_LED_IN { UINT32 ledNum, ledState; }; #define YELLOW_LED 0 #define GREEN_LED 1 #define RED_LED 2 #define OFF 0 #define ON 1 #define TOGGLE 2 /* Flash an LED. Period and number of flashes are settable parameters. */ #define FLASH_LED (1 + (SET_LED)) #define R_FLASH_LED 103 struct FLASH_LED_IN { UINT32 ledNum, period, numTimes; }; #define SEND_DATA (1 + (FLASH_LED)) #define R_SEND_DATA 102 struct SEND_DATA_IN { UINT32 dataType, auxVal, repBufferFlag, timeout; }; struct SEND_DATA_OUT { UINT32 *dataPtr, dataLength; }; #define MIRROR_DATA 0x10 #define ROUTER_DATA 0x11 #define STREAM_DATA 0x12 #define EVENT_DATA 0x20 #define HISTOGRAM_DATA 0x21 #define OCCUPANCY_DATA 0x22 #define FIT_DATA 0x23 /* moduleMask defines the link setup (command & data) for the modules. Like eventTrapSetup, moduleMask is meant to be sent from the host to the master DSP, which will transfer its data to the slave DSP(s) if desired. */ #define MODULE_MASK (1 + (SEND_DATA)) #define R_MODULE_MASK 101 #if defined(I_AM_SLAVE_DSP) struct MODULE_MASK_IN { ModuleMaskData moduleMaskData[N_TOTMODULES]; }; #else struct MODULE_MASK_IN { UINT32 moduleNum, port, useStructSet, passOn, slvBits; UINT32 cmdLine, fmtLink[2], unused[2]; UINT32 cfg, modMask[2], maskType, storage, maskSet; }; #endif /* Send a trigger to the detector electronics. If setTrigger is issued to a slave DSP, the trigger source is assumed as external (possibly not even issued by the master DSP); in this case only the current bin & histogram set are set. */ #define SET_TRIGGER (1 + (MODULE_MASK)) #define R_SET_TRIGGER 102 struct SET_TRIGGER_IN { struct CmdList cmdList[2]; UINT32 slvBits; UINT16 cmdBuff, preBuilt; UINT32 chipAddress, bin, set; UINT32 repetitions, interval; UINT32 preBuiltDataOffset[2]; UINT16 incCmd[2]; UINT32 incData[2]; }; /* Serial port definitions; used by several primitives & tasks: */ #define SP0 0 #define SP1 1 #define SP_BOTH 2 #define START_TASK (1 + (SET_TRIGGER)) #define R_START_TASK 101 /* Task revision numbers must be updated whenever a task's input parameters are modified. Revision numbers of the tasks should not exceed 0xff. If a task has a default position for its memory base (eg. trapTask), that is defined inside memoryPartitions.h along with the other memory-related constants. */ /* master */ /* Task which controls an entire histogram scan */ #define R_HISTOGRAM_CTRL_TASK 107 struct XPair { FLOAT32 x0, delta_x; }; struct RangeList { struct XPair xPair[5]; }; struct HISTOGRAM_CTRL_TASK_IN { ScanControl scanControl; }; struct HISTOGRAM_CTRL_TASK_OUT { UINT32 totalTime; UINT32 slvProcTime[4]; UINT32 *dataPtr, dataLength; }; #define R_MIRROR_TASK 101 struct MIRROR_TASK_IN { UINT32 slvBits, mirrorFreq, *mirrorBase, *mirrorSlvBase, mirrorLen; }; #define MIRROR_DEFAULT_BASE 0x800000a0 #define R_TRAP_REQ_TASK 101 struct TRAP_REQ_TASK_IN { UINT32 slvBits, watchFreq; }; /* slave */ #define R_HISTOGRAM_TASK 100 struct HISTOGRAM_TASK_IN { UINT32 nEvents, controlFlag; /* nEvents can equal COLLECT_FOREVER too. */ }; /* control flag settings: */ #define MASTER_HREG 0 #define LOCAL_INC 1 #define LOCAL_SET_TRIG 2 struct HISTOGRAM_TASK_OUT { UINT32 nEvents, binsDone; FLOAT32 avgProcTime; UINT32 *dataPtr, dataLength; }; #define R_TRAP_TASK 100 struct TRAP_TASK_IN { UINT32 nEvents, reloadInterval, trapType, eventType, *trapBufferBase, trapBufferLength; }; struct TRAP_TASK_OUT { UINT32 nEvents, dataLen; UINT32 *bufferBase, bufferLen; }; #define R_OCCUPANCY_TASK 100 struct OCCUPANCY_TASK_IN { UINT32 nEvents, nFilters, splitFlag; char filter[16]; }; #define R_ERROR_TASK 100 struct ERROR_TASK_IN { UINT32 errorType; }; struct ERROR_TASK_OUT { UINT32 nErrors; }; #define R_RESYNCH_TASK 100 struct RESYNCH_TASK_IN { UINT32 errorType; }; /* tasks can have their own specialized output structures, this is a general one. It is stored as an array of external structures in the task manager, so that if a task completes & later the data is requested, it can be supplied. */ struct GEN_TASK_OUT { UINT32 *dataPtr, dataLength; }; union TASK_STRUCTURES_OUT { struct HISTOGRAM_CTRL_TASK_OUT histoCtrlTaskOut; struct HISTOGRAM_TASK_OUT histogramTaskOut; struct TRAP_TASK_OUT trapTaskOut; struct ERROR_TASK_OUT errorTaskOut; struct GEN_TASK_OUT genTaskOut; }; /* MAX_NUM_TASKS is the maximum of the two task numbers for master & slave DSPs. Bad Things can happen if it is not kept up to date */ #define MAX_NUM_TASKS 5 /* The IDs of the two task sets cannot not exceed 0xff, and must increment by 1. */ /* master DSP tasks: */ #define MASTER_TASK_BASE (0x10) #define HISTOGRAM_CTRL_TASK (MASTER_TASK_BASE) #define MIRROR_TASK (1+(HISTOGRAM_CTRL_TASK)) #define TRAP_REQ_TASK (1+(MIRROR_TASK)) #define LAST_MASTER_TASK (TRAP_REQ_TASK) #define NUM_MASTER_TASKS ((LAST_MASTER_TASK)-(MASTER_TASK_BASE)+1) #define ALL_SLAVES 5 /* slave DSP tasks: */ #define SLAVE_TASK_BASE (0x20) #define HISTOGRAM_TASK (SLAVE_TASK_BASE) #define TRAP_TASK (1+(HISTOGRAM_TASK)) #define OCCUPANCY_TASK (1+(TRAP_TASK)) #define ERROR_TASK (1+(OCCUPANCY_TASK)) #define RESYNCH_TASK (1+(ERROR_TASK)) #define LAST_SLAVE_TASK (RESYNCH_TASK) #define NUM_SLAVE_TASKS ((LAST_SLAVE_TASK)-(SLAVE_TASK_BASE)+1) #if defined(I_AM_MASTER_DSP) #define LAST_TASK (LAST_MASTER_TASK) #define NUM_TASKS (NUM_MASTER_TASKS) #define TASK_BASE (MASTER_TASK_BASE) #elif defined(I_AM_SLAVE_DSP) #define LAST_TASK (LAST_SLAVE_TASK) #define NUM_TASKS (NUM_SLAVE_TASKS) #define TASK_BASE (SLAVE_TASK_BASE) #endif union TASK_STRUCTURES_IN { struct HISTOGRAM_CTRL_TASK_IN histoCtrlTaskIn; struct MIRROR_TASK_IN mirrorMemoryTaskIn; struct TRAP_REQ_TASK_IN trapRequestTaskIn; struct HISTOGRAM_TASK_IN histogramTaskIn; struct TRAP_TASK_IN trapTaskIn; struct OCCUPANCY_TASK_IN occupancyTaskIn; struct ERROR_TASK_IN errorTaskIn; struct RESYNCH_TASK_IN resynchTaskIn; }; struct START_TASK_IN { UINT32 taskType, taskRevision, priority, completionFlag; union TASK_STRUCTURES_IN taskStruct; }; #define TASK_OPERATION (1 + (START_TASK)) #define R_TASK_OPERATION 100 struct TASK_OPERATION_IN { UINT32 taskType, taskOperation, data; }; #define TASK_STOP 0 #define TASK_PAUSE 1 #define TASK_RESUME 2 #define TASK_QUERY 3 #define TASK_RESET 4 #define TASK_SETPRIORITY 5 #define SET_BIN (1 +(TASK_OPERATION)) #define R_SET_BIN 100 typedef struct { #if defined(I_AM_MASTER_DSP) UINT32 slvBits; #endif UINT32 bin; } SetBinIn; #define WRITE_BUFFER (1 + (SET_BIN)) #define R_WRITE_BUFFER 101 struct WRITE_BUFFER_IN { UINT32 buffer; /*char string[64];*/ char string[2396]; /* sizeof(union PRIM_PARAMS_UNION) => 2400 bytes. */ }; #define WRITE_BUFFER_ERR 0 #define WRITE_BUFFER_INFO 1 #define WRITE_BUFFER_DIAG 2 #define WRITE_BUFFER_XFER 3 #define LAST_COMMON_PRIMITIVE (WRITE_BUFFER) #define NUM_COMMON_PRIMITIVES ((LAST_COMMON_PRIMITIVE)-(COMMON_PRIMITIVES_BASE)+1) /************************************************************************************ * Slave DSP primitives go here. ************************************************************************************/ #define SLAVE_PRIMITIVES_BASE 0x1000 #define START_EVENT_TRAPPING (SLAVE_PRIMITIVES_BASE) #define R_START_EVENT_TRAPPING 101 #define STOP_EVENT_TRAPPING (1 + (START_EVENT_TRAPPING)) #define R_STOP_EVENT_TRAPPING 100 #define LAST_SLAVE_PRIMITIVE (STOP_EVENT_TRAPPING) #define NUM_SLAVE_PRIMITIVES ((LAST_SLAVE_PRIMITIVE)-(SLAVE_PRIMITIVES_BASE)+1) /************************************************************************************ * Master DSP primitives go here. ************************************************************************************/ #define MASTER_PRIMITIVES_BASE 0x2000 /* Read or write a block of slave memory. * - slaveNumber: ID of slave to be accessed * - readNotWrite = 0 for writing to slaves, != 0 for reading from slaves * - *slaveAddress: slave reads: source address of the data * slave writes: destination address of the data * - *masterAddress: slave reads: destination address of the data; the special value * DEFAULT puts the data in the body of the reply msg * just after the RW_SLAVE_MEMORY_OUT structure * slave writes: source address of the data; the special value * DEFAULT gets the data from the body of the primitive * just after the RW_SLAVE_MEMORY_IN structure * - numWords: in input structure: number of 32 bit words to read or write */ #define RW_SLAVE_MEMORY (MASTER_PRIMITIVES_BASE) #define R_RW_SLAVE_MEMORY 100 struct RW_SLAVE_MEMORY_IN { UINT32 slaveNumber; UINT32 readNotWrite; UINT32 *slaveAddress; /* DEFAULT address defined above */ UINT32 *masterAddress; /* DEFAULT address defined above */ UINT32 numWords; }; /* Transmit serial data to controller FPGA */ #define TRANS_SERIAL_DATA (1+(RW_SLAVE_MEMORY)) #define R_TRANS_SERIAL_DATA 100 struct TRANS_DATA { UINT32 port0Data; /* 32b serial data port 0 */ UINT32 port1Data; /* 32b serial data port 1 */ }; struct TRANS_SERIAL_DATA_IN { UINT32 captureSerOn; /* Capture module return data in input FIFOs */ UINT32 streamLen[2], *streams; /* data sets to transmit */ }; /* Set DSPINT to start slave. */ #define START_SLAVE_EXECUTING (1 + (TRANS_SERIAL_DATA)) #define R_START_SLAVE_EXECUTING 104 struct START_SLAVE_EXECUTING_IN { UINT32 slaveNumber; UINT32 commOnOff; UINT32 slaveType; UINT32 timeoutInUsec; }; struct START_SLAVE_EXECUTING_OUT { UINT32 slaveNumber; }; /* commOnOff options */ #define SLV_DSP_COMM_OFF 0 #define SLV_DSP_COMM_ON 1 /* slaveType options */ #define SLV_DSP_UNCONFIGURED 0 #define SLAVE_CALIBRATE 1 #define SLAVE_MONITOR 2 #define SLAVE_ERROR_CHECK 3 #define SLAVE_MEMORY_TEST 4 /* Sets the parameters of the structure rodConfig.slvDspConfig[slvId]. */ #define CONFIG_SLAVE (1 + (START_SLAVE_EXECUTING)) #define R_CONFIG_SLAVE 102 struct CONFIG_SLAVE_IN { UINT32 slaveNumber; UINT32 commOnOff; UINT32 slaveType; }; /* parameters values are same as for START_SLAVE_EXECUTING */ /* * Reads or writes a field of a register in the master DSP memory map. * registerID: ID of the register being polled * offset: number of lsb in the field, starting with 0 * width: width of the field * mnemonic symbols for registerID, offset and width are in registerIndices.h * readNotWrite: 1 for read, 0 for write * dataIn: data to write for readNotWrite = 0; no significance for readNotWrite = 1 * dataOut: data read for readNotWrite = 1; no significance for readNotWrite = 0 */ #define RW_REG_FIELD (1 + (CONFIG_SLAVE)) #define R_RW_REG_FIELD 105 struct RW_REG_FIELD_IN { UINT32 registerID; UINT32 offset; UINT32 width; UINT32 readNotWrite; UINT32 dataIn; }; struct RW_REG_FIELD_OUT { UINT32 dataOut; }; /* * Polls a field of a register for a value. A timeout is available. * registerID: ID of the register being polled * offset: number of lsb in the field, starting with 0 * width: width of the field * mnemonic symbols for registerID, offset and width are in registerIndices.h * desiredValue: value of the defined field to poll for * timeoutInUsec: timeout period in microseconds * found: indicates whether 'desiredValue' was found within 'timeoutInUsec' */ #define POLL_REG_FIELD (1 + (RW_REG_FIELD)) #define R_POLL_REG_FIELD 105 struct POLL_REG_FIELD_IN { UINT32 registerID; UINT32 offset; UINT32 width; UINT32 desiredValue; UINT32 timeoutInUsec; }; struct POLL_REG_FIELD_OUT { UINT32 found; }; /* Reads/writes some number of words from/to one of the FIFOs on the ROD. * - fifoID: INPUT_MEM, DEBUG_MEM or EVENT_MEM * - bank: BANK_A, BANK_B or (EVENT_MEM only) BANK_C * - readNotWrite: 1 for read, 0 for write * - numElements: number of fifo entries to read or write; NOTE: no packing, eg * to write 20 elements to INPUT_MEM BANK_A requires 40 32b data words * to write 20 elements to EVENT_MEM BANK_C requires 20 32b data words * 20 elements read from EVENT_MEM BANK_C will occupy 20 32b data words * - *dataBaseAdr: for readNotWrite = 0 source address of data for the FIFO * = 1 destination address for data from the FIFO * if *dataBaseAdr = DEFAULT * readNotWrite = 0: data is supplied with the RW_FIFO primitive after *data * readNotWrite = 1: data is written to the reply message body after bytesXfrd * There is also a scratch space in SDRAM at SCRATCH_BASE (memoryPartitions.h) * - bytesXfrd: Number of bytes read or written */ #define RW_FIFO (1 + (POLL_REG_FIELD)) #define R_RW_FIFO 104 struct RW_FIFO_IN { UINT32 fifoId; UINT32 bank; UINT32 readNotWrite; UINT32 numElements; UINT32 *dataBaseAdr; /* DEFAULT value defined above */ }; struct RW_FIFO_OUT { UINT32 bytesXfrd; }; #define INPUT_MEM 0x0 /* values of fifoID */ #define DEBUG_MEM 0x1 #define EVENT_MEM 0x2 #define TIM_MEM 0x3 #define BANK_A 0x0 /* values of bank; ignored for TIM_MEM */ #define BANK_B 0x1 #define BANK_C 0x2 /* EVENT_MEM only */ /* * Send a primitive list to a slave DSP. * slaveNumber: ID of slave DSP to recieve the list. * listLength: number of 32 bit words in the list. * *slavePrimList: Address of start of source data for the list. * - *slavePrimList = DEFAULT indicates that the slave primitive list is stored in * the body of this SEND_SLAVE_LIST primtive starting just after the last * SEND_SLAVE_LIST_IN structure element. * *slaveRepData: Address where master should put slave reply data if the * START_SLAVE_LIST primitive is executed with getSlaveReply != 0. * - *slaveRepData = DEFAULT indicates that the slave reply list should be stored * in the body of a reply message to the START_SLAVE_LIST primtive. */ #define SEND_SLAVE_LIST (1 + (RW_FIFO)) #define R_SEND_SLAVE_LIST 103 struct SEND_SLAVE_LIST_IN { UINT32 slaveNumber; UINT32 listLength; UINT32 *slavePrimList; /* DEFAULT value defined above */ UINT32 *slaveRepData; /* DEFAULT value defined above */ }; /* * Start a slave DSP executing its primitive list by setting its inListRdy bit. * slaveNumber: ID of slave DSP to execute list * pauseMasterList != 0 if master DSP list execution pauses while slave executes list * getSlaveReply != 0 if the master should read the slave reply data */ #define START_SLAVE_LIST (1 + (SEND_SLAVE_LIST)) #define R_START_SLAVE_LIST 103 struct START_SLAVE_LIST_IN { UINT32 slaveNumber; UINT32 pauseMasterList; UINT32 getSlaveReply; }; /* pause, resume or abort a slave list */ #define SLAVE_LIST_OP (1 + (START_SLAVE_LIST)) #define R_SLAVE_LIST_OP 101 struct SLAVE_LIST_OP_IN { UINT32 slaveNumber; UINT32 listOp; }; #define LIST_PAUSE 0 #define LIST_RESUME 1 #define LIST_ABORT 2 /* Build & send a command stream to the detector electronics. sendData will ship a command stream back to the VME host. */ #define BUILD_STREAM (1 + (SLAVE_LIST_OP)) #define R_BUILD_STREAM 102 struct BUILD_STREAM_IN { struct CmdList cmdList; UINT32 port, reset, chip, fibre; UINT32 dataLen; /* Length of the extra data, in bits. */ UINT32 *data; /* Start of the data for a command with large amounts of data (masks & some pixel commands). */ }; #define SEND_STREAM (1 + (BUILD_STREAM)) #define R_SEND_STREAM 100 struct SEND_STREAM_IN { UINT32 port, captureSerOn; }; #define DSP_RESET (1 + (SEND_STREAM)) #define R_DSP_RESET 100 struct DSP_RESET_IN { UINT32 slvBits, forceSync, nAttempts, timeOut; }; #define SET_ROD_MODE (1 + (DSP_RESET)) #define R_SET_ROD_MODE 100 struct SET_ROD_MODE_IN { UINT32 mode, flag, dataLen, *data; }; #define RW_BOC_DATA (1 + (SET_ROD_MODE)) #define R_RW_BOC_DATA 100 struct RW_BOC_DATA_IN { UINT32 read, sendToBoc, dataLen, *data; }; struct RW_BOC_DATA_OUT { BOCConfig bocCfgData; }; #define BOC_HISTOGRAM (1 + (RW_BOC_DATA)) #define R_BOC_HISTOGRAM 100 struct BOC_HISTOGRAM_IN { UINT32 numSamples, numLoops; }; struct BOC_HISTOGRAM_OUT { UINT32 histo[96][2]; }; #define WRITE_FLASH (1 + (BOC_HISTOGRAM)) #define R_WRITE_FLASH 100 typedef struct { void *buffPtr; UINT32 offset, length; /* effective address = &flash[offset] */ } WriteFlashIn; #define LAST_MASTER_PRIMITIVE (WRITE_FLASH) #define NUM_MASTER_PRIMITIVES ((LAST_MASTER_PRIMITIVE)-(MASTER_PRIMITIVES_BASE)+1) #if defined(I_AM_HOST) #if defined(SCT_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_SLAVE_PRIMITIVES) \ +(NUM_MASTER_PRIMITIVES) \ +(NUM_COMMON_SCT_PRIMITIVES) \ +(NUM_SLAVE_SCT_PRIMITIVES) \ +(NUM_MASTER_SCT_PRIMITIVES) ) #elif defined(PIXEL_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_SLAVE_PRIMITIVES) \ +(NUM_MASTER_PRIMITIVES) \ +(NUM_COMMON_PIXEL_PRIMITIVES) \ +(NUM_SLAVE_PIXEL_PRIMITIVES) \ +(NUM_MASTER_PIXEL_PRIMITIVES) ) #endif #elif defined(I_AM_MASTER_DSP) #if defined(SCT_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_MASTER_PRIMITIVES) \ +(NUM_COMMON_SCT_PRIMITIVES) \ +(NUM_MASTER_SCT_PRIMITIVES) ) #elif defined(PIXEL_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_MASTER_PRIMITIVES) \ +(NUM_COMMON_PIXEL_PRIMITIVES) \ +(NUM_MASTER_PIXEL_PRIMITIVES) ) #endif #elif defined(I_AM_SLAVE_DSP) #if defined(SCT_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_SLAVE_PRIMITIVES) \ +(NUM_COMMON_SCT_PRIMITIVES) \ +(NUM_SLAVE_SCT_PRIMITIVES) ) #elif defined(PIXEL_ROD) #define NUM_PRIMITIVES ( (NUM_COMMON_PRIMITIVES) \ +(NUM_SLAVE_PRIMITIVES) \ +(NUM_COMMON_PIXEL_PRIMITIVES) \ +(NUM_SLAVE_PIXEL_PRIMITIVES) ) #endif #endif /************************************************************************************ * Primitive function prototypes (not needed by the host processor). ************************************************************************************/ #if (defined(I_AM_MASTER_DSP) || defined(I_AM_SLAVE_DSP)) INT32 noPrimitive(PrimData *); INT32 echo(PrimData *); INT32 setErrMsgMask(PrimData *); INT32 pauseList(PrimData *); INT32 eventTrapSetup(PrimData *); INT32 setMemory(PrimData *); INT32 copyMemory(PrimData *); INT32 memoryTest(PrimData *); INT32 setLed(PrimData *); INT32 flashLed(PrimData *); INT32 sendData(PrimData *); INT32 moduleMask(PrimData *); INT32 setTrigger(PrimData *); INT32 startTask(PrimData *); INT32 taskOperation(PrimData *); INT32 setBin(PrimData *); INT32 writeBuffer(PrimData *); INT32 startEventTrapping(PrimData *); INT32 stopEventTrapping(PrimData *); INT32 rwSlaveMemory(PrimData *); INT32 transSerialData (PrimData *); INT32 startSlaveExecuting(PrimData *); INT32 configSlave(PrimData *); INT32 rwRegField(PrimData *); INT32 pollRegField(PrimData *); INT32 rwFifo(PrimData *); INT32 sendSlaveList(PrimData *); INT32 startSlaveList(PrimData *); INT32 slaveListOp(PrimData *); INT32 buildStream(PrimData *); INT32 sendStream(PrimData *); INT32 dspReset(PrimData *); INT32 setRodMode(PrimData *); INT32 rwBocData(PrimData *); INT32 bocHistogram(PrimData *primData); /* INT32 configBoc(PrimData *); */ INT32 writeFlash(PrimData *); #endif /* primitive parameters definition block */ #endif