#include "svtvme_public.h" #include "svtvme_private.h" /**************************************************************************/ /********** First public user callable functions *************************/ /**************************************************************************/ int svtvme_setGlobalFlag(char *flag, int *value) { int status=0; if (!strcmp,flag,"Verbose") svtvmeVerboseLevel = *value; else if (!strcmp,flag,"ErrorReport") svtvmeErrorReportLevel = *value; else status=-1; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_getGlobalFlag(char *flag, int *value) { int status=0; if (!strcmp,flag,"Verbose") *value = svtvmeVerboseLevel; else if (!strcmp,flag,"ErrorReport") *value = svtvmeErrorReportLevel; else status=-1; return (status); } /*-------------------------------------------------------------------------*/ svtvme_t *svtvme_openBoard(char *crate, int slot, int boardType) { int i; int FIFO_value; /* create fision slave handle */ svtvme_t *b = 0; b = malloc(sizeof(*b)); memset(b, 0, sizeof(*b)); if (crate!=0) { int status; char vision_comp[80]; sprintf(vision_comp, "geo32:/slot=%d", slot); status += VISIONopen(&b->vs, vision_comp, crate); status += VISIONconfig(b->vs, "transferType", "best", sizeof("best")); status += VISIONconfig(b->vs, "transferProtocol", "auto", sizeof("auto")); FIFO_value = 0; status += VISIONconfig(b->vs, "FIFO", &FIFO_value, sizeof(FIFO_value)); status += VISIONopen(&b->vsfifo, vision_comp, crate); status += VISIONconfig(b->vsfifo, "transferType", "pio", sizeof("pio")); status += VISIONconfig(b->vsfifo, "transferProtocol", "single", sizeof("single")); FIFO_value = 1; status += VISIONconfig(b->vsfifo, "FIFO", &FIFO_value, sizeof(FIFO_value)); } /* initialise all svtvme internals for this board type */ svtvme_initialise_board(boardType); /* fill board description structure for this board handle*/ b->protect = 0; b->lock = 0; b->debug = 0; b->fpdebug = stderr; b->boardType = boardType; /* pointer to board description structure */ for (i=0; isvtvmeboard=svtvme_boards[i]; } return b; } /*-------------------------------------------------------------------------*/ int svtvme_closeBoard(svtvme_t *board) { if (board->vs) VISIONclose(board->vs); if (board->vsfifo) VISIONclose(board->vsfifo); memset(board, 0, sizeof(*board)); free(board); return (0); } /*-------------------------------------------------------------------------*/ int svtvme_setBoardFlag(svtvme_t *board, char *flag, int *value) { int status=0; if (!strcmp,flag,"Protect") board->protect = *value; else if (!strcmp,flag,"Locked") board->lock = *value; else if (!strcmp,flag,"Debug") board->debug = *value; else status=-1; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_setBoardDebugFile(svtvme_t *board, FILE *file) { int status=0; board->fpdebug = file; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_getBoardFlag(svtvme_t *board, char *flag, int *value) { int status=0; if (!strcmp,flag,"Protect") *value = board->protect; else if (!strcmp,flag,"Locked") *value = board->lock; else if (!strcmp,flag,"Debug") *value = board->debug; else status=-1; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_getState(svtvme_t *board, int objId, uint4 *state) { svtvme_object *object; int status, XfBytes; uint4 value; uint4 addr, mask; int shift; object = SVTVME_OBJS[objId]; addr =object->addr; mask =object->mask; shift=object->shift; status = VISIONread(board->vs, addr, sizeof(uint4), &XfBytes, &value); if (status && board->fpdebug) { char info[100]; VISIONinfo(board->vs, "name", (void *) info, sizeof(info)-1); fprintf(board->fpdebug, "readword addr %lx, opened as %s\n", addr, info); fprintf(board->fpdebug, "status = %d\n", status); } value = (value>>shift) & mask; if (object->revert) value = (!value) & mask; *state = value; return status<0 ? status : -status; } /*-------------------------------------------------------------------------*/ int svtvme_setState(svtvme_t *board, int objId, uint4 *state) { svtvme_object *object; int status, XfBytes; uint4 value; uint4 addr, mask; int shift; object = SVTVME_OBJS[objId]; addr =object->addr; mask =object->mask; shift=object->shift; value = ((*state)&mask)<vs, addr, sizeof(uint4), &XfBytes, &value); if (status && board->fpdebug) { char info[100]; VISIONinfo(board->vs, "name", (void *) info, sizeof(info)-1); fprintf(board->fpdebug, "readword addr %lx, opened as %s\n", addr, info); fprintf(board->fpdebug, "status = %d\n", status); } return status<0 ? status : -status; } /*-------------------------------------------------------------------------*/ int svtvme_checkState(svtvme_t *board, int objId, uint4 *state) { int rs, status; uint4 readValue; rs = svtvme_getState(board, objId, &readValue); if (readValue == *state) status =1; else status =0; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_isEmpty(svtvme_t *board, int fifoId) { /* returns 1 if the given fifo is empty, 0 otherwise */ int status; int emptyReg; svtvme_fifo *fifo; uint4 value; fifo = SVTVME_FIFOS[fifoId]; /* fifo description structure */ emptyReg = fifo->emptyRegId; /* objectId for the empty flag */ status = svtvme_getState(board, emptyReg, &value); /* read the flag */ if (status>=0) status = (int)value; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_isLast(int fifoId, uint4 word) { /* true (=1) if the gicen word was read from an empty fifo */ /* check wether the given word was read toghether with an Empyt Fifo */ /* flag from the given fifo. Only works for boards that report the EF */ /* flag status when the fifo is read */ int status=0; svtvme_fifo *fifo; svtvme_board *board; int boardType; uint4 bit31=0x80000000; uint4 bit23=0x800000; fifo = SVTVME_FIFOS[fifoId]; board = fifo->board; boardType = board->id; switch(boardType) { case SVTVME_AMS: if ((word&bit31)==0) status=1; break; case SVTVME_HB: if ((word&bit31)==0) status=1; break; case SVTVME_MRG: if ((word&bit31)==0) status=1; break; case SVTVME_TF: if ((word&bit23)==0) status=1; break; default: status=-1; break; } return (status); } /*-------------------------------------------------------------------------*/ int svtvme_spyCounter(svtvme_t *board, int spyId) { int status=0; int counterReg; svtvme_spy *spy; uint4 value; spy = SVTVME_SPYS[spyId]; /* spy description structure */ counterReg = spy->counterRegId; /* objectId for the counter register */ status = svtvme_getState(board, counterReg, &value); /* read the flag */ if (status>=0) status = (int)value; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_isFrozen(svtvme_t *board, int spyId) { /* returns 1 if the given spy buffer is frozen, 0 otherwise */ int status; int freezeReg; svtvme_spy *spy; uint4 value; spy = SVTVME_SPYS[spyId]; /* spy description structure */ freezeReg = spy->freezeRegId; /* objectId for the freeze flag */ status = svtvme_getState(board, freezeReg, &value); /* read the flag */ if (status>=0) status = value; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_isWrapped(svtvme_t *board, int spyId) { /* returns 1 if the given spy buffer wrapped around, 0 otherwise */ int status; int wrapReg; svtvme_spy *spy; uint4 value; spy = SVTVME_SPYS[spyId]; /* spy description structure */ wrapReg = spy->wrappedRegId; /* objectId for the wrap flag */ status = svtvme_getState(board, wrapReg, &value); /* read the flag */ if (status>=0) status = value; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_readMemoryFragment(svtvme_t *board, int memId, uint4 offset, int nw, uint4 *data) { int status; uint4 XfBytes; svtvme_ram *ram; uint4 addr, mask; int shift,length; /* local values of arguments in case we have to "align" */ uint4 localOffset; int lNw; /* offset into the data array */ int dataOffset; /* stuff needed for reading the RAM in bunches of 128k */ unsigned int RunningOffset; unsigned int req_bytes; int nXfer, rest, i; const int wordsInBunch = 128*1024; const int bytesInBunch = sizeof(uint4) * wordsInBunch; if (nw<=0) return (0); localOffset = offset * sizeof(uint4); lNw = nw; dataOffset=0; ram = SVTVME_RAMS[memId]; addr = ram->addr; mask = ram->mask; shift = ram->shift; length = ram->length; /* check that required words are not too many */ if ((offset+nw)>length) return (-1); /* if offset is not aligned on an 8-bit boundary dma will fail */ /* so in this case read first word and adjust to read nw-1 words */ if (offset&0x1) { status=VISIONread(board->vs, addr+localOffset, sizeof(uint4), &XfBytes, data); localOffset = localOffset + sizeof(uint4); dataOffset=1; lNw = nw-1; } /* read the memory not more then 128Kwords at a time */ req_bytes = lNw * sizeof(uint4); nXfer = (int)req_bytes / (bytesInBunch); rest = (int)req_bytes % (bytesInBunch); for (i=0; ivs, RunningOffset, bytesInBunch, &XfBytes, data+dataOffset); dataOffset += wordsInBunch; if (status) return (status); } if (rest != 0) { RunningOffset = addr + localOffset + i* bytesInBunch; status= VISIONread (board->vs, RunningOffset, rest, &XfBytes, data+dataOffset); if (status) return (status); } /* apply shift and mask */ for (i=0;i>shift)&mask; return status; } /*-------------------------------------------------------------------------*/ int svtvme_writeMemoryFragment(svtvme_t *board, int memId, uint4 offset, int nw, uint4 *data) { int status; uint4 XfBytes; svtvme_ram *ram; uint4 addr, mask; int shift,length; /* local opy of data for shift/mask */ uint4 * lData; /* local values of arguments in case we have to "align" */ uint4 localOffset; int lNw; /* offset into the data array */ int dataOffset; /* stuff needed for reading the RAM in bunches of 128k */ unsigned int RunningOffset; unsigned int req_bytes; int nXfer, rest, i; const int wordsInBunch = 128*1024; const int bytesInBunch = sizeof(unsigned int) * wordsInBunch; if (nw<=0) return(0); localOffset = offset * sizeof(uint4); lNw = nw; dataOffset=0; assert(lData=malloc(nw*sizeof(uint4))); ram = SVTVME_RAMS[memId]; addr = ram->addr; mask = ram->mask; shift = ram->shift; length = ram->length; /* check that required words are not too many */ if ((offset+nw)>length) return (-1); /* apply shift and mask only if needed */ if (shift || mask) for (i=0;i>shift)&mask; else {free(lData); lData=data;} /* if offset is not aligned on an 8-bit boundary dma will fail */ /* so in this case write first word and adjust to write nw-1 words */ if (offset&0x1) { status=VISIONwrite(board->vs, addr+localOffset, sizeof(uint4), &XfBytes, lData); localOffset = localOffset + sizeof(uint4); dataOffset=1; lNw = nw-1; } /* write the memory not more then 128Kwords at a time */ req_bytes = lNw * sizeof(uint4); nXfer = (int)req_bytes / (bytesInBunch); rest = (int)req_bytes % (bytesInBunch); for (i=0; ivs, RunningOffset, bytesInBunch, &XfBytes, lData+dataOffset); dataOffset += wordsInBunch; } if (rest != 0) { RunningOffset = addr + localOffset + i* bytesInBunch; status= VISIONwrite (board->vs, RunningOffset, rest, &XfBytes, lData+dataOffset); } if (lData!=data) free(lData); return status; } /*-------------------------------------------------------------------------*/ int svtvme_readMemory(svtvme_t *board, int memId, int ndata, uint4 *data) { int status; svtvme_ram *ram; int length; ram = SVTVME_RAMS[memId]; length = ram->length; if (ndata length; if (ndata length; if (ndata mask; shift=object->shift; nbits=object->nbits; if (object->readFlag==SVTVME_NEVER || object->writeFlag==SVTVME_NEVER) { printf("can't test r/o or w/o register!\n"); return (-1); } ok =1; /* fill with 0 */ wdata = 0; status = svtvme_setState(board, objId, &wdata); ok &= svtvme_checkState(board, objId, &wdata); /* fill with 1 */ wdata = mask<mask; length = ram->length; if (ram->readFlag==SVTVME_NEVER || ram->writeFlag==SVTVME_NEVER) { printf("can't test r/o or w/o memory!\n"); return (-1); } assert (tdata=malloc(length*sizeof(uint4))); ok=1; *nerr=0; if (svtvmeVerboseLevel==1) printf("Testing %s : ",ram->longName); for (n=0; n0) & !ok) break; } if (svtvmeVerboseLevel==1) printf("\n"); free(tdata); return ok; } /*-------------------------------------------------------------------------*/ uint4 svtvme_rand(uint4 mask) { /* returns random unsigned long with as many bits as are in mask*/ uint4 word = mask; float r; r = ((float)word*rand()/(RAND_MAX+1.0)); return (uint4)r; } /*-------------------------------------------------------------------------*/ int svtvme_testIDPROM(svtvme_t *board) { int status, ok; int boardId; ok=1; boardId = board->boardType; if ( (boardId == SVTVME_AMB) || (boardId == SVTVME_AMS) || (boardId == SVTVME_MRG) || (boardId == SVTVME_HB) || (boardId == SVTVME_SC) || (boardId == SVTVME_XTFA) || (boardId == SVTVME_XTFC) ) { if (svtvmeVerboseLevel) printf("test IdProm for %s board against Franco's pattern\n", board->svtvmeboard->longName); ok = svtvme_test64kProm(board); } else { printf("nothing to test a board of %s type\n", board->svtvmeboard->longName); } return (ok); } /*-------------------------------------------------------------------------*/ /* test 64K eprom for standard pattern as defined by Franco, i.e. a PROM that is made like HB's one */ int svtvme_test64kProm(svtvme_t *board) { uint4 *idprom; int num_word; int i,j; int FoundTerm; int PreTerm; int JustFound; int refprom; int repeat0; int error; int status; char text[81]; text[0]=0; num_word=64*1024; assert(idprom=malloc(num_word*sizeof(uint4))); status = svtvme_readMemory(board,HB_IDPROM,num_word,idprom); if (status != 0) if (svtvmeVerboseLevel) printf("VME error. ID Prom read with status %d\n\n", status); FoundTerm = 0; PreTerm=0; j = 0; refprom = 0; repeat0 = 1; error=0; for (i=0; iaddr; mask = fifo->mask; shift = fifo->shift; status=VISIONread(board->vsfifo, addr, nw*sizeof(uint4), &XfBytes, data); /* apply shift and mask */ for (i=0;i>shift)&mask; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_readAllFifo(svtvme_t *board, int fifoId, int maxWords, uint4 *data, int *moreData) /* reads the given Fifo until it is empty. At most maxWords are read * returns as function value the number of read words or an error * code as a negative value. * Works as foolow: * 1) checks if FIFO is empty => exit 2) if not empty * reads in blocks of blockSize words for each transfer, if the last * word has the empty bit set examines in decreasing order all words * until the last is found All words after last are filled with zeros. * if the last word doesn't have the empty bit set, reads again * blockSize words until maxWords is reached or fifo is emptied */ { int status=0; uint4 XfBytes; svtvme_fifo *fifo; uint4 addr, mask; int shift; int i,j, notValid; int empty; int nBlock=0; uint4 data0, data1; int data0_nv, data1_nv; int stop=0, blockSize=64, wordsRead=0; if (maxWords<=0) return (0); empty = svtvme_isEmpty(board, fifoId); *moreData=!empty; if (empty) return (0); fifo = SVTVME_FIFOS[fifoId]; addr = fifo->addr; mask = fifo->mask; shift = fifo->shift; do { if ((wordsRead + blockSize) > maxWords) blockSize = maxWords - wordsRead; status = - VISIONread (board->vsfifo, addr, blockSize * sizeof(uint4), &XfBytes, (data + (nBlock*blockSize))); if (status != 0) return status; /* A VME error occured */ if (svtvme_isLast(fifoId,data[((nBlock+1) * blockSize) - 1])) { stop = 1; /* last word in block is from empty fifo */ /* search for last valid word in this block */ j = 0; /* running index from end of block to last valid word */ notValid=0; /* number of unvalid words at the end of the block */ do { data0 = data[((nBlock+1)*blockSize) - 1 - j]; data1 = data[((nBlock+1)*blockSize) - 1 - j - 1]; data0_nv = svtvme_isLast(fifoId, data0); data1_nv = svtvme_isLast(fifoId, data1); if (data0_nv && data1_nv && (j!= blockSize-1)) { data[((nBlock+1) * blockSize) - 1 - j] = 0; notValid++; } j++; } while ( data0_nv && data1_nv && (j!=blockSize) ); } nBlock++; wordsRead += (blockSize - notValid); status = wordsRead; } while ((stop != 1) && (wordsRead < maxWords)); *moreData = (~stop)&1; /* apply shift and mask */ for (i=0;i>shift)&mask; return (status); } /*-------------------------------------------------------------------------*/ int svtvme_deltaSpy(int spyId, uint4 end, uint4 start) /* computes the number of words between two values of the spy buffer */ /* counter, keeping into account counter wrapping at spy max length */ { int status; int delta; svtvme_spy *spy; spy = SVTVME_SPYS[spyId]; delta = (int)end - (int)start; if (delta < 0) delta = spy->ram->length - start + end; return delta; } /*-------------------------------------------------------------------------*/ int svtvme_readSpyTail(svtvme_t *board, int spyId, int nw, uint4 *data) { /* reads the last nw words stored in the spy buffer, handles the * case of wrapped pointer. If there are not enough words, an error * is returned. Return as value the number of read words. */ int status=0; svtvme_spy *spy; int length; int pointer; int offset; int nTop; spy = SVTVME_SPYS[spyId]; length = spy->ram->length; pointer = svtvme_spyCounter(board, spyId); if (pointer>=nw) { offset= pointer-nw; status = svtvme_readMemoryFragment(board, spy->ramId, offset, nw, data); if (status >=0) status=nw; } else { if (nw>length) return (-666666); if (!svtvme_isWrapped(board, spyId)) return (-666666); nTop = nw - pointer; offset = length - nTop + 1; status = svtvme_readMemoryFragment(board, spy->ramId, offset, nTop, data); if (status>=0) status = svtvme_readMemoryFragment(board, spy->ramId, 0, pointer, data+nTop); if (status>=0) status=nw; } return (status); } /*-------------------------------------------------------------------------*/ int svtvme_readAllSpy(svtvme_t *board, int spyId, int ndata, uint4 *data) { int status=0; svtvme_spy *spy; int length; int pointer; int offset; int nw, nTop; spy = SVTVME_SPYS[spyId]; length = spy->ram->length; if (ndata < length) return (-6666); pointer = svtvme_spyCounter(board, spyId); if (pointer==0) return (0); if (!svtvme_isWrapped(board, spyId)) { status = svtvme_readMemoryFragment(board, spy->ramId, 0, pointer, data); if (status>=0) status=pointer; } else { nTop = length - pointer; status = svtvme_readMemoryFragment(board, spy->ramId, pointer, nTop, data); if (status>=0) status = svtvme_readMemoryFragment(board, spy->ramId, 0, pointer, data+nTop); if (status>=0) status=length; } return (status); } /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /**************************************************************************/ /********** Now internal functions for structure handling *****************/ /**************************************************************************/ int svtvme_print_board_definitions(int boardType) { int i, s; for (i=0; inobj == 100) return (-1); /* get a new object id */ objId=svtvmeNumObjects++;; /* allocate memeory for the new object */ assert( obj=malloc(sizeof(*obj))); /*Bill's trick to malloc structure*/ /* fill the object's structure */ obj->id = objId; strcpy(obj->longName,lname); strcpy(obj->shortName,sname); obj->addr = addr; obj->mask = mask; obj->shift = shift; obj->nbits = nbits; obj->readFlag =rFlag; obj->writeFlag=wFlag; obj->accessFlag=accFlag; obj->revert=revert; obj->board = board; /* record object's pointer in global list */ SVTVME_OBJS[objId] = obj; /* update parent board structure with new object data */ board->objs[board->nobj]=obj; board->nobj++; return objId; } /*-------------------------------------------------------------------------*/ /* create and fill structure for one svtvme memory */ /* memory lenght must be passed in number of words !! */ int svtvme_create_ram(svtvme_board *board, char *lname, char *sname, uint4 addr, uint4 mask, uint4 shift, int length, int rFlag, int wFlag, int accFlag) { int ramId; svtvme_ram *ram=0; /*part of Bill's trick to malloc a structure*/ if (svtvmeNumRams == svtvmeMaxRams) return (-1); if (board->nram == 20) return (-1); /* get a new ram id */ ramId=svtvmeNumRams++;; /* allocate memeory for the new ram */ assert( ram=malloc(sizeof(*ram))); /*Bill's trick to malloc structure*/ /* fill the ram's structure */ ram->id = ramId; strcpy(ram->longName,lname); strcpy(ram->shortName,sname); ram->addr = addr; ram->mask = mask; ram->shift = shift; ram->length = length; ram->readFlag =rFlag; ram->writeFlag=wFlag; ram->accessFlag=accFlag; ram->board = board; /* record ram's pointer in global list */ SVTVME_RAMS[ramId] = ram; /* update parent board structure with new ram data */ board->rams[board->nram]=ram; board->nram++; return ramId; } /*-------------------------------------------------------------------------*/ /* create and fill structure for one svtvme spy buffer */ /* memory lenght must be passed in number of words !! */ int svtvme_create_spy(svtvme_board *board, char *lname, char *sname, uint4 addr, uint4 mask, uint4 shift, int length, int rFlag, int wFlag, int accFlag, int cntReg, int frzReg, int wrpReg) { int spyId; int ramId; svtvme_spy *spy=0; /*part of Bill's trick to malloc a structure*/ if (svtvmeNumSpys == svtvmeMaxSpys) return (-1); if (board->nspy == 10) return (-1); /* get a new spy id */ spyId=svtvmeNumSpys++;; /* allocate memeory for the new spy */ assert( spy=malloc(sizeof(*spy))); /*Bill's trick to malloc structure*/ /* fill the spy's structure */ spy->id = spyId; spy->counterRegId=cntReg; spy->freezeRegId=frzReg; spy->wrappedRegId=wrpReg; ramId=svtvme_create_ram(board, lname, sname, addr, mask, shift, length, rFlag, wFlag, accFlag); spy->ramId = ramId; spy->ram = SVTVME_RAMS[ramId]; /* strcpy(spy->longName,lname); strcpy(spy->shortName,sname); spy->addr = addr; spy->mask = mask; spy->shift = shift; spy->length = length; spy->readFlag =rFlag; spy->writeFlag=wFlag; spy->accessFlag=accFlag; spy->board = board; */ /* record spy's pointer in global list */ SVTVME_SPYS[spyId] = spy; /* update parent board structure with new spy data */ board->spys[board->nspy]=spy; board->nspy++; return spyId; } /*-------------------------------------------------------------------------*/ /* create and fill structure for one svtvem FIFO */ /* memory lenght must be passed in number of words !! */ int svtvme_create_fifo(svtvme_board *board, char *lname, char *sname, uint4 addr, uint4 mask, uint4 shift, int length, int rFlag, int accFlag, int emptyReg) { int fifoId; svtvme_fifo *fifo=0; /*part of Bill's trick to malloc a structure*/ if (svtvmeNumFifos == svtvmeMaxFifos) return (-1); if (board->nfifo == 10) return (-1); /* get a new fifo id */ fifoId=svtvmeNumFifos++;; /* allocate memeory for the new fifo */ assert( fifo=malloc(sizeof(*fifo))); /*Bill's trick to malloc structure*/ /* fill the fifo's structure */ fifo->id = fifoId; strcpy(fifo->longName,lname); strcpy(fifo->shortName,sname); fifo->addr = addr; fifo->mask = mask; fifo->shift = shift; fifo->length = length; fifo->readFlag =rFlag; fifo->accessFlag=accFlag; fifo->emptyRegId=emptyReg; fifo->board = board; /* record fifo's pointer in global list */ SVTVME_FIFOS[fifoId] = fifo; /* update parent board structure with new fifo data */ board->fifos[board->nfifo]=fifo; board->nfifo++; return fifoId; } /*-------------------------------------------------------------------------*/ int svtvme_print_board_structure(svtvme_board board) { int i; svtvme_object obj; svtvme_ram ram; svtvme_fifo fifo; svtvme_spy spy; printf("DUMP OF BOARD %d ",board.id); printf("%s <%s> with %d objs and %d rams\n", board.longName, board.shortName, board.nobj, board.nram); printf("OBJECTs DUMP (indexed from 0 to %d):\n",board.nobj-1); printf("ind Obj address mask shift nbits flags "); printf(" Object_Name \n"); printf(" _id hex hex Rd Wr long \n"); for (i=0;i\n", obj.longName, obj.shortName);; } printf("RAMs DUMP (indexed from 0 to %d):\n",board.nram-1); printf("ind Ram address mask shift length flags "); printf(" Ram_Name \n"); printf(" _id hex hex hex Rd Wr long \n"); for (i=0;i\n", ram.longName, ram.shortName);; } printf("FIFOs DUMP (indexed from 0 to %d):\n",board.nfifo-1); printf("ind Fifo address mask shift length flags "); printf(" Fifo_Name \n"); printf(" _id hex hex hex Rd EF long \n"); for (i=0;i\n", fifo.longName, fifo.shortName);; } printf("SPYs DUMP (indexed from 0 to %d):\n",board.nspy-1); printf("ind Spy address mask shift length flags "); printf(" Spy_Name \n"); printf(" _id hex hex hex Rd WRP long \n"); for (i=0;iaddr, spy.ram->mask, spy.ram->shift, spy.ram->length); printf(" %3d %3d ", spy.ram->readFlag, spy.wrappedRegId); printf(" %s <%s>\n", spy.ram->longName, spy.ram->shortName);; } return 0; } /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/