def readSpyTail(self, spyId, nw=None): if nw == None: nw = self.spyCounter(spyId) data = zeros(nw, "i") nvalid = SvtvmeImpl.svtvme_readSpyTail(self.board, spyId, nw, data) if nvalid > 0: return data
import java java.lang.System.loadLibrary("SvtvmeImpl") from jsvtvme import SvtvmeImpl from jsvtvme.SvtvmeImpl import * from jsvtvme.SvtvmeConstants import * import jarray from org.omg.CORBA import IntHolder impl = SvtvmeImpl() import exceptions class SvtError(exceptions.Exception): def __init__(self, args=None): self.args = args class Spy: # spy name ptr name frz name wrp name short spyMapping = [ # AMS [AMS_HIT_SPY, AMS_HSPY_PTR, AMS_HSPY_FRZ, AMS_HSPY_WRP, "H"], [AMS_OUT_SPY, AMS_OSPY_PTR, AMS_OSPY_FRZ, AMS_OSPY_WRP, "O"], # Hit Buffer [HB_HIT_SPY, HB_HSPY_PTR, HB_HSPY_FRZ, HB_HSPY_WRP, "H"], [HB_ROAD_SPY, HB_RSPY_PTR, HB_RSPY_FRZ, HB_RSPY_WRP, "R"], [HB_OUT_SPY, HB_OSPY_PTR, HB_OSPY_FRZ, HB_OSPY_WRP, "O"], # Merger [MRG_A_SPY, MRG_ASPY_PTR, MRG_ASPY_FRZ, MRG_ASPY_WRP, "A"], [MRG_B_SPY, MRG_BSPY_PTR, MRG_BSPY_FRZ, MRG_BSPY_WRP, "B"],
def readMemoryFragment(self, memId, offset, nw): data = zeros(nw, "i") err = SvtvmeImpl.svtvme_readMemoryFragment(self.board, memId, offset, nw, data) return (err, data)
def isHeld(self): return SvtvmeImpl.svtvme_isHeld(self.board)
def readFifo(self, fifoId, nw): data = zeros(ndata, "i") err = SvtvmeImpl.svtvme_readFifo(self.board, fifoId, nw, data) return (err, data)
def isLast(self, fifoId, word): return SvtvmeImpl.svtvme_isLast(fifoId, word)
def writeWord(self, addr, word): return SvtvmeImpl.svtvme_writeWord(self.board, addr, word)
def resetSpy(self, spyId): return SvtvmeImpl.svtvme_resetSpy(self.board, spyId)
def readAllFifo(self, fifoId, maxWords): data = zeros(maxWords, "i") err = SvtvmeImpl.svtvme_readAllFifo(self.board, fifoId, maxWords, data, state) return (state.vale, data)
def deltaSpy(spyId, end, start): return SvtvmeImpl.svtvme_deltaSpy(spyId, end, start)
def readAllSpy(self, spyId, ndata): data = zeros(ndata, "i") err = SvtvmeImpl.svtvme_readAllSpy(self.board, spyId, ndata, data) return (err, data)
def SpyRamId(spyId): return SvtvmeImpl.svtvme_SpyRamId(spyId)
def isEmpty(self, fifoId): return SvtvmeImpl.svtvme_isEmpty(self.board, fifoId)
def writeMemoryFragment(self, memId, offset, data): return SvtvmeImpl.svtvme_writeMemoryFragment(self.board, memId, offset, len(data), data)
def isFrozen(self, spyId): return SvtvmeImpl.svtvme_isFrozen(self.board, spyId)
def testIDPROM(self): return SvtvmeImpl.svtvme_testIDPROM(self.board)
def readWord(self, addr): err = SvtvmeImpl.svtvme_readWord(self.board, addr, state) return (err, state.value)
def __init__(self, crate, slot, boardType): self.crate = crate # The 3 parameters for svtvme_openBoard self.slot = slot self.boardType = boardType self.board = SvtvmeImpl.svtvme_openBoard(crate, slot, boardType) # SVT Board handle
def __del__(self): SvtvmeImpl.svtvme_closeBoard(self.board)
def setBoardFlag(self, flag, value): return SvtvmeImpl.svtvme_setBoardFlag(self.board, flag, value)
def getBoardFlag(self, flag): err = SvtvmeImpl.svtvme_getBoardFlag(self.board, flag, state) return (err, state.value)
def writeMemory(self, memId, ndata, data): return SvtvmeImpl.svtvme_writeMemory(self.board, memId, ndata, data)
def getBoardType(self): return SvtvmeImpl.svtvme_getBoardType(self.board)
def cksumBlock(self, addr, mask, ndata): err = SvtvmeImpl.svtvme_cksumBlock(self.board, addr, mask, ndata, state) return (err, state.value)
def init(self): return SvtvmeImpl.svtvme_init(self.board)
def setTmode(self): return SvtvmeImpl.svtvme_setTmode(self.board)
def spyCounter(self, spyId): return SvtvmeImpl.svtvme_spyCounter(self.board, spyId)
def isTmode(self): return SvtvmeImpl.svtvme_isTmode(self.board)
def isWrapped(self, spyId): return SvtvmeImpl.svtvme_isWrapped(self.board, spyId)
def getState(self, regId): err = SvtvmeImpl.svtvme_getState(self.board, regId, state) return (err, state.value)
def sendDataOnce(self, data, speed=FASTER): return SvtvmeImpl.svtvme_sendDataOnce(self.board, len(data), data, speed)
def setState(self, regId, d): return SvtvmeImpl.svtvme_setState(self.board, regId, d)
def readWords(self, addr, nw): data = zeros(nw, "i") err = SvtvmeImpl.svtvme_readWords(self.board, addr, data, nw) return (err, data)
def checkState(self, regId, d): return SvtvmeImpl.svtvme_checkState(self.board, regId, d)
def writeWords(self, addr, nw, data): return SvtvmeImpl.svtvme_writeWords(self.board, addr, nw, data)
def testRegister(self, regId): return SvtvmeImpl.svtvme_testRegister(self.board, regid)
def readFifoMode(self, regId, nw): data = zeros(nw, "i") err = SvtvmeImpl.svtvme_readFifoMode(self.board, regId, nw, data) return (err, data)
def writeFifoMode(self, regId, nw, data): return SvtvmeImpl.svtvme_writeFifoMode(self.board, regId, nw, data)
def readMemory(self, memId, ndata): data = zeros(ndata, "i") err = SvtvmeImpl.svtvme_readMemory(self.board, memId, ndata, data) return (err, data)
def checkMemory(self, memId, ndata, data, stopFlag): err = SvtvmeImpl.svtvme_checkMemory(self.board, memId, ndata, data, stopFlag, state) return (err, state.value)
def __init__(self, crate, slot, boardType): self.crate = crate # The 3 parameters for svtvme_openBoard self.slot = slot self.boardType = boardType self.board = SvtvmeImpl.svtvme_openBoard( crate, slot, boardType) # SVT Board handle
def testMemory(self, memId, ntimes, stopFlag): err = SvtvmeImpl.svtvme_testMemory(self.board, memId, ntimes, stopFlag, state) return (err, state.value)