Commit 2ef248ae authored by Matthieu Cattin's avatar Matthieu Cattin

test00: Fix firmware path to make it work when called by pts module.

Add a few comments in fmc_adc module.
parent 2a996bbc
......@@ -192,7 +192,7 @@ class CFmcAdc100m:
WAIT_TIME_OUT = 2
"""
def channel_addr(self, channel, reg):
if(channel < 1 or channel > 4):
raise FmcAdc100mOperationError("Channel number not in range (1 to 4).")
......@@ -200,6 +200,7 @@ class CFmcAdc100m:
addr = (reg + (0x10*(channel - 1)))
#print("Channel %d address: %.2X") % (channel, addr)
return addr
"""
def __init__(self, bus):
self.bus = bus
......@@ -280,6 +281,10 @@ class CFmcAdc100m:
print("Test pattern : %.4X") % self.adc_cfg.get_testpat()
print("Test pattern status : %.1X") % self.adc_cfg.get_testpat_stat()
#======================================================================
# Onewire thermometer and unique ID
# print FMC unique ID
def print_unique_id(self):
try:
......@@ -310,6 +315,9 @@ class CFmcAdc100m:
except DS18B20OperationError as e:
raise FmcAdc100mOperationError(e)
#======================================================================
# I2C buses
# scan FMC i2c bus
def i2c_scan(self):
print '\nScanning FMC I2C bus'
......@@ -754,6 +762,10 @@ class CFmcAdc100m:
except CSRDeviceOperationError as e:
raise FmcAdc100mOperationError(e)
#======================================================================
# Si570 programmable oscillator
# Print Si570 config
def print_si570_config(self):
try:
......
......@@ -12,7 +12,7 @@ import sys
import time
import os
# Add common modules location tp path
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
......@@ -32,14 +32,16 @@ test00: Load firmware, verify firmware type and test mezzanine presence line.
def main (default_directory='.'):
# Constants declaration
TEST_NB = 0
#FMC_ADC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_ADC_BITSTREAM = '../firmwares/spec_fmcadc100m14b4cha.bin'
FMC_ADC_BITSTREAM = os.path.join(default_directory, FMC_ADC_BITSTREAM)
EXPECTED_BITSTREAM_TYPE = 0x1
start_test_time = time.time()
print "\n================================================================================"
print "==> Test00 start\n"
print "==> Test%02d start\n" % TEST_NB
# SPEC object declaration
print "Loading hardware access library and opening device.\n"
......@@ -70,10 +72,10 @@ def main (default_directory='.'):
# Print carrier CSR registers
carrier.print_csr()
print "==> End of test00"
print "==> End of test%02d" % TEST_NB
print "================================================================================"
end_test_time = time.time()
print "Test00 elapsed time: %.2f seconds\n" % (end_test_time-start_test_time)
print "Test%02d elapsed time: %.2f seconds\n" % (TEST_NB, end_test_time-start_test_time)
if __name__ == '__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