Commit 2ac18b53 authored by Dan Saunders's avatar Dan Saunders

updates from BR2

parent 52e3bbb9
......@@ -35,8 +35,9 @@ def spi_read(spi, addr):
invert = [0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25]
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
manager = uhal.ConnectionManager("file://connections.xml")
board = manager.getDevice(sys.argv[1])
#manager = uhal.ConnectionManager("file://connections.xml")
#board = manager.getDevice(sys.argv[1])
board = uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(sys.argv[1]) + ":50001", "file://addrtab/top.xml")
board.getClient().setTimeoutPeriod(10000)
v = board.getNode("csr.id").read()
......
......@@ -5,17 +5,16 @@ import pickle
sys.path.append('/home/dsaunder/workspace/go_projects/src/bitbucket.org/solidexperiment/readout-software/scripts/')
import detector_config_tools
ips = detector_config_tools.currentIPs(False)
print ips
'''
for ip in ips:
cmd = "python align_adc.py " + str(ip) + " output_" + str(ip) + ".tapslips"
cmd = "python align_sdr.py " + str(ip) + " output_" + str(ip) + ".tapslips"
print cmd
try:
os.system(cmd)
except:
sys.exit(0)
'''
# Dump into a db
db = dataset.connect('mysql://DAQGopher:gogogadgetdatabase@localhost/solid_phase1_running')
......@@ -24,7 +23,6 @@ if len(db['TapSlips']) != 0: configID = max(db['TapSlips']['configID'])['configI
print 'New config ID:', configID
for ip in ips:
results = pickle.load( open( "alignments/" + str(ip) + ".dat", "rb" ) )
results = pickle.load( open( "alignment_31Jan/output_" + str(ip) + ".tapslips", "rb" ) )
for res in results:
db['TapSlips'].insert({'configID': int(configID), 'ip': str(ip), 'tap': res[2], 'slip': res[1], 'channel': res[0]})
......@@ -11,12 +11,14 @@ import detector_config_tools
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
ips = detector_config_tools.currentIPs(False)
#ips = [58]
#ips = [92, 50, 88, 100, 86, 69, 53, 75, 60, 82]
#manager = uhal.ConnectionManager("file://connections.xml")
#hw = manager.getDevice(sys.argv[1])
while True:
print '\n', time.ctime(),
sumSynced = 0
sumErrs = 0
for ip in ips:
hw = uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(ip) + ":50001", "file://addrtab/top.xml")
hw.getNode("daq.timing.csr.ctrl.cap_ctr").write(1)
......@@ -25,8 +27,17 @@ while True:
fh = hw.getNode("daq.timing.csr.sctr_h").read();
fs = hw.getNode("daq.timing.csr.sync_ctr").read();
#ft = hw.getNode("daq.timing.csr.trig_ctr").read();
#fe = hw.getNode("daq.timing.csr.stat.sync_err").read();
fe = hw.getNode("daq.timing.csr.stat.sync_err").read();
stat = hw.getNode("csr.stat").read()
froc = hw.getNode("daq.roc.csr.stat").read()
f_nhop = hw.getNode("daq.trig.hop_cfg").read()
hw.dispatch()
print hex(fs), hex(fh), hex(fs), '\t',
synced = int(fs) > 0
#print int(synced), hex(froc), hex(stat),' ',
print int(synced), int(f_nhop),' ',
sumSynced += int(synced)
sumErrs += int(fe)
print '\t', sumSynced, sumErrs,
time.sleep(2)
......@@ -7,6 +7,8 @@
address_table="file://addrtab/top_sim.xml" />
<connection id="BEK_8CH" uri="ipbusudp-2.0://192.168.235.1:50001"
address_table="file://addrtab/top_sim.xml" />
<connection id="BR2_92" uri="ipbusudp-2.0://192.168.235.92:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_51" uri="ipbusudp-2.0://192.168.235.51:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_52" uri="ipbusudp-2.0://192.168.235.52:50001"
......@@ -35,4 +37,42 @@
address_table="file://addrtab/top.xml" />
<connection id="BR2_68" uri="ipbusudp-2.0://192.168.235.68:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_50" uri="ipbusudp-2.0://192.168.235.50:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_67" uri="ipbusudp-2.0://192.168.235.67:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_77" uri="ipbusudp-2.0://192.168.235.77:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_80" uri="ipbusudp-2.0://192.168.235.80:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_99" uri="ipbusudp-2.0://192.168.235.99:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_84" uri="ipbusudp-2.0://192.168.235.84:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_78" uri="ipbusudp-2.0://192.168.235.78:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_66" uri="ipbusudp-2.0://192.168.235.66:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_65" uri="ipbusudp-2.0://192.168.235.65:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_56" uri="ipbusudp-2.0://192.168.235.56:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_55" uri="ipbusudp-2.0://192.168.235.55:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_79" uri="ipbusudp-2.0://192.168.235.79:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_88" uri="ipbusudp-2.0://192.168.235.88:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_100" uri="ipbusudp-2.0://192.168.235.100:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_86" uri="ipbusudp-2.0://192.168.235.86:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_69" uri="ipbusudp-2.0://192.168.235.69:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_75" uri="ipbusudp-2.0://192.168.235.75:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_60" uri="ipbusudp-2.0://192.168.235.60:50001"
address_table="file://addrtab/top.xml" />
<connection id="BR2_82" uri="ipbusudp-2.0://192.168.235.82:50001"
address_table="file://addrtab/top.xml" />
</connections>
......@@ -5,10 +5,17 @@ import time
import sys
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
manager = uhal.ConnectionManager("file://connections.xml")
hw_list = []
for a in sys.argv[1:]:
hw_list.append(manager.getDevice(a))
#manager = uhal.ConnectionManager("file://connections.xml")
#for a in sys.argv[1:]:
# hw_list.append(manager.getDevice(a))
sys.path.append('/home/dsaunder/workspace/go_projects/src/bitbucket.org/solidexperiment/readout-software/scripts')
import detector_config_tools
ips = detector_config_tools.currentIPs(False)
for ip in ips:
hw_list.append(uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(ip) + ":50001", "file://addrtab/top.xml"))
for hw in hw_list:
print hw.id()
......
......@@ -5,10 +5,16 @@ import time
import sys
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
manager = uhal.ConnectionManager("file://connections.xml")
hw_list = []
for a in sys.argv[1:]:
hw_list.append(manager.getDevice(a))
#manager = uhal.ConnectionManager("file://connections.xml")
#for a in sys.argv[1:]:
# hw_list.append(manager.getDevice(a))
sys.path.append('/home/dsaunder/workspace/go_projects/src/bitbucket.org/solidexperiment/readout-software/scripts')
import detector_config_tools
ips = detector_config_tools.currentIPs(False)
for ip in ips:
hw_list.append(uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(ip) + ":50001", "file://addrtab/top.xml"))
for hw in hw_list:
print hw.id()
......
......@@ -11,14 +11,19 @@ import detector_config_tools
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
ips = detector_config_tools.currentIPs(False)
slaveReadoutBoards = False
slaveReadoutBoards = True
#ips = [92, 50, 88, 100, 86, 69, 53, 75, 60, 82] # Module Edgar.
ips = [92]
hw_list = []
for ip in ips:
print 'Setting up readout board ip:', ip
hw_list.append(uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(ip) + ":50001", "file://addrtab/top.xml"))
ihw = -1
for hw in hw_list:
ihw += 1
print 'IP:', ips[ihw]
hw.getNode("csr.ctrl.soft_rst").write(1) # Reset ipbus registers
hw.dispatch()
......@@ -34,8 +39,10 @@ for hw in hw_list:
hw.getNode("io.freq_ctr.ctrl.en_crap_mode").write(0);
hw.dispatch()
ihw = -1
for hw in hw_list:
ihw += 1
print 'IP:', ips[ihw]
print hw.id()
ver = hw.getNode("csr.id").read()
hw.dispatch()
......
......@@ -4,11 +4,19 @@ import uhal
import time
import sys
uhal.setLogLevelTo(uhal.LogLevel.ERROR)
manager = uhal.ConnectionManager("file://connections.xml")
hw_list = []
for a in sys.argv[1:]:
hw_list.append(manager.getDevice(a))
#manager = uhal.ConnectionManager("file://connections.xml")
#for a in sys.argv[1:]:
# hw_list.append(manager.getDevice(a))
sys.path.append('/home/dsaunder/workspace/go_projects/src/bitbucket.org/solidexperiment/readout-software/scripts')
import detector_config_tools
ips = detector_config_tools.currentIPs(False)
for ip in ips:
hw_list.append(uhal.getDevice("board", "ipbusudp-2.0://192.168.235." + str(ip) + ":50001", "file://addrtab/top.xml"))
for hw in hw_list:
print hw.id()
......
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