Commit 5795141e authored by Matthieu Cattin's avatar Matthieu Cattin

many: Add check for exising bitstream file.

Throws a pts critical exception if the expected bitstream file is missing.
parent 309da100
......@@ -55,8 +55,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
try:
......
......@@ -166,8 +166,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -199,8 +199,11 @@ def main (default_directory = '.'):
spec = rr.Gennum() # bind to the SPEC board
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
carrier = fmc_adc_spec.CFmcAdc100mSpec(spec, EXPECTED_BITSTREAM_TYPE)
fmc = fmc_adc.CFmcAdc100m(spec)
......
......@@ -157,8 +157,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -137,8 +137,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
#print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
#spec.load_firmware(FMC_ADC_BITSTREAM)
#time.sleep(2)
#if(os.path.isfile(FMC_ADC_BITSTREAM)):
# spec.load_firmware(FMC_ADC_BITSTREAM)
# time.sleep(2)
#else:
# raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -527,8 +527,11 @@ def main (default_directory='.'):
if LOAD_BITSTREAM:
bitstream_path = os.path.join(default_directory, FMC_ADC_BITSTREAM)
print "Loading FMC ADC firmware: %s\n" % bitstream_path
spec.load_firmware(bitstream_path)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -157,8 +157,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -55,8 +55,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
#print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
#spec.load_firmware(FMC_ADC_BITSTREAM)
#time.sleep(2)
#if(os.path.isfile(FMC_ADC_BITSTREAM)):
# spec.load_firmware(FMC_ADC_BITSTREAM)
# time.sleep(2)
#else:
# raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
try:
......
......@@ -58,8 +58,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
#print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
#spec.load_firmware(FMC_ADC_BITSTREAM)
#time.sleep(2)
#if(os.path.isfile(FMC_ADC_BITSTREAM)):
# spec.load_firmware(FMC_ADC_BITSTREAM)
# time.sleep(2)
#else:
# raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
try:
......
......@@ -157,8 +157,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -56,8 +56,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
try:
......
......@@ -190,8 +190,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -232,8 +232,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -236,8 +236,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -50,8 +50,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
#print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
#spec.load_firmware(FMC_ADC_BITSTREAM)
#time.sleep(2)
#if(os.path.isfile(FMC_ADC_BITSTREAM)):
# spec.load_firmware(FMC_ADC_BITSTREAM)
# time.sleep(2)
#else:
# raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -187,8 +187,11 @@ def main (default_directory='.'):
# Load FMC ADC firmware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded.
......
......@@ -73,8 +73,11 @@ def main (default_directory='.'):
# Loads firmware
print "Loading firmware"
spec.load_firmware(fmc_adc_firmware)
time.sleep(2);
if(os.path.isfile(fmc_adc_firmware)):
spec.load_firmware(fmc_adc_firmware)
time.sleep(2)
else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % fmc_adc_firmware)
# Others objects declaration
carrier_csr = csr.CCSR(spec, CARRIER_CSR)
......
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