#! /usr/bin/env python import sys import SlowControl # slow control code if (len(sys.argv) < 2): print "ERROR: please specific FEC ID" quit(1) s = SlowControl.SlowControl(int(sys.argv[1])) # GIT information of the firmware is located in the system register (port 6007) # add the addresses 15 to 23 rply = SlowControl.read_burst(s, 6007, 15, 9) # check whether the reply if len(rply.data) != 9 or rply.success == False: print "ERROR: read request was not successful" print str(rply) quit(2) else: print "FEC_VERSION=0x%x" % rply.data[0] print "GIT_HASH=0x%0.8x%0.8x%0.8x%0.8x%0.8x" % \ ( rply.data[5], rply.data[4], rply.data[3], rply.data[2], rply.data[1] ) print "GIT_HASH_ABBR=0x%0.7x" % (rply.data[5] >> 4) print "BUILD_DATE=%0.8x" % rply.data[6] print "BUILD_TIME=%0.4x" % rply.data[7] print "BUILD_MOD=%d" % rply.data[8] print "" print str(rply)
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code dHLVDS = SlowControl.SlowControl(0) SlowControl.read_burst(dHLVDS, 6039, 0, 32, False) quit()
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code import time sc = SlowControl.SlowControl(1) rply = SlowControl.read_burst(sc, 6039, 7, 1) dcm_status = 0x3ffff while rply.success == False or rply.errors[0] != 0x0 or rply.data[0] != dcm_status: print "Rebooting FEC ADC as it doesn't seem to be ready!" if rply.success == True: print "DCM status: 0x%x" % rply.data[0] else: print "Readout not successful!" SlowControl.write_list(sc, 6007, [ 0xFFFFFFFF ], [ 0xFFFF8000 ]) time.sleep(15) rply = SlowControl.read_burst(sc, 6039, 7, 1) print "ADC DCM seems to be alright" quit()
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code dHLVDS = SlowControl.SlowControl(0) dADC = SlowControl.SlowControl(1) SlowControl.read_burst(dHLVDS, 6039, 26, 4, False) SlowControl.read_burst(dADC, 6039, 10, 4, False) quit()
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code dHLVDS = SlowControl.SlowControl(0) dADC = SlowControl.SlowControl(1) SlowControl.read_burst(dHLVDS, 6039, 0, 32, False) SlowControl.read_burst(dADC, 6039, 0, 16, False) quit()
#! /usr/bin/env python import sys import SlowControl # slow control code if (len(sys.argv) < 2): print "ERROR: please specific FEC ID" quit(1) s = SlowControl.SlowControl(int(sys.argv[1])) # GIT information of the firmware is located in the system register (port 6007) # add the addresses 15 to 23 rply = SlowControl.read_burst(s, 6007, 15, 9) # check whether the reply if len(rply.data) != 9 or rply.success == False: print "ERROR: read request was not successful" print str(rply) quit(2) else: print "FEC_VERSION=0x%x" % rply.data[0] print "GIT_HASH=0x%0.8x%0.8x%0.8x%0.8x%0.8x" % \ ( rply.data[5], rply.data[4], rply.data[3], rply.data[2], rply.data[1] ) print "GIT_HASH_ABBR=0x%0.7x" % (rply.data[5] >> 4) print "BUILD_DATE=%0.8x" % rply.data[6] print "BUILD_TIME=%0.4x" % rply.data[7] print "BUILD_MOD=%d" % rply.data[8] print "" print str(rply)
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code dHLVDS = SlowControl.SlowControl(0) dADC = SlowControl.SlowControl(1) SlowControl.read_burst(dHLVDS, 6039, 26, 4, False) SlowControl.read_burst(dADC, 6039, 10, 4, False) quit()
#! /usr/bin/env python ## ## code testing of class SlowControl ## import SlowControl # slow control code import time sc = SlowControl.SlowControl(1) rply = SlowControl.read_burst(sc, 6039, 7, 1) dcm_status = 0x3FFFF while rply.success == False or rply.errors[0] != 0x0 or rply.data[0] != dcm_status: print "Rebooting FEC ADC as it doesn't seem to be ready!" if rply.success == True: print "DCM status: 0x%x" % rply.data[0] else: print "Readout not successful!" SlowControl.write_list(sc, 6007, [0xFFFFFFFF], [0xFFFF8000]) time.sleep(15) rply = SlowControl.read_burst(sc, 6039, 7, 1) print "ADC DCM seems to be alright" quit()