Commit 8c233286 authored by David Cussans's avatar David Cussans

Minor optimizations - now only one call to hw.dispatch in loop

parent 3ce313c3
......@@ -22,7 +22,7 @@ listenForTelescopeShutter = False
#TriggerInterval = 400000 # Units = 160MHz clock ticks.
#loopWait = 1.0 # polling interval ( seconds )
TriggerInterval = 16000 # Units = 160MHz clock ticks.
loopWait = 0.1 # polling interval ( seconds )
loopWait = 0.05 # polling interval ( seconds )
pulseDelay = 0 # between 0 and 31 in units of 160MHz clock.
pulseStretch = 4 # between 0 and 31 in units of 160MHz clock.
DUTMask = 1 # bit mask to indicate with DUT are active
......@@ -52,6 +52,11 @@ eventFifoFillLevel = 0
while True:
nEvents = int(eventFifoFillLevel)//4 # only read out whole events ( 4 x 32-bit words )
wordsToRead = nEvents*4
# get timestamp data and fifo fill in same outgoing packet.
timestampData = hw.getNode("eventBuffer.EventFifoData").readBlock(wordsToRead)
eventFifoFillLevel = hw.getNode("eventBuffer.EventFifoFillLevel").read()
preVetotriggerCount = hw.getNode("triggerLogic.PreVetoTriggersR").read()
postVetotriggerCount = hw.getNode("triggerLogic.PostVetoTriggersR").read()
......@@ -71,12 +76,6 @@ while True:
print "Current timestamp High,Low (hex) = " , hex(timestampHigh) , hex(timestampLow)
print "FIFO fill level = " , eventFifoFillLevel
nEvents = int(eventFifoFillLevel)//4 # only read out whole events ( 4 x 32-bit words )
wordsToRead = nEvents*4
# get timestamp data and fifo fill in same outgoing packet.
timestampData = hw.getNode("eventBuffer.EventFifoData").readBlock(wordsToRead)
eventFifoFillLevel = hw.getNode("eventBuffer.EventFifoFillLevel").read()
hw.dispatch()
print "number of events in FIFO = ",nEvents
# print timestampData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment