/************************************************************************************ * 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 111 /* 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 enum { ECHO= COMMON_PRIMITIVES_BASE, SET_MESSAGE_MASK, PAUSE_LIST, EVENT_TRAP_SETUP, SET_MEMORY, COPY_MEMORY, MEMORY_TEST, SET_LED, FLASH_LED, SEND_DATA, MODULE_MASK, SET_TRIGGER, START_TASK, TASK_OPERATION, #ifndef NEWDEF TEST, #else ZEN_PRIM, #endif WRITE_BUFFER, //SET_BIN, LAST_COMMON_PRIMITIVE }; #define NUM_COMMON_PRIMITIVES ((LAST_COMMON_PRIMITIVE)-(COMMON_PRIMITIVES_BASE)) /* Echo the primitive message body back in the reply message body. Echo's input and output data is unstructured. */ #define R_ECHO 100 /* Set message level mask - levels which are masked will not write a message to the text buffer. */ #define R_SET_MESSAGE_MASK 100 struct SET_ERRMSG_MASK_IN { UINT32 messageMask; }; /* Pause the execution of the primitive list. List execution will resume when the RESUME bit is set in the command register. */ #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. The primitive is common to MDSP & SDSPs- however eventTrapSetup is intended to be a HOST to MASTER DSP primitive only; the MDSP then sets up the router registers and passes a primitive list to call eventTrapSetup on the SDSP(s). 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 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 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 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 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 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 R_FLASH_LED 103 struct FLASH_LED_IN { UINT32 ledNum, period, numTimes; }; /* Retrieve data, or a pointer to it, from the DSP */ #define R_SEND_DATA 103 struct SEND_DATA_IN { UINT32 dataType, auxVal, repBufferFlag, timeout; }; struct SEND_DATA_OUT { void *dataPtr; UINT32 dataLength; }; #define REPLY_POINTER 0 #define REPLY_DIRECT_DATA 1 #define MAP_DATA 0x00 #define PRIMITIVE_DATA 0x01 #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 #define BIN_DATA 0x24 /* 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 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, dataLine[4]; 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 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 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 #if defined(SCT_ROD) struct XPair { FLOAT32 x0, delta_x; }; struct RangeList { struct XPair xPair[5]; }; struct HISTOGRAM_CTRL_TASK_IN { UINT8 slvBits, port, configRegister[2]; UINT8 configSctSet, dataSet; UINT8 groupRangeMap[2]; UINT8 groupDSPMap[4]; UINT8 groupSPMap[2]; UINT8 globalCtrl, syncLevel; UINT32 *histoBase; UINT8 doChipOcc, dataFormat, binSize, unused1; UINT8 extSetup, dataPath, capture, useRangeList /* unused2 */; UINT32 repetitions, nBins, bin0; struct RangeList rangeList[2]; FLOAT32 *dataPtr[2]; struct CmdList triggerSequence[2]; UINT8 incCmd[2]; UINT8 calLineLoop; UINT8 distributionToggle; UINT32 incData[2]; UINT32 genData[10]; }; struct HISTO_CTRL_TASK_IN { ScanControl scanControl; }; #elif defined(PIXEL_ROD) struct HISTOGRAM_CTRL_TASK_IN { ScanControl scanControl; }; #endif #define MODULE_BASIC 0 #define MODULE_TRIM 1 #define MODULE_ALL 2 #define EXT_SETUP_NONE 0 #define EXT_SETUP_RCF 1 #define EXT_SETUP_ROUTER 2 #define EXT_SETUP_SET 4 #define EXT_SETUP_HISTO 8 #define EXT_SETUP_HTASK 16 #define DATA_PATH_NORMAL 0 #define DATA_PATH_INMEM 1 #define MODULE_GROUP 0 #define ROUTER_DISTRIB 1 #define SYNC_NEWBIN 0 #define SYNC_TOTAL 1 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 0x80008000 #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 { void *dataPtr; UINT32 dataLength; }; union TASK_STRUCTURES_OUT { #if 1 struct HISTOGRAM_CTRL_TASK_OUT histoCtrlTaskOut; struct HISTOGRAM_TASK_OUT histogramTaskOut; struct TRAP_TASK_OUT trapTaskOut; struct ERROR_TASK_OUT errorTaskOut; #endif 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 SLAVE_TASK_BASE (0x20) enum { HISTOGRAM_CTRL_TASK= MASTER_TASK_BASE, MIRROR_TASK, TRAP_REQ_TASK, HISTOGRAM_TASK= SLAVE_TASK_BASE, TRAP_TASK, OCCUPANCY_TASK, ERROR_TASK, RESYNCH_TASK }; #define ALL_SLAVESX 5 #define LAST_MASTER_TASK (TRAP_REQ_TASK) #define NUM_MASTER_TASKS ((LAST_MASTER_TASK)-(MASTER_TASK_BASE)+1) #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 HISTO_CTRL_TASK_IN scanCtrlIn; //dpsf: temp- allow new or old struct. 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; }; /* Perform operations such as stop, pause etc. on a running 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 R_WRITE_BUFFER 101 struct WRITE_BUFFER_IN { UINT32 buffer; char string[2396]; }; #define WRITE_BUFFER_ERR 0 #define WRITE_BUFFER_INFO 1 #define WRITE_BUFFER_DIAG 2 #define WRITE_BUFFER_XFER 3 #define R_SET_BIN 100 typedef struct { #if defined(I_AM_MASTER_DSP) UINT32 slvBits; #endif UINT32 bin; } SetBinIn; /************************************************************************************ * Slave DSP primitives go here. ************************************************************************************/ #define SLAVE_PRIMITIVES_BASE 0x1000 #ifndef NEWDEF enum { START_EVENT_TRAPPING= SLAVE_PRIMITIVES_BASE, STOP_EVENT_TRAPPING, HISTOGRAM_SETUP, //FIT_HISTOGRAMS LAST_SLAVE_PRIMITIVE }; #else enum { START_EVENT_TRAPPING= SLAVE_PRIMITIVES_BASE, STOP_EVENT_TRAPPING, LAST_SLAVE_PRIMITIVE }; #endif #define NUM_SLAVE_PRIMITIVES ((LAST_SLAVE_PRIMITIVE)-(SLAVE_PRIMITIVES_BASE)) #define R_START_EVENT_TRAPPING 101 #define R_STOP_EVENT_TRAPPING 100 /************************************************************************************ * Master DSP primitives go here. ************************************************************************************/ #define MASTER_PRIMITIVES_BASE 0x2000 enum { RW_SLAVE_MEMORY= MASTER_PRIMITIVES_BASE, TRANS_SERIAL_DATA, START_SLAVE_EXECUTING, CONFIG_SLAVE, RW_REG_FIELD, POLL_REG_FIELD, RW_FIFO, SEND_SLAVE_LIST, START_SLAVE_LIST, SLAVE_LIST_OP, BUILD_STREAM, SEND_STREAM, #ifndef NEWDEF RW_MODULE_DATA, SEND_CONFIG, #endif DSP_RESET, SET_ROD_MODE, #ifndef NEWDEF RW_MODULE_VARIABLE, #endif RW_BOC_DATA, BOC_HISTOGRAM, WRITE_FLASH, LAST_MASTER_PRIMITIVE }; #define NUM_MASTER_PRIMITIVES ((LAST_MASTER_PRIMITIVE)-(MASTER_PRIMITIVES_BASE)) /* Read or write a block of SDSP memory. The structure is the same for input & output */ #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 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 SDSP. */ #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 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 fRead: TRUE for read, FALSE for write dataIn: data to write for fRead= FALSE; no significance for fRead= TRUE dataOut: data read for fRead= TRUE; no significance for fRead= FALSE */ #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 the timed period. */ #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 - fRead: TRUE for read, FALSE 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: source/destination address of data for/from the FIFO if *dataBaseAdr = DEFAULT fRead = FALSE: data is supplied with the RW_FIFO primitive after *data fRead = TRUE: 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 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 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= TRUE if master DSP list execution pauses while slave executes list getSlaveReply= TRUE if the master should read the slave reply data. */ #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 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 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 R_SEND_STREAM 100 struct SEND_STREAM_IN { UINT32 port, captureSerOn; }; #define R_DSP_RESET 100 struct DSP_RESET_IN { UINT32 slvBits, forceSync, nAttempts, timeOut; }; #define R_SET_ROD_MODE 101 struct SET_ROD_MODE_IN { UINT32 mode, flag, fifoSetup, nBits, delay, evtsPerL1A, message; }; #define R_RW_BOC_DATA 100 struct RW_BOC_DATA_IN { UINT32 read, sendToBoc, dataLen, *data; }; struct RW_BOC_DATA_OUT { BOCConfig bocCfgData; }; #define R_BOC_HISTOGRAM 100 struct BOC_HISTOGRAM_IN { UINT32 numSamples, numLoops; }; struct BOC_HISTOGRAM_OUT { UINT32 histo[96][2]; }; #define R_WRITE_FLASH 100 typedef struct { void *buffPtr; UINT32 offset, length; /* effective address = &flash[offset] */ } WriteFlashIn; #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 #include "convertParams.h" /************************************************************************************ * 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 setMessageMask(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 *); /* INT32 configBoc(PrimData *); */ INT32 writeFlash(PrimData *); #endif /* primitive parameters definition block */ #endif /* Multiple inclusion protection */