Commit 44b21c5d authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw-fm: Changed men-on and men-off functions

They now simply send the SNMP commands and wait 1s prior to advancing.

This commit also increases the delay after programming the golden+release
bitstream to the on-board flash.
parent 5f5bd276
......@@ -66,20 +66,6 @@ sys.path.append("pyts/")
# Import here ptsdefine.py, to avoid "uncaught" exceptions later on
from ptsdefine import *
##-------------------------------------------------------------------------------------------------
## Method to turn on the ELMA crate.
##-------------------------------------------------------------------------------------------------
## It calls the get-fan-speeds script to check if the crate is on.
##-------------------------------------------------------------------------------------------------
def men_is_on():
on = 0
subprocess.call("cd shell; ./get-fan-speeds", shell=True, stdout=fnull, stderr=fnull)
btxt = tuple(open("log/fan-speeds","r"))
for i in range(1,len(btxt)):
if btxt[i].find("INTEGER: 0") == -1:
on = on + 1
return on
##-------------------------------------------------------------------------------------------------
## Method to turn on the VME crate.
##-------------------------------------------------------------------------------------------------
......@@ -87,15 +73,9 @@ def men_is_on():
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def men_on():
tmo = 1
while men_is_on() == 0:
print "Try:%d Switching ON the VME Crate" % (tmo)
subprocess.call("shell/men-on", shell=True, stdout=fnull, stderr=fnull)
tmo = tmo + 1
if tmo > 10:
print "FATAL ERROR: VME Crate: Unable to switch ON"
sys.exit(1)
time.sleep(1)
print("Switching on the ELMA crate")
subprocess.call("shell/men-on", shell=True, stdout=fnull, stderr=fnull)
time.sleep(1)
##-------------------------------------------------------------------------------------------------
## Method to turn off the VME crate.
......@@ -104,15 +84,9 @@ def men_on():
## power to the VME backplane.
##-------------------------------------------------------------------------------------------------
def men_off():
tmo = 1
while men_is_on() != 0:
print "Try:%d Switching OFF the VME Crate" % (tmo)
subprocess.call("shell/men-off", shell=True, stdout=fnull, stderr=fnull)
tmo = tmo + 1
if tmo > 10:
print "FATAL ERROR: VME Crate: Unable to switch OFF"
sys.exit(1)
time.sleep(1)
print("Switching off the ELMA crate")
subprocess.call("shell/men-off", shell=True, stdout=fnull, stderr=fnull)
time.sleep(1)
##-------------------------------------------------------------------------------------------------
## Main "method" of PTS
......@@ -133,6 +107,8 @@ if __name__ == '__main__':
# Scan the first barcode
while True:
sn1 = raw_input("--> Scan the 1st barcode: ")
if (not len(sn1)):
sn1 = "0"
m = re.search(r"[^a-z\-A-Z0-9_]+",sn1)
if m:
print "Bad character in barcode"
......@@ -165,7 +141,7 @@ if __name__ == '__main__':
men_on()
print "Loading FPGA bitstream"
print "Loading FPGA bitstream..."
ret = subprocess.call("cd boot; ./program", shell=True, stdout=fnull, stderr=fnull)
time.sleep(1)
......@@ -175,7 +151,7 @@ if __name__ == '__main__':
# Run JPTS in another shell script; JPTS will handle running each of the test scripts
cmd = "xterm -e ./jpts -s %s %s" % (sn1, sn2)
print "Running tests :%s\n" % (cmd)
subprocess.call(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
subprocess.call(cmd, shell=True, stdout=fnull, stderr=fnull)
ret = subprocess.call("grep FAIL log/*.log", shell=True, stdout=fnull, stderr=fnull)
......@@ -186,7 +162,9 @@ if __name__ == '__main__':
# After JPTS has finished, download release bitstream to EEPROM chip if none of the tests has failed
print "Loading CONV-TTL-BLO golden and release bitstream\n"
ret = subprocess.call("cd boot; ./flash", shell=True, stdout=fnull, stderr=fnull)
if (ret == 0):
if (ret != 0):
print "ERROR: Bitstream download failed"
else:
time.sleep(1)
# ... power-cycle the crate
......@@ -195,7 +173,7 @@ if __name__ == '__main__':
time.sleep(5)
men_on()
time.sleep(5)
time.sleep(10)
print ''
# .. and run the flash test
......
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