Commit ceb84a96 authored by Richard R. Carrillo's avatar Richard R. Carrillo

the procedure carried out by test00 of the fmcdio5chttla now is divided into…

the procedure carried out by test00 of the fmcdio5chttla now is divided into test00, test01, test02 and test03 (three new tests created)
parent ee5a99fb
......@@ -5,7 +5,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 26/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
LOGDIR=./log_fmcdio5chttla
......@@ -49,7 +49,7 @@ do
echo "Test series run $nb_test out of $nb_test_limit"
echo " "
sudo ./pts.py -b FMC-DIO-5chTTLa -s $serial -e $extra_serial -t./test/fmcdio5chttla/python -l $LOGDIR 00 01 02 03 04 05
sudo ./pts.py -b FMC-DIO-5chTTLa -s $serial -e $extra_serial -t./test/fmcdio5chttla/python -l $LOGDIR 00 01 02 03 04 05 06 07 08
if [ "$nb_test" != "$nb_test_limit" ]
then
......
......@@ -9,16 +9,19 @@ Author: Richard R. Carrillo <rcarrillo(AT)sevensols.com>
Licence: GPL v2 or later.
Website: http://www.ohwr.org
Website: http://www.sevensols.com
Last modifications: 1/4/2012
This batch of tests makes a connectivity test of the FmcDIO5chTTLa's components.
- test00: Check fmc-dio-5chttl board EEPROM and DAC presence and temperature-sensor operation
- test01: Check fmc-dio-5chttl-board LEDs (LEDs and LED circuit working)
- test02: Check fmc-dio-5chttl-board ports as output (port driver working, connector connectivity and LVDS to LVCMOS IC working)
- test03: Check fmc-dio-5chttl-board ports as inputs (DAC and LVDS comparator working)
- test04: Check output-enable circuit of fmc-dio-5chttl-board ports
- test05: Check termination resistors of fmc-dio-5chttl-board ports
Version 1.0 (Last modifications: 29/4/2012)
This batch of tests makes a connectivity and operation test of the FmcDIO5chTTLa's components.
- test00: Check fmc-dio-5chttl-board presence (Mezzanine presence line working)
- test01: Check fmc-dio-5chttl-board digital thermometer operation (termperature and unique ID acquisition working)
- test02: Check fmc-dio-5chttl-board EEPROM presence and operation (read and write operations working)
- test03: Check fmc-dio-5chttl-board DAC presence operation (DAC initialization)
- test04: Check fmc-dio-5chttl-board LEDs (LEDs and LED circuit working)
- test05: Check fmc-dio-5chttl-board ports as output (port driver working, port connectivity and LVDS to LVCMOS IC working)
- test06: Check fmc-dio-5chttl-board ports as inputs (DAC and LVDS comparator working)
- test07: Check output-enable circuit of fmc-dio-5chttl-board ports
- test08: Check termination resistors of fmc-dio-5chttl-board ports
These tests are made to work stand-alone too. So, it is possible to execute each one using 'sudo ./test0x.py'
......
This documents describes all the possible messages which can be reported during the execution of PTS of the FMC-DIO-5chTTLa board. These messages can reveal the cause of a test failure.
Error messages
--------------
DIOERR00: PRESENT line is not asserted in FMC. Is the fmc-dio-5chttla correctly inserted into the carrier?
The PRESENT line of the FMC connector is not asserted. This line is used to state that an adequate board in connected in the FMC connector of the SPEC board (carrier).
Possible causes:
- FMC-DIO-5chTTLa-board is not correctly connected.
- Faulty electrical connectivity in the PRESENT line circuit or FMC connector.
- Incorrect FPGA configuration (bitstream file).
DIOERR01: I2C core is not enabled
The internal flags corresponding to the I2C core are not active.
Possible causes:
- Incorrect FPGA configuration (bitstream file).
DIOERR02: No I2C device found
No device has responded to any address in the I2C bus.
Possible causes:
- I2C bus is not working properly. Check for short-circuits in any of the bus lines.
DIOERR03: Device not found. Only x I2C devices found
The DAC or the EEPROM does not respond to their expected address.
Possible causes:
- Wrong address configuration. If the number of devices found (x) is 3, check the list of devices (addresses) found in the generated log files. For those devices (addresses) which are not listed, check their address configuration lines (chip soldering and FMC GA0 and GA1 lines connectivity).
- Faulty electrical connection. If the number of devices found (x) is less than 3, check the list of devices (addresses) found in the generated log files. For those devices (addresses) which are not listed, check their I2C lines and power pins (chip soldering).
I2C device EEPROM (24AA64T) at addr 0x50 produced the error: DIOERR04: Initializing: x
This error message is reserved for future uses.
Possible causes:
- None
I2C device DAC (DAC5578) at addr 0x48 produced the error: DIOERR05: Initializing: x
The DAC did not respond correctly during the configuration process.
Possible causes:
- An incorrect DAC IC is mounted.
- Defective DAC IC soldering (I2C lines or power-supply pins of DAC).
The message x may give an extra clue about the error cause.
I2C device DAC (DAC5578) at addr 0x48 produced the error: DIOERR06: Setting channel value: x
The DAC did not respond correctly to the set-channel voltage commands.
Possible causes:
- An incorrect DAC IC is mounted.
- Defective DAC IC soldering (I2C lines or power-supply pins of DAC).
The message x may give an extra clue about the error cause.
Error in I2C bus. (Addr: x): DIOERR07: Device not initialized
The I2C-device access library has not been properly initialized. This error should never be reported when executing the original FMC-DIO-5chTTLa-board tests.
Possible causes:
- Test-program programming bug.
I2C device DAC (DAC5578) at addr 0x48 produced the error: DIOERR08: Getting channel value: x
The DAC did not respond correctly to the get channel-voltage configuration commands.
Possible causes:
- An incorrect DAC IC is mounted.
- Defective DAC IC soldering (I2C lines or power-supply pins of DAC).
The message x may give an extra clue about the error cause.
Error in OneWire bus. (Addr: x): DIOERR09: Getting unique ID: y
The OneWire device DS1820 did not respond correctly during the process for obtaining the chip unique ID (first commands).
Possible causes:
- An incorrect IC is mounted.
- Defective chip soldering (OneWire line or power-supply pins of DS1820).
- Electrical connectivity problems (short-circuits or open-circuits) in the OneWire line (FMC connector, OneWire pull-up resistors).
The message y may give an extra clue about the error cause.
Error in OneWire bus. (Addr: x): DIOERR10: Device not initialized
The OneWire-device access library has not been properly initialized. This error should never be reported when executing the original FMC-DIO-5chTTLa-board tests.
Possible causes:
- Test-program programming bug.
Error in OneWire bus. (Addr: x): DIOERR11: Getting temperature: y
The OneWire device DS1820 did not respond correctly during the process for obtaining the temperature.
Possible causes:
- An incorrect IC is mounted.
- Defective chip soldering (OneWire line or power-supply pins of DS1820).
The message y may give an extra clue about the error cause.
Error in I2C bus. (Addr: x): DIOERR012: Device not initialized
The I2C EEPROM access library has not been properly initialized. This error should never be reported when executing the original FMC-DIO-5chTTLa-board tests.
Possible causes:
- Test-program programming bug.
I2C device EEPROM (24AA64T) at addr 0x50 produced the error: DIOERR13: Writing memory data: x
The EEPROM did not respond correctly to the write data commands.
Possible causes:
- An incorrect EEPROM IC is mounted.
- Defective EEPROM IC soldering (I2C lines or power-supply pins of EEPROM).
The message x may give an extra clue about the error cause.
I2C device EEPROM (24AA64T) at addr 0x50 produced the error: DIOERR14: Reading memory data: x
The EEPROM did not respond correctly to the read data commands.
Possible causes:
- An incorrect EEPROM IC is mounted.
- Defective EEPROM IC soldering (I2C lines or power-supply pins of EEPROM).
The message x may give an extra clue about the error cause.
TSTERR00: Operation of fmc-dio-5chttla-board LEDs failed
The user answered “N” indicating that the FMC-DIO-5chTTLa-board LEDs did not operate properly.
Possible causes:
- Soldering problems of the LED circuit (LED, current-limiting resistor or switch transistor).
- Electrical connectivity problems in the LED activation lines of the FMC connector.
TSTERR01: Operation of fmc-dio-5chttla-board ports as output failed
The user answered “N” indicating that the FMC-DIO-5chTTLa-board ports did not provide the correct voltage to turn on and off the test-cable LEDs.
Possible causes:
- Soldering problems (short-circuits and open-circuits) of the corresponding LEMO 00 connectors, corresponding lines (fuses) or voltage clamping components (short-circuits).
- Soldering problems of the corresponding port driver IC and the LVDS-to-LVCMOS IC.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
Execute test06 to obtain more information which could be useful to isolate the problem.
TSTERR02: Proper voltage reading not obtained in ports: [x] when output enable=1
Apparently the voltage obtained in the ports x is out of the expected range when the port output is set to a high or low level. Alternatively, a misleading wrong voltage could have been measured due to a DAC or comparator operation problem.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Soldering problems (short-circuits) of the corresponding LEMO-00 connectors, corresponding lines (fuses) or voltage clamping components.
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
Check the results of this test to isolate the problem.
TSTERR03: Proper voltage reading not obtained in ports: [x] when output enable=0
Apparently the voltage obtained in the ports x is out of the expected range when the port output is set to a high level, the termination resistor is disabled and the output-enable circuit is disabled. Alternatively, a misleading wrong voltage could have been measured due to a DAC or comparator operation problem.
Possible causes:
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
Check the log files to obtain more information about what caused the error.
Check the results of test06 to isolate the problem.
TSTERR04: Proper voltage reading not obtained in ports: [x] when termination resistors enabled
Apparently the voltage obtained in the ports x is out of the expected range when the port output is set to a high level and the termination resistor is enabled. Alternatively, a misleading wrong voltage could have been measured due to a DAC or comparator operation problem.
Possible causes:
- Soldering problems (short-circuits) of the corresponding LEMO-00 connectors, corresponding lines (fuses) or port input-voltage clamping components.
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
Check the results of test06 to isolate the problem.
TSTERR05: No communication could be performed between any two ports
No communication could be established between any of the board ports (when the interconnection cables are plugged). That is, the test could not find a port working as input and another as output.
Possible causes:
- The interconnection cables are not connected to the LEMO 00 ports while executing this test.
- Soldering problems (short-circuits and open-circuits) of the corresponding LEMO 00 connectors, corresponding lines (fuses) or voltage clamping components (short-circuits).
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
Check the log files to obtain more information about what caused the error.
TSTERR06: Ports x appear no to be correctly connected
No communication could be established through ports x (when the interconnection cables are plugged). That is, the test could use ports x neither as input nor output to communicate with the rest of the ports.
Possible causes:
- Some of the interconnection cables are not correctly connected to the LEMO 00 ports while executing this test.
- Soldering problems (open-circuits) of the corresponding LEMO 00 connectors or corresponding lines (fuses).
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
Check the log files to obtain more information about what caused the error.
TSTERR07: Correct data not read when verifying EEPROM writting operation
Possible causes:
- An incorrect EEPROM IC is mounted.
- Defective EEPROM or IC soldering (I2C lines or power-supply pins of EEPROM).
Warning messages
----------------
TSTWRN00: Strangely-low voltage value obtained in ports: [x] when output=1
Apparently the voltage measured in the ports x is unusually low (but still within the operating range) when the port output is set to a high level.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Soldering problems of the termination-resistor activation circuit (switching transistor)
- Electrical connectivity problems of the corresponding port termination-resistor control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
TSTWRN01: Strangely-high voltage value obtained in ports: [x] when output=0
Apparently the voltage measured in the ports x is unusually high (but still within the operating range) when the port output is set to a low level.
Possible causes:
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
TSTWRN02: Strangely-high voltage value obtained in ports: [x] when output enable=0
Apparently the voltage measured in the ports x is unusually high (but still within the operating range) when the port output-enable circuit is disabled.
Possible causes:
- Electrical connectivity problems of the corresponding port control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
TSTWRN03: Strangely-low voltage value obtained in ports: [x] when termination resistors enabled
Apparently the voltage measured in the ports x is unusually low (but still within the operating range) when the port output is set to a high level and the termination resistor is enabled.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Electrical connectivity problems of the corresponding port termination-resistor control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
TSTWRN04: Strangely-high voltage value obtained in ports: [x] when termination resistors enabled
Apparently the voltage measured in the ports x is unusually high (but still within the operating range) when the port output is set to a high level and the termination resistor is enabled.
Possible causes:
- Soldering problems of the termination-resistor activation circuit (switching transistor or resistors)
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
TSTWRN05: Strange temperature value measured
Apparently the temperature measured through the OneWire temperature acquisition I.C. is out of a reasonable range.
Possible causes:
- The test is run in extreme temperature conditions.
- Board overheating.
- Faulty temperature acquisition I.C.
Check the log files to obtain the concrete temperature value measured.
......@@ -5,7 +5,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Last modifications: 1/4/2012
# Version 1.0 (last modifications: 29/4/2012)
import rr
import struct
......@@ -54,46 +54,58 @@ class CFmcDio:
DAC_CHANNEL_CORRESP=[0,1,2,7,4,5]
def __init__(self, bus, base, init_devices):
def __init__(self, bus, base, init_thermometer, init_eeprom, init_dac):
""" fmc-dio-5chttla-board presence check, I2C devices response check and OneWire-device funct. init.
bus = host bus (PCIe, VME, etc...)
base = base address
init_devices = If it is True, I2C and OneWire devices are initialized and can then be used
init_thermometer = If it is True, OneWire bus and the digital thermometer is initialized for further user
init_eeprom = If it is True, I2C bus and EEPROM is initialized for further user
init_dac = If it is True, I2C bus and DAC is initialized for further user
"""
self.bus = bus
self.base = base
self.gpio = CGPIO(bus, base + self.BASE_GPIO)
if(not self.fmc_present()):
raise CFmcDioError("FMC", base, "DIOERR00: PRESENT line is not asserted")
if init_devices:
if init_eeprom or init_dac: # if any I2C device must be initialized, init the I2C bus
try:
self.i2c = COpenCoresI2C(bus, base + self.BASE_I2C, self.I2C_PRESCALER)
board_I2C_periph_addr=[self.I2C_ADDR_DAC,self.I2C_ADDR_EEPROM]
board_I2C_periph_addr=list()
if init_eeprom:
board_I2C_periph_addr.append(self.I2C_ADDR_EEPROM) # Add EEPROM to the list of required I2C devices
if init_dac:
board_I2C_periph_addr.append(self.I2C_ADDR_DAC) # Add DAC to the list of required I2C devices
found_I2C_periph_addr=self.i2c.scan()
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", base, "DIOERR01: "+e.msg)
raise CFmcDioError("I2C", base, "DIOERR01: Initializing bus: "+e.msg)
if not found_I2C_periph_addr:
raise CFmcDioError("I2C", base, "DIOERR02: No I2C device found")
for periph_addr in board_I2C_periph_addr:
if periph_addr not in found_I2C_periph_addr:
raise CFmcDioError("I2C", periph_addr, "DIOERR03: Device not found. Only "+str(len(found_I2C_periph_addr))+" I2C devices found")
try:
self.eeprom = C24AA64(self.i2c, self.I2C_ADDR_EEPROM);
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR04: "+e.msg)
try:
self.dac = CDAC5578(self.i2c, self.I2C_ADDR_DAC);
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR05: "+e.msg)
self.onewire = COpenCoresOneWire(self.bus, base + self.BASE_ONEWIRE, 624/2, 124/2)
self.ds1820 = CDS18B20(self.onewire, 0);
if init_eeprom:
try:
self.eeprom = C24AA64(self.i2c, self.I2C_ADDR_EEPROM)
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR04: Initializing: "+e.msg)
else:
self.eeprom=None
if init_dac:
try:
self.dac = CDAC5578(self.i2c, self.I2C_ADDR_DAC);
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR05: Initializing: "+e.msg)
else:
self.dac=None
else:
self.i2c=None
self.onewire=None
self.dac=None
self.eeprom=None
if init_thermometer: # if the thermometer must be initialized, init the OneWire bus
self.onewire = COpenCoresOneWire(self.bus, base + self.BASE_ONEWIRE, 624/2, 124/2)
self.ds1820 = CDS18B20(self.onewire, 0)
else:
self.onewire=None
self.ds1820=None
def fmc_present(self):
......@@ -139,9 +151,9 @@ class CFmcDio:
try:
self.dac.out(self.DAC_CHANNEL_CORRESP[port], threshold)
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR06: "+e.msg)
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR06: Setting channel value: "+e.msg)
else:
raise CFmcDioError("I2C", self.base, "DIOERR07: Device not initialized")
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR07: Device not initialized")
def get_in_threshold(self, port):
""" Returns the DAC value set in a specified channel (port) """
......@@ -149,10 +161,10 @@ class CFmcDio:
try:
dacval=self.dac.rd_out(self.DAC_CHANNEL_CORRESP[port])
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR08: "+e.msg)
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR08: Getting channel value: "+e.msg)
return(dacval)
else:
raise CFmcDioError("I2C", self.base, "DIOERR07: Device not initialized")
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR07: Device not initialized")
def DACvalue2voltage(self, dacval):
""" Calculate the voltage corresponding to a specific DAC channel digital value """
......@@ -207,9 +219,9 @@ class CFmcDio:
try:
return self.ds1820.read_serial_number()
except OneWireDeviceOperationError as e:
raise CFmcDioError("OneWire", self.base, "DIOERR09: "+e.msg)
raise CFmcDioError("OneWire", 0, "DIOERR09: Getting unique ID: "+e.msg)
else:
raise CFmcDioError("OneWire", self.base, "DIOERR10: Device not initialized")
raise CFmcDioError("OneWire", 0, "DIOERR10: Device not initialized")
def get_temp(self):
""" Returns a temperature value in Celsius degrees by means of the OneWire IC DS1820 """
......@@ -218,11 +230,30 @@ class CFmcDio:
serial_number = self.ds1820.read_serial_number()
temp=self.ds1820.read_temp(serial_number)
except OneWireDeviceOperationError as e:
raise CFmcDioError("OneWire", self.base, "DIOERR11: "+e.msg)
raise CFmcDioError("OneWire", 0, "DIOERR11: Getting temperature: "+e.msg)
return temp
else:
raise CFmcDioError("OneWire", self.base, "DIOERR10: Device not initialized")
raise CFmcDioError("OneWire", 0, "DIOERR10: Device not initialized")
def wr_eeprom(self, mem_addr, data_list):
""" Write a list of bytes (data_list) at the mem_addr address of the board EEPROM (24AA64T)"""
if self.eeprom:
try:
self.eeprom.wr_data(mem_addr,data_list)
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR13: Writing memory data: "+e.msg)
else:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR12: Device not initialized")
def rd_eeprom(self, mem_addr, number_of_bytes):
""" Read a list of bytes (data_list) of number_of_bytes size at the mem_addr address of the board EEPROM (24AA64T)"""
if self.eeprom:
try:
return self.eeprom.rd_data(mem_addr,number_of_bytes)
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR14: Reading memory data: "+e.msg)
else:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR12: Device not initialized")
#spec = rr.Gennum()
......
......@@ -7,7 +7,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 24/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
......@@ -17,49 +17,18 @@ import os
"""
test00: Check fmc-dio-5chttl-board EEPROM and DAC presence and temperature-sensor operation
Conditions: I2C bus and OneWire bus work
test00: Check fmc-dio-5chttl-board presence
Conditions: None
User intervention required: No
Procedure details:
- Load firmware
- Test mezzanine presence line.
- Initialize the board and its peripherals
- Check that I2C devices (EEPROM (24AA64T) and DAC (DAC5578)) are present
- Check that OneWire device (temperature sensor (DS18B20)) is present and responds
- Check and store temperature sensor ID
- Check and store temperature acquisition.
"""
class test00:
def __init__(self, spec):
""" Initialize the board, check PRESENT pin state and look for I2C devices """
try:
self.dio = CFmcDio(spec, 0x80000, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_temp(self):
""" Check OneWire device response correctly and check temperature acquisition """
try:
print " chip lasered code: {:x}".format(self.dio.get_unique_id())
except CFmcDioError as e:
print str(e)
ret_error=["E","While getting DS18B20 chip I.C.: "+str(e)]
else:
try:
ret_error=None # test completed successfully
temper=self.dio.get_temp()
print " chip temperature: {:.2f}°C".format(temper)
if temper > 50 or temper < 10:
ret_error=["W","While getting temperature with DS18B20 I.C.: TSTWRN05: Strange temperature value measured"]
except CFmcDioError as e:
print str(e)
ret_error=["E","While getting temperature with DS18B20 I.C.: "+str(e)]
return ret_error
""" Initialize the board, check PRESENT pin state """
self.dio = CFmcDio(spec, 0x80000, False, False, False) # Do not init any I2C or OneWire device
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -77,22 +46,26 @@ def main(default_directory="."):
print "Test00 Start"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
test=test00(spec)
print "\nChecking temperature acquisition I.C. (DS18B20)"
ret_error=test.test_temp()
print "Checking fmc-dio-5chttla board presence"
try:
test=test00(spec)
except CFmcDioError as e:
test_error=e
print str(test_error)
else:
test_error=None
end_test_time = time.time()
print "\nEnd of Test00"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test00 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
print "RESULT: [{}]".format("FAIL" if test_error else "OK")
print 'Test00 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if test_error:
err_msg="While fmc-dio-5chttla initialization: "+str(test_error)
if test_error.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
if __name__ == "__main__":
main(".")
......
......@@ -2,36 +2,38 @@
#coding: utf8
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Tomasz?
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.1 (Last modifications: 1/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
from keyb import *
import rr
import os
import sys
"""
test01: Check fmc-dio-5chttl-board LEDs (LED and LED circuit working)
Conditions: None
User intervention required: Yes
test01: Check fmc-dio-5chttl-board digital thermometer operation
Conditions: Mezzanine presence line asserted (test00 passed)
User intervention required: No
Procedure details:
- Load firmware
- Test mezzanine presence line
- Blink fmc-dio-5chttl-board LEDs
- Test mezzanine presence line.
- Initialize the board OneWire device (digital thermometer (DS18B20))
- Check that DS18B20 is present and responds
- Check and store temperature sensor ID
- Check and store acquired temperature.
"""
class test01:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
""" Initialize the board and check PRESENT pin state """
try:
self.dio = CFmcDio(spec, 0x80000, False)
self.dio = CFmcDio(spec, 0x80000, True, False, False) # Init only the OneWire device
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
......@@ -39,38 +41,24 @@ class test01:
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_LEDs(self):
""" LED-blink Check """
tmp_stdout = sys.stdout
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
print "¿Are the two fmc-dio-5chttla-board LEDs blinking alternately?"
print "Press Y/N and Enter"
ans=""
while ans != "Y" and ans != "N":
for nled in range(2):
self.dio.set_led(nled,nled)
time.sleep(0.2)
for nled in range(2):
self.dio.set_led(nled,1-nled)
time.sleep(0.2)
if kbhit():
ans=raw_input().upper()
if ans <> "Y" and ans <> "N":
print "The valid inputs are only Y or N and Enter"
sys.stdout = tmp_stdout
sys.stdin = tmp_stdin
# purgestdin()
for nled in range(2):
self.dio.set_led(nled,0)
print "The user reported {} operation of board LEDs".format("a correct" if ans=="Y" else "an incorrect")
if ans == "N":
emsg="TSTERR00: Operation of fmc-dio-5chttla-board LEDs failed"
print emsg
def test_temp(self):
""" Check OneWire device response correctly and check temperature acquisition """
try:
print " chip lasered code: {:x}".format(self.dio.get_unique_id())
except CFmcDioError as e:
print str(e)
ret_error=["E","While getting DS18B20 I.C. unique ID: "+str(e)]
else:
emsg=None # test completed successfully
return emsg
try:
ret_error=None # test completed successfully
temper=self.dio.get_temp()
print " chip temperature: {:.2f}°C".format(temper)
if temper > 50 or temper < 10:
ret_error=["W","While getting temperature with DS18B20 I.C.: TSTWRN05: Strange temperature value measured"]
except CFmcDioError as e:
print str(e)
ret_error=["E","While getting temperature with DS18B20 I.C.: "+str(e)]
return ret_error
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -87,16 +75,23 @@ def main(default_directory="."):
print "Test01 Start"
print "Checking fmc-dio-5chttla board presence"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla board"
test=test01(spec)
print "\nChecking temperature acquisition I.C. (DS18B20)"
ret_error=test.test_temp()
print "\nChecking LEDs"
emsg=test.test_LEDs()
end_test_time = time.time()
print "\nEnd of Test01"
print "RESULT: [{}]".format("FAIL" if emsg else "OK")
if emsg:
raise PtsError(emsg)
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test01 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
if __name__ == "__main__":
main(".")
......
......@@ -2,37 +2,37 @@
#coding: utf8
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Tomasz?
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 24/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
from keyb import *
import rr
import os
"""
test02: Check fmc-dio-5chttl-board ports as output (port driver working, connector connectivity and LVDS to LVCMOS IC working)
Conditions: fmc-dio-5chttl-board presence line working
User intervention required: Yes*
test02: Check fmc-dio-5chttl-board EEPROM presence and operation
Conditions: Mezzanine presence line asserted
User intervention required: No
Procedure details:
- Load firmware.
- Load firmware
- Test mezzanine presence line.
- Check that ports work as output
- Using the port interconnection cables: Check that all ports are interconnected.
- If all the communications fail: Using the test cable: Oscillate state of fmc-dio-5chttl-board ports
- Initialize the board
- Check that I2C device EEPROM (24AA64T) is present
- Check writing and reading operation of EEPROM
"""
class test02:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
""" Initialize the board, check PRESENT pin state and look for I2C devices """
try:
self.dio = CFmcDio(spec, 0x80000, True)
self.dio = CFmcDio(spec, 0x80000, False, True, False) # Init EEPROM I2C device
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
......@@ -40,128 +40,34 @@ class test02:
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def osc_ports(self):
""" Oscillate state of fmc-dio-5chttl-board ports """
for lemon in range(5): # Disable output of all ports and set them to 1
self.dio.set_dir(lemon,0)
self.dio.set_out(lemon,1)
ans=""
lemon=0
while ans != "Y" and ans != "N":
time.sleep(0.05)
self.dio.set_dir((lemon-1)%5,0)
self.dio.set_dir(lemon,1)
lemon=(lemon+1)%5
if kbhit():
ans=raw_input().upper()
if ans <> "Y" and ans <> "N":
print "The valid inputs are only Y or N and Enter"
for lemon in range(5): # Disable output of all ports
self.dio.set_out(lemon, 0)
self.dio.set_dir(lemon, 0)
return ans
def check_port_couple(self,inp,outp):
""" check if a given port couple works as input (inp) and output (outp) """
self.dio.set_out(outp,0) # Set port output value to 0
self.dio.set_dir(outp,1) # Enable port output
def test_eeprom(self):
""" Check EEPROM I.C. operation """
wr_pattern_length=8 # length of the testing byte pattern
wr_pattern_addr=20 # address at which the pattern is written
wr_pattern=list() # List of patterns to verify
wr_pattern.append([0xFF for n in range(wr_pattern_length)]) # first testing pattern
wr_pattern.append([2**n for n in range(wr_pattern_length)]) # second testing pattern
try:
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(0.8))
ret_error=None
oldedata=self.dio.rd_eeprom(wr_pattern_addr,wr_pattern_length) # Save EEPROM content before testing
time.sleep(0.01)
for pattern in wr_pattern:
self.dio.wr_eeprom(wr_pattern_addr,pattern)
time.sleep(0.01)
edata=self.dio.rd_eeprom(wr_pattern_addr,wr_pattern_length)
time.sleep(0.01)
if edata <> pattern: # If writen data is not correctly recovered
ret_error="TSTERR07: Correct data not read when verifying EEPROM (24AA64T) writting operation"
print ret_error
break
self.dio.wr_eeprom(wr_pattern_addr,oldedata) # Restore EEPROM content before exiting
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
time.sleep(0.010) # wait for the DAC output to stabilize
if not self.dio.get_in(inp): # Low value detected in the input port
self.dio.set_out(outp,1) # Set port output value to 1
try:
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(1.9))
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
time.sleep(0.010) # wait for the DAC output to stabilize
if self.dio.get_in(inp): # High value detected in the output port
ports_working=True
else:
ports_working=False
else:
ports_working=False
self.dio.set_out(outp,0) # Set port output value to 0
self.dio.set_dir(outp,0) # Disable port output
return ports_working
def look_for_working_out_in_port_couple(self):
""" look for a port which works as output and another which works as input """
in_out_port_couple=None
for lemoin, lemoout in ((inp,outp) for inp in range(5) for outp in range(5)):
if lemoout <> lemoin: # Check interconnectivity of different ports only
if self.check_port_couple(lemoin,lemoout): # these ports are connected
in_out_port_couple=[lemoin,lemoout]
break
return in_out_port_couple
def test_port_inter(self):
""" Port (LEMO 00 connectors) interconnection check """
for lemon in range(5):
self.dio.set_term(lemon, 0) # Disable termination resistor
self.dio.set_out(lemon,0) # Set port output value to 0
self.dio.set_dir(lemon,0) # Disable port output
tmp_stdout = sys.stdout
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
raw_input("Plug the interconnection cables in the five LEMO 00 connectors of the fmc-dio-5chttla-board ports and press Enter")
in_out_port_couple=self.look_for_working_out_in_port_couple()
if not in_out_port_couple:
print "TSTERR05: No communication could be performed between any two ports"
msg=self.test_port_out()
emsg=msg[1] # set the new error message reported it by the manual procedure
else:
msg=None # No additional message to be printed
unchecked_ports=list(range(5)) # create a list containing the ports to be checked
# remove the already-checked ports in_out_port_couple
lemoin=in_out_port_couple[0]
lemoout=in_out_port_couple[1]
unchecked_ports.remove(lemoin)
unchecked_ports.remove(lemoout)
faulty_ports=list()
for cport in unchecked_ports:
if not self.check_port_couple(lemoin,cport): # no communication in this way
if not self.check_port_couple(cport,lemoout): # cport is not connected
faulty_ports.append(cport)
#print in_out_port_couple
#print unchecked_ports
#print faulty_ports
if faulty_ports: # Some ports are not correctly interconnected
emsg="TSTERR06: Ports {} do not appear to be correctly connected".format(faulty_ports)
else:
emsg=None
raw_input("Disconnect all the cables from the fmc-dio-5chttla-board ports (in order to perform further tests) and press Enter")
sys.stdout = tmp_stdout
sys.stdin = tmp_stdin
if msg:
print msg[0] # print manual procedure message in case it was performed
if emsg:
print emsg # print result error message
return emsg
def test_port_out(self):
""" Port (LEMO 00 connectors) oscillation check """
print "Connect the testing LEDs to the LEMO 00 connectors of the fmc-dio-5chttla-board ports (120ohm serial resistor included)"
print "¿Are all the connected testing LEDs blinking alternately?"
print "Press Y/N and Enter"
for lemon in range(5): # Disable all termination resistors
self.dio.set_term(lemon, 0)
ans=self.osc_ports()
msg=["The user reported {} operation of board-port outputs".format("a correct" if ans=="Y" else "an incorrect"), "TSTERR01: Operation of fmc-dio-5chttla-board ports as output failed" if ans == "N" else None]
return msg
ret_error="While verifying operation of EEPROM (24AA64T): "+str(e)
return ret_error
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -176,18 +82,22 @@ def main(default_directory="."):
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test Start02"
print "Test02 Start"
print "Checking fmc-dio-5chttla board presence"
init_test_time = time.time()
print "Checking fmc-dio-5chttla board and I2C devices"
test=test02(spec)
print "\nChecking EEPROM I.C. writing and reading operation (24AA64T)"
ret_error=test.test_eeprom()
print "\nChecking connectivity of board ports"
emsg=test.test_port_inter()
end_test_time = time.time()
print "\nEnd of Test02"
print "RESULT: [{}]".format("FAIL" if emsg else "OK")
if emsg:
raise PtsError(emsg)
print "RESULT: [{}]".format("FAIL" if ret_error else "OK")
print 'Test02 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
raise PtsError(ret_error)
if __name__ == "__main__":
main(".")
......
......@@ -6,8 +6,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 1/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
......@@ -15,78 +14,22 @@ from dio_fmc import *
import rr
import os
"""
test03: Check fmc-dio-5chttl-board ports as inputs (DAC, LVDS comparator)
Conditions: fmc-dio-5chttl-board ports work as outputs (test02 passed) and I2C bus works (test00 passed)
test03: Check fmc-dio-5chttl-board DAC presence operation
Conditions: Mezzanine presence line asserted (test00 passed)
User intervention required: No
Procedure details:
- Load firmware.
- Load firmware
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 0 and when it is set to 1
- Initialize the board and its peripherals
- Check that I2C device DAC (DAC5578) is present and respond
"""
class test03:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_in(self):
""" Port (LEMO 00 connectors) input check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors disabled, port outputs enabled)"
port_th=[]
port_warnlow=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 0) # Disable termination resistor
self.dio.set_out(lemon,0) # set port output value to 0
self.dio.set_dir(lemon,1) # Enable port output
try:
th0=self.dio.find_port_voltage(lemon,0.0,0.08) # Find the voltage (threshold) when out=0
self.dio.set_out(lemon,1) # set port output state to 1
th1=self.dio.find_port_voltage(lemon,3.28,3.3) # Find the voltage (threshold) when out=1
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
if th0>0.1:
th0_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
else:
th0_warn="OK "
if th1<3.2:
th1_warn="Warning: Strangely-low value "
port_warnlow.append(lemon)
else:
th1_warn="OK"
print "Port {} apparent input voltage when out=0: {:.3f}V {}".format(lemon,th0,th0_warn)
print "\t\t\t when out=1: {:.3f}V {}".format(th1,th1_warn)
port_th.insert(lemon,[th0,th1])
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon][0]>0.8 or port_th[lemon][1]<2.0: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR02: Proper voltage reading not obtained in ports: {} when output enable=1".format(port_err)]
print ret_error[1]
else:
if port_warnlow or port_warnhigh: # Some warning were generated
warn_msg=""
if port_warnlow:
warn_msg=warn_msg+"TSTWRN00: Strangely-low voltage value obtained in ports: {} when output=1. ".format(port_warnlow)
if port_warnhigh:
warn_msg=warn_msg+"TSTWRN01: Strangely-high voltage value obtained in ports: {} when output=0. ".format(port_warnhigh)
ret_error=["W",warn_msg]
else:
ret_error=None
return ret_error
""" Initialize the board, check PRESENT pin state and DAC presence and response """
self.dio = CFmcDio(spec, 0x80000, False, False, True) # Init I2C DAC device
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -101,24 +44,30 @@ def main(default_directory="."):
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test Start03"
print "Test03 Start"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
test=test03(spec)
print "\nChecking input operation of board ports"
ret_error=test.test_port_in()
print "Checking fmc-dio-5chttla board presence and DAC (CDAC5578) operation"
try:
test=test03(spec)
except CFmcDioError as e:
test_error=e
print str(test_error)
else:
test_error=None
end_test_time = time.time()
print "\nEnd of Test03"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print "RESULT: [{}]".format("FAIL" if test_error else "OK")
print 'Test03 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
if test_error:
err_msg="While fmc-dio-5chttla initialization: "+str(test_error)
if test_error.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
if __name__ == "__main__":
main(".")
......
......@@ -6,31 +6,32 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 1/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
from keyb import *
import rr
import os
import sys
"""
test04: Check output-enable circuit of fmc-dio-5chttl-board ports
Conditions: fmc-dio-5chttl-board ports work as outputs (test02 passed), I2C bus works (test00 passed) and
fmc-dio-5chttl-board ports work as inputs (DAC, LVDS comparator) (test03 passed)
User intervention required: No
test01: Check fmc-dio-5chttl-board LEDs (LED and LED circuit working)
Conditions: Mezzanine presence line asserted (test00 passed)
User intervention required: Yes
Procedure details:
- Load firmware.
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 1 and output enable set to 0
- Load firmware
- Test mezzanine presence line
- Blink fmc-dio-5chttl-board LEDs
"""
class test04:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, True)
self.dio = CFmcDio(spec, 0x80000, False, False, False)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
......@@ -38,45 +39,38 @@ class test04:
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_oe(self):
""" Port (LEMO 00 connectors) output-enable check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors disabled, port outputs disabled)"
port_th=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 1) # Enable termination resistor to accelerate port state change to 0
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,1) # set port output value to 1
self.dio.set_term(lemon, 0) # Disable termination resistor (when port output is stable)
try:
th0=self.dio.find_port_voltage(lemon,0.0,0.08) # Find the voltage (threshold)
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,0) # set port output value to 0
if th0>0.1:
th0_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
else:
th0_warn="OK "
print "Port {} apparent input voltage: {:.3f}V {}".format(lemon,th0,th0_warn)
port_th.insert(lemon,th0)
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon]>0.8: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR03: Proper voltage reading not obtained in ports: {} when output enable=0".format(port_err)]
print ret_error[1]
def test_LEDs(self):
""" LED-blink Check """
tmp_stdout = sys.stdout
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
print "¿Are the two fmc-dio-5chttla-board LEDs blinking alternately?"
print "Press Y/N and Enter"
ans=""
while ans != "Y" and ans != "N":
for nled in range(2):
self.dio.set_led(nled,nled)
time.sleep(0.2)
for nled in range(2):
self.dio.set_led(nled,1-nled)
time.sleep(0.2)
if kbhit():
ans=raw_input().upper()
if ans <> "Y" and ans <> "N":
print "The valid inputs are only Y or N and Enter"
sys.stdout = tmp_stdout
sys.stdin = tmp_stdin
# purgestdin()
for nled in range(2):
self.dio.set_led(nled,0)
print "The user reported {} operation of board LEDs".format("a correct" if ans=="Y" else "an incorrect")
if ans == "N":
emsg="TSTERR00: Operation of fmc-dio-5chttla-board LEDs failed"
print emsg
else:
if port_warnhigh: # Some warning were generated
warn_msg="TSTWRN02: Strangely-high voltage value obtained in ports: {} when output enable=0".format(port_warnhigh)
ret_error=["W",warn_msg]
else:
ret_error=None
return ret_error
emsg=None # test completed successfully
return emsg
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -93,22 +87,16 @@ def main(default_directory="."):
print "Test04 Start"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
print "Checking fmc-dio-5chttla board presence"
test=test04(spec)
print "\nChecking output-enable circuits of board ports"
ret_error=test.test_port_oe()
print "\nChecking LEDs"
emsg=test.test_LEDs()
end_test_time = time.time()
print "\nEnd of Test04"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test04 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
print "RESULT: [{}]".format("FAIL" if emsg else "OK")
if emsg:
raise PtsError(emsg)
if __name__ == "__main__":
main(".")
......
......@@ -6,32 +6,33 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 0.2 (Last modifications: 1/4/2012)
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
from keyb import *
import rr
import os
"""
test05: Check termination resistors of fmc-dio-5chttl-board ports
Conditions: fmc-dio-5chttl-board ports work as outputs (test02 passed), I2C bus works (test00 passed) and
fmc-dio-5chttl-board ports work as inputs (DAC, LVDS comparator) (test03 passed)
User intervention required: No
test02: Check fmc-dio-5chttl-board ports as output (port driver working, connector connectivity and LVDS to LVCMOS IC working)
Conditions: Mezzanine presence line asserted (test00 passed)
User intervention required: Yes*
Procedure details:
- Load firmware.
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 1, output enable set to 0
and termination resistor enabled
- Check that ports work as output
- Using the port interconnection cables: Check that all ports are interconnected.
- If all the communications fail: Using the test cable: Oscillate state of fmc-dio-5chttl-board ports
"""
class test05:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, True)
self.dio = CFmcDio(spec, 0x80000, False, False, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
......@@ -39,52 +40,128 @@ class test05:
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_term(self):
""" Port (LEMO 00 connectors) termination-resistor enable check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors enabled, port outputs enabled)"
port_th=[]
port_warnlow=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 1) # Enable termination resistor
self.dio.set_dir(lemon,1) # Enable port output
self.dio.set_out(lemon,1) # Set port output value to 1
def osc_ports(self):
""" Oscillate state of fmc-dio-5chttl-board ports """
for lemon in range(5): # Disable output of all ports and set them to 1
self.dio.set_dir(lemon,0)
self.dio.set_out(lemon,1)
ans=""
lemon=0
while ans != "Y" and ans != "N":
time.sleep(0.05)
self.dio.set_dir((lemon-1)%5,0)
self.dio.set_dir(lemon,1)
lemon=(lemon+1)%5
if kbhit():
ans=raw_input().upper()
if ans <> "Y" and ans <> "N":
print "The valid inputs are only Y or N and Enter"
for lemon in range(5): # Disable output of all ports
self.dio.set_out(lemon, 0)
self.dio.set_dir(lemon, 0)
return ans
def check_port_couple(self,inp,outp):
""" check if a given port couple works as input (inp) and output (outp) """
self.dio.set_out(outp,0) # Set port output value to 0
self.dio.set_dir(outp,1) # Enable port output
try:
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(0.8))
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
time.sleep(0.010) # wait for the DAC output to stabilize
if not self.dio.get_in(inp): # Low value detected in the input port
self.dio.set_out(outp,1) # Set port output value to 1
try:
th1=self.dio.find_port_voltage(lemon,2.95,3.02) # Find the voltage (threshold)
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(1.9))
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,0) # Set port output value to 0
self.dio.set_term(lemon, 0) # Disable termination resistor
if th1>3.1:
th1_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
elif th1<2.9:
th1_warn="Warning: Strangely-low value "
port_warnlow.append(lemon)
time.sleep(0.010) # wait for the DAC output to stabilize
if self.dio.get_in(inp): # High value detected in the output port
ports_working=True
else:
th1_warn="OK"
print "Port {} apparent input voltage: {:.3f}V {}".format(lemon,th1,th1_warn)
port_th.insert(lemon,th1)
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon]>3.2 or port_th[lemon]<2.8: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR04: Proper voltage reading not obtained in ports: {} when termination resistors enabled".format(port_err)]
print ret_error[1]
ports_working=False
else:
if port_warnlow or port_warnhigh: # Some warning were generated
warn_msg=""
if port_warnlow:
warn_msg=warn_msg+"TSTWRN03: Strangely-low voltage value obtained in ports: {} when termination resistors enabled. ".format(port_warnlow)
if port_warnhigh:
warn_msg=warn_msg+"TSTWRN04: Strangely-high voltage value obtained in ports: {} when termination resistors enabled. ".format(port_warnhigh)
ret_error=["W",warn_msg]
ports_working=False
self.dio.set_out(outp,0) # Set port output value to 0
self.dio.set_dir(outp,0) # Disable port output
return ports_working
def look_for_working_out_in_port_couple(self):
""" look for a port which works as output and another which works as input """
in_out_port_couple=None
for lemoin, lemoout in ((inp,outp) for inp in range(5) for outp in range(5)):
if lemoout <> lemoin: # Check interconnectivity of different ports only
if self.check_port_couple(lemoin,lemoout): # these ports are connected
in_out_port_couple=[lemoin,lemoout]
break
return in_out_port_couple
def test_port_inter(self):
""" Port (LEMO 00 connectors) interconnection check """
for lemon in range(5):
self.dio.set_term(lemon, 0) # Disable termination resistor
self.dio.set_out(lemon,0) # Set port output value to 0
self.dio.set_dir(lemon,0) # Disable port output
tmp_stdout = sys.stdout
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
raw_input("Plug the interconnection cables in the five LEMO-00 connectors of the fmc-dio-5chttla board and press Enter")
in_out_port_couple=self.look_for_working_out_in_port_couple()
if not in_out_port_couple:
print "TSTERR05: No communication could be performed between any two ports"
msg=self.test_port_out()
emsg=msg[1] # set the new error message reported it by the manual procedure
else:
msg=None # No additional message to be printed
unchecked_ports=list(range(5)) # create a list containing the ports to be checked
# remove the already-checked ports in_out_port_couple
lemoin=in_out_port_couple[0]
lemoout=in_out_port_couple[1]
unchecked_ports.remove(lemoin)
unchecked_ports.remove(lemoout)
faulty_ports=list()
for cport in unchecked_ports:
if not self.check_port_couple(lemoin,cport): # no communication in this way
if not self.check_port_couple(cport,lemoout): # cport is not connected
faulty_ports.append(cport)
#print in_out_port_couple
#print unchecked_ports
#print faulty_ports
if faulty_ports: # Some ports are not correctly interconnected
emsg="TSTERR06: Ports {} do not appear to be correctly connected".format(faulty_ports)
else:
ret_error=None
return ret_error
emsg=None
raw_input("Disconnect all the cables from the fmc-dio-5chttla-board ports (in order to perform further tests) and press Enter")
sys.stdout = tmp_stdout
sys.stdin = tmp_stdin
if msg:
print msg[0] # print manual procedure message in case it was performed
if emsg:
print emsg # print result error message
return emsg
def test_port_out(self):
""" Port (LEMO 00 connectors) oscillation check """
print "Connect the testing LEDs to the LEMO 00 connectors of the fmc-dio-5chttla-board ports (120ohm serial resistor included)"
print "¿Are all the connected testing LEDs blinking alternately?"
print "Press Y/N and Enter"
for lemon in range(5): # Disable all termination resistors
self.dio.set_term(lemon, 0)
ans=self.osc_ports()
msg=["The user reported {} operation of board-port outputs".format("a correct" if ans=="Y" else "an incorrect"), "TSTERR01: Operation of fmc-dio-5chttla-board ports as output failed" if ans == "N" else None]
return msg
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......@@ -99,24 +176,18 @@ def main(default_directory="."):
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test05 Start"
print "Test Start05"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
print "Checking fmc-dio-5chttla board presence"
test=test05(spec)
print "\nChecking output-enable circuits of board ports"
ret_error=test.test_port_term()
print "\nChecking connectivity of board ports"
emsg=test.test_port_inter()
end_test_time = time.time()
print "\nEnd of Test05"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test05 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
print "RESULT: [{}]".format("FAIL" if emsg else "OK")
if emsg:
raise PtsError(emsg)
if __name__ == "__main__":
main(".")
......
#!/usr/bin/python
#coding: utf8
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
import rr
import os
"""
test06: Check fmc-dio-5chttl-board ports as inputs (DAC, LVDS comparator)
Conditions: fmc-dio-5chttl-board ports work as outputs (test05 passed) and DAC works (test03 passed)
User intervention required: No
Procedure details:
- Load firmware.
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 0 and when it is set to 1
"""
class test06:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, False, False, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_in(self):
""" Port (LEMO 00 connectors) input check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors disabled, port outputs enabled)"
port_th=[]
port_warnlow=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 0) # Disable termination resistor
self.dio.set_out(lemon,0) # set port output value to 0
self.dio.set_dir(lemon,1) # Enable port output
try:
th0=self.dio.find_port_voltage(lemon,0.0,0.08) # Find the voltage (threshold) when out=0
self.dio.set_out(lemon,1) # set port output state to 1
th1=self.dio.find_port_voltage(lemon,3.28,3.3) # Find the voltage (threshold) when out=1
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
if th0>0.1:
th0_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
else:
th0_warn="OK "
if th1<3.2:
th1_warn="Warning: Strangely-low value "
port_warnlow.append(lemon)
else:
th1_warn="OK"
print "Port {} apparent input voltage when out=0: {:.3f}V {}".format(lemon,th0,th0_warn)
print "\t\t\t when out=1: {:.3f}V {}".format(th1,th1_warn)
port_th.insert(lemon,[th0,th1])
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon][0]>0.8 or port_th[lemon][1]<2.0: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR02: Proper voltage reading not obtained in ports: {} when output enable=1".format(port_err)]
print ret_error[1]
else:
if port_warnlow or port_warnhigh: # Some warning were generated
warn_msg=""
if port_warnlow:
warn_msg=warn_msg+"TSTWRN00: Strangely-low voltage value obtained in ports: {} when output=1. ".format(port_warnlow)
if port_warnhigh:
warn_msg=warn_msg+"TSTWRN01: Strangely-high voltage value obtained in ports: {} when output=0. ".format(port_warnhigh)
ret_error=["W",warn_msg]
else:
ret_error=None
return ret_error
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
path_fpga_loader = '../firmwares/fpga_loader'
path_firmware = '../firmwares/spec_top.bin'
firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware)
print "Loading firmware: %s" % (firmware_loader + ' ' + bitstream)
os.system( firmware_loader + ' ' + bitstream )
# Load board library and open the corresponding device
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test Start06"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
test=test06(spec)
print "\nChecking input operation of board ports"
ret_error=test.test_port_in()
end_test_time = time.time()
print "\nEnd of Test06"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test06 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
if __name__ == "__main__":
main(".")
#!/usr/bin/python
#coding: utf8
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
import rr
import os
"""
test07: Check output-enable circuit of fmc-dio-5chttl-board ports
Conditions: fmc-dio-5chttl-board ports work as outputs (test05 passed), DAC works (test03 passed) and fmc-dio-5chttl-board ports work as inputs (DAC, LVDS comparator) (test06 passed)
User intervention required: No
Procedure details:
- Load firmware.
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 1 and output enable set to 0
"""
class test07:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, False, False, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_oe(self):
""" Port (LEMO 00 connectors) output-enable check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors disabled, port outputs disabled)"
port_th=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 1) # Enable termination resistor to accelerate port state change to 0
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,1) # set port output value to 1
self.dio.set_term(lemon, 0) # Disable termination resistor (when port output is stable)
try:
th0=self.dio.find_port_voltage(lemon,0.0,0.08) # Find the voltage (threshold)
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,0) # set port output value to 0
if th0>0.1:
th0_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
else:
th0_warn="OK "
print "Port {} apparent input voltage: {:.3f}V {}".format(lemon,th0,th0_warn)
port_th.insert(lemon,th0)
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon]>0.8: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR03: Proper voltage reading not obtained in ports: {} when output enable=0".format(port_err)]
print ret_error[1]
else:
if port_warnhigh: # Some warning were generated
warn_msg="TSTWRN02: Strangely-high voltage value obtained in ports: {} when output enable=0".format(port_warnhigh)
ret_error=["W",warn_msg]
else:
ret_error=None
return ret_error
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
path_fpga_loader = '../firmwares/fpga_loader'
path_firmware = '../firmwares/spec_top.bin'
firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware)
print "Loading firmware: %s" % (firmware_loader + ' ' + bitstream)
os.system( firmware_loader + ' ' + bitstream )
# Load board library and open the corresponding device
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test07 Start"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
test=test07(spec)
print "\nChecking output-enable circuits of board ports"
ret_error=test.test_port_oe()
end_test_time = time.time()
print "\nEnd of Test07"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test07 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
if __name__ == "__main__":
main(".")
#!/usr/bin/python
#coding: utf8
# Copyright CERN, 2012 (Seven Solutions S.L.)
# Author: Richard Carrillo <rcarrillo(AT)sevensols.com>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 1.0 (Last modifications: 29/4/2012)
from ptsexcept import *
from dio_fmc import *
import rr
import os
"""
test08: Check termination resistors of fmc-dio-5chttl-board ports
Conditions: fmc-dio-5chttl-board ports work as outputs (test05 passed), DAC works (test03 passed) and fmc-dio-5chttl-board ports work as inputs (DAC, LVDS comparator) (test06 passed)
User intervention required: No
Procedure details:
- Load firmware.
- Test mezzanine presence line.
- Check the voltage of all ports (by means of the internal DAC) when port output set to 1, output enable set to 0 and termination resistor enabled
"""
class test08:
def __init__(self, spec):
""" check FMC PRESENT-pin state """
try:
self.dio = CFmcDio(spec, 0x80000, False, False, True)
except CFmcDioError as e:
err_msg="While fmc-dio-5chttla initialization: "+str(e)
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
def test_port_term(self):
""" Port (LEMO 00 connectors) termination-resistor enable check """
print "Ensure that nothing is connected to the fmc-dio-5chttla-board ports"
print "(Termination resistors enabled, port outputs enabled)"
port_th=[]
port_warnlow=[]
port_warnhigh=[]
for lemon in range(5):
self.dio.set_term(lemon, 1) # Enable termination resistor
self.dio.set_dir(lemon,1) # Enable port output
self.dio.set_out(lemon,1) # Set port output value to 1
try:
th1=self.dio.find_port_voltage(lemon,2.95,3.02) # Find the voltage (threshold)
except CFmcDioError as e:
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_dir(lemon,0) # Disable port output
self.dio.set_out(lemon,0) # Set port output value to 0
self.dio.set_term(lemon, 0) # Disable termination resistor
if th1>3.1:
th1_warn="Warning: Strangely-high value "
port_warnhigh.append(lemon)
elif th1<2.9:
th1_warn="Warning: Strangely-low value "
port_warnlow.append(lemon)
else:
th1_warn="OK"
print "Port {} apparent input voltage: {:.3f}V {}".format(lemon,th1,th1_warn)
port_th.insert(lemon,th1)
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon]>3.2 or port_th[lemon]<2.8: # normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR04: Proper voltage reading not obtained in ports: {} when termination resistors enabled".format(port_err)]
print ret_error[1]
else:
if port_warnlow or port_warnhigh: # Some warning were generated
warn_msg=""
if port_warnlow:
warn_msg=warn_msg+"TSTWRN03: Strangely-low voltage value obtained in ports: {} when termination resistors enabled. ".format(port_warnlow)
if port_warnhigh:
warn_msg=warn_msg+"TSTWRN04: Strangely-high voltage value obtained in ports: {} when termination resistors enabled. ".format(port_warnhigh)
ret_error=["W",warn_msg]
else:
ret_error=None
return ret_error
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
path_fpga_loader = '../firmwares/fpga_loader'
path_firmware = '../firmwares/spec_top.bin'
firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware)
print "Loading firmware: %s" % (firmware_loader + ' ' + bitstream)
os.system( firmware_loader + ' ' + bitstream )
# Load board library and open the corresponding device
print "Loading hardware access library and opening device\n"
spec = rr.Gennum()
print "Test08 Start"
init_test_time = time.time()
print "Configuring and checking fmc-dio-5chttla devices"
test=test08(spec)
print "\nChecking output-enable circuits of board ports"
ret_error=test.test_port_term()
end_test_time = time.time()
print "\nEnd of Test08"
print "RESULT: [{}]".format("FAIL" if ret_error and ret_error[0]=="E" else ("OK with warnings" if ret_error and ret_error[0]=="W" else "OK"))
print 'Test08 elapsed time: {:.2f} seconds'.format(end_test_time-init_test_time)
if ret_error:
if ret_error[0]=="W": # Warning message returned by test funciton
raise PtsWarning(ret_error[1])
else: # Error message returned by test funciton
raise PtsError(ret_error[1])
if __name__ == "__main__":
main(".")
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