-
Notifications
You must be signed in to change notification settings - Fork 11
/
Histo_of_QIE_RST_igloo2_Top.py
72 lines (65 loc) · 2.05 KB
/
Histo_of_QIE_RST_igloo2_Top.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
####################################################################
# Type: SCRIPT #
# #
# Description: [Put a description here.] #
####################################################################
from hcal_teststand import *
from hcal_teststand.hcal_teststand import *
import sys
# CLASSES:
# /CLASSES
# FUNCTIONS:
# /FUNCTIONS
# MAIN:
if __name__ == "__main__":
# Arguments:
name = ""
if len(sys.argv) == 1:
name = "904"
elif len(sys.argv) == 2:
name = sys.argv[1]
else:
name = "904"
ts = teststand(name) # Initialize a teststand object. This object stores the teststand configuration and has a number of useful methods.
# Variables:
i_crate = 1
i_slot = 2
# Define ngccm scripts:
scripts = [
[
"get HF{0}-{1}-iTop_FPGA_MAJOR_VERSION".format(i_crate, i_slot),
"get HF{0}-{1}-iTop_FPGA_MINOR_VERSION".format(i_crate, i_slot),
"get fec1-qie_reset_cnt",
"get HF{0}-{1}-iTop_RST_QIE_count".format(i_crate, i_slot),
],
[
"get fec1-qie_reset_cnt",
"get HF{0}-{1}-iTop_RST_QIE_count".format(i_crate, i_slot),
],
[
"get fec1-qie_reset_cnt",
"get HF{0}-{1}-iTop_RST_QIE_count".format(i_crate, i_slot),
"get HF{0}-{1}-iTop_CntrReg".format(i_crate, i_slot),
"put HF{0}-{1}-iTop_CntrReg 0x20".format(i_crate, i_slot),
],
[
"get HF{0}-{1}-iTop_CntrReg".format(i_crate, i_slot),
"put HF{0}-{1}-iTop_CntrReg 0x0".format(i_crate, i_slot),
],
[
"get HF{0}-{1}-iTop_Spy96bits".format(i_crate, i_slot),
"put HF{0}-{1}-iTop_CntrReg 0x10".format(i_crate, i_slot),
],
[
"put HF{0}-{1}-iTop_CntrReg 0x0".format(i_crate, i_slot),
"get HF{0}-{1}-iTop_Spy96bits".format(i_crate, i_slot),
]
]
# Run ngccm scripts:
for script in scripts:
print ">> Running script number {0}".format(scripts.index(script))
output = ngccm.send_commands_parsed(ts.ngccm_port, script)["output"]
for cmd in output:
print "<< {0} -> {1}".format(cmd["cmd"], cmd["result"])
print ""
# /MAIN