-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathacq1001_caploop.py
executable file
·55 lines (38 loc) · 1.28 KB
/
acq1001_caploop.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
""" capture loop test
acq1001_caploop UUT1 [UUT2 ..]
where UUT1 is the ip-address or host name of first uut
example test client runs captures in a loop on one or more uuts
pre-requisite: UUT's are configured and ready to make a transient
capture
eg clk is running. soft trg enabled
eg transient length set.
loop continues "forever" until <CTRL-C>
"""
import sys
import acq400_hapi
def run_main():
uuts = [ ]
if len(sys.argv) > 1:
for addr in sys.argv[1:]:
uuts.append(acq400_hapi.Acq400(addr))
else:
print("USAGE: acq1001_caploop UUT1 [UUT2 ..]")
sys.exit(1)
acq400_hapi.cleanup.init()
for uut in uuts:
if hasattr(uut.s0, 'TIM_CTRL_LOCK'):
print "LOCKDOWN {}".format(uut)
uut.s0.TIM_CTRL_LOCK = 1
shot_controller = acq400_hapi.ShotController(uuts)
try:
while True:
shot_controller.run_shot(soft_trigger=True)
acq400_hapi.cleanup.sleep(1.0)
except acq400_hapi.cleanup.ExitCommand:
print("ExitCommand raised and caught")
finally:
print("Finally, going down")
# execution starts here
if __name__ == '__main__':
run_main()