Skip to content

Commit

Permalink
Fixed initial sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodalnajjar committed Nov 7, 2024
1 parent 2fc87bc commit 1d3f9b3
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
2 changes: 1 addition & 1 deletion firmware/python/ePix320kM/_DelayDetermination.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(self, numAsics, **kwargs):
))

self.add(pr.RemoteVariable(
name = 'state',
name = 'Busy',
offset = 0x2C,
bitSize = numAsics,
mode = 'RO',
Expand Down
51 changes: 50 additions & 1 deletion firmware/python/ePix320kM/_Root.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,42 @@ def fnInitAsic(self, dev,cmd,arg):

time.sleep(1)

#print("Warming up ASICs")
#self.warmUp(arg[1:5])


error = 0
print("Evaluating optimal delays")

self.App.FPGADelayDetermination.Start()
time.sleep(1)
while (self.App.FPGADelayDetermination.Busy.get() != 0) :
time.sleep(1)


# Cleanup
if not self.sim :
self.App.FPGADelayDetermination.Start()
for loops in range (11):

error = 0


for asicIndex in range (4):
getattr(self.root.App.AsicTop, f"DigAsicStrmRegisters{asicIndex}").CountReset()

self.Trigger()
time.sleep(0.01)

for asicIndex in range (4):
FillOnFailCntLane = [0] * 24
for laneIndex in range (24):
FillOnFailCntLane[laneIndex] = getattr(self.root.App.AsicTop, f"DigAsicStrmRegisters{asicIndex}").FillOnFailCntLane[laneIndex].get()
if(FillOnFailCntLane[laneIndex] > 0) :
error = 1

if error == 0:
break
print("Done")


def fnInitAsicScript(self, dev,cmd,arg):
Expand Down Expand Up @@ -682,6 +716,21 @@ def adjustLanes(self, dev,cmd,arg):
def dumpCounters(self, dev,cmd,arg):
self.getPKREGCounters(arg)

def warmUp(self, asicEnable):
# disable unused batchers
for batcherIndex in range(4):
self.enableAsic(batcherIndex, 0)

#empty run
frames = 5000
rate = 5000
self.hwTrigger(frames, rate)

for batcherIndex in range(4):
self.enableAsic(batcherIndex, asicEnable[batcherIndex])



def laneDiagnostics(self, asicEnable, threshold=1, loops=5, debugPrint=False, cleanRun=False) :

self.disableAndCleanAllFullRateDataRcv()
Expand Down

0 comments on commit 1d3f9b3

Please sign in to comment.