Commit c52d7107 authored by Matthieu Cattin's avatar Matthieu Cattin

test many: Remove sys.path.append(), fix import order.

parent 0ba13e1e
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test12: Takes an acquisition of each channels separately and print it to a file and on the screen test12: Takes an acquisition of each channels separately and print it to a file and on the screen
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
import rr
from ptsexcept import *
# Import specific modules # Import specific modules
from numpy import * from numpy import *
from pylab import * from pylab import *
...@@ -32,6 +23,10 @@ import find_usb_tty ...@@ -32,6 +23,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
import rr
from ptsexcept import *
""" """
test17: Plot all channels test17: Plot all channels
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from numpy import * from numpy import *
from pylab import * from pylab import *
...@@ -29,6 +20,10 @@ import find_usb_tty ...@@ -29,6 +20,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test18: Test calibration box test18: Test calibration box
......
...@@ -12,17 +12,6 @@ import sys ...@@ -12,17 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
sys.path.append('../../fmceeprom/python/')
# Import common modules
from ptsexcept import *
from fmc_eeprom import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -35,6 +24,11 @@ from PAGE.Agilent33250A import * ...@@ -35,6 +24,11 @@ from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
from ctypes import * from ctypes import *
# Import common modules
from ptsexcept import *
from fmc_eeprom import *
import rr
""" """
......
...@@ -13,18 +13,13 @@ import time ...@@ -13,18 +13,13 @@ import time
import os import os
import re import re
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from cp210x_eeprom import *
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
from cp210x_eeprom import *
""" """
test21: Store calibration data to CP2103 EEPROM test21: Store calibration data to CP2103 EEPROM
......
...@@ -13,20 +13,15 @@ import time ...@@ -13,20 +13,15 @@ import time
import os import os
import re import re
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from cp210x_eeprom import * from cp210x_eeprom import *
from ctypes import * from ctypes import *
import find_usb_tty import find_usb_tty
# Import common modules
from ptsexcept import *
import rr
""" """
test24: Read calibration data from CP2103 EEPROM test24: Read calibration data from CP2103 EEPROM
......
...@@ -12,21 +12,15 @@ import sys ...@@ -12,21 +12,15 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
sys.path.append('../../fmceeprom/python/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
from fmc_eeprom import * from fmc_eeprom import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test26: Read FMC EEPROM test26: Read FMC EEPROM
......
...@@ -11,20 +11,15 @@ import sys ...@@ -11,20 +11,15 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
from numpy import * from numpy import *
# Import common modules
from ptsexcept import *
import rr
""" """
test27: Test DMA test27: Test DMA
......
...@@ -12,17 +12,7 @@ import os ...@@ -12,17 +12,7 @@ import os
import math import math
import random as rdm import random as rdm
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
from numpy import * from numpy import *
...@@ -34,6 +24,10 @@ from find_usb_tty import * ...@@ -34,6 +24,10 @@ from find_usb_tty import *
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test28: Long term test test28: Long term test
......
...@@ -12,21 +12,15 @@ import time ...@@ -12,21 +12,15 @@ import time
import datetime import datetime
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
sys.path.append('../../fmceeprom/python/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
from fmc_eeprom import * from fmc_eeprom import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test29: Checks FMC EEPROM for existing data test29: Checks FMC EEPROM for existing data
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test30: Test software reset. test30: Test software reset.
......
...@@ -13,21 +13,15 @@ import time ...@@ -13,21 +13,15 @@ import time
import datetime import datetime
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
sys.path.append('../../fmceeprom/python/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
from fmc_eeprom import * from fmc_eeprom import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test31: Fix EEPROM content: test31: Fix EEPROM content:
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -33,6 +24,10 @@ from PAGE.SineWaveform import * ...@@ -33,6 +24,10 @@ from PAGE.SineWaveform import *
import scipy.optimize as optimize import scipy.optimize as optimize
import scipy.fftpack as fftpack import scipy.fftpack as fftpack
# Import common modules
from ptsexcept import *
import rr
""" """
test32: Test decimation test32: Test decimation
......
...@@ -12,21 +12,15 @@ import sys ...@@ -12,21 +12,15 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
sys.path.append('../../fmceeprom/python/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
from fmc_eeprom import * from fmc_eeprom import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test33: Write FMC EEPROM test33: Write FMC EEPROM
......
...@@ -12,20 +12,14 @@ import sys ...@@ -12,20 +12,14 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test34: Test interrupts (EIC + VIC) test34: Test interrupts (EIC + VIC)
......
...@@ -12,18 +12,13 @@ import sys ...@@ -12,18 +12,13 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
""" """
test35: Prints carrier CSR (without loading the gateware) test35: Prints carrier CSR (without loading the gateware)
......
...@@ -12,19 +12,14 @@ import sys ...@@ -12,19 +12,14 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/') from fmc_adc import *
sys.path.append('../../../common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
from fmc_adc import *
""" """
test36: Test SDB records test36: Test SDB records
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test37: Test trigger timetags (single and multi shot modes) test37: Test trigger timetags (single and multi shot modes)
......
...@@ -12,18 +12,13 @@ import sys ...@@ -12,18 +12,13 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path # Import specific modules
sys.path.append('../../../') from fmc_adc_spec import *
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
from fmc_adc_spec import *
""" """
test38: Load gateware, try to access to an un-mapped wishbone address -> the host shouldn't hang! test38: Load gateware, try to access to an un-mapped wishbone address -> the host shouldn't hang!
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test39: Tests saturation with/without gain/offset correction test39: Tests saturation with/without gain/offset correction
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -32,6 +23,10 @@ import find_usb_tty ...@@ -32,6 +23,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test40: Tests hardware internal trigger (threshold, deglitch) test40: Tests hardware internal trigger (threshold, deglitch)
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test41: Tests shots counter test41: Tests shots counter
......
...@@ -12,21 +12,17 @@ import sys ...@@ -12,21 +12,17 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
from numpy import * from numpy import *
from pylab import * from pylab import *
# Import common modules
from ptsexcept import *
import rr
""" """
test42: Tests sampling frequency counter test42: Tests sampling frequency counter
""" """
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -31,6 +22,10 @@ import find_usb_tty ...@@ -31,6 +22,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test43: Tests saturation (-> no wraparound) test43: Tests saturation (-> no wraparound)
......
...@@ -12,15 +12,6 @@ import sys ...@@ -12,15 +12,6 @@ import sys
import time import time
import os import os
# Add common modules and libraries location to path
sys.path.append('../../../')
sys.path.append('../../../gnurabbit/python/')
sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
import rr
# Import specific modules # Import specific modules
from fmc_adc_spec import * from fmc_adc_spec import *
from fmc_adc import * from fmc_adc import *
...@@ -32,6 +23,10 @@ import find_usb_tty ...@@ -32,6 +23,10 @@ import find_usb_tty
from PAGE.Agilent33250A import * from PAGE.Agilent33250A import *
from PAGE.SineWaveform import * from PAGE.SineWaveform import *
# Import common modules
from ptsexcept import *
import rr
""" """
test44: Tests external trigger and datapath delay difference. test44: Tests external trigger and datapath delay difference.
...@@ -184,7 +179,7 @@ def main (default_directory='.'): ...@@ -184,7 +179,7 @@ def main (default_directory='.'):
# Constants declaration # Constants declaration
TEST_NB = 44 TEST_NB = 44
FMC_ADC_BITSTREAM = '../firmwares/spec_fmcadc100m14b4cha.bin' FMC_ADC_BITSTREAM = '../gatewares/spec_fmcadc100m14b4cha.bin'
FMC_ADC_BITSTREAM = os.path.join(default_directory, FMC_ADC_BITSTREAM) FMC_ADC_BITSTREAM = os.path.join(default_directory, FMC_ADC_BITSTREAM)
EXPECTED_BITSTREAM_TYPE = 0x1 EXPECTED_BITSTREAM_TYPE = 0x1
...@@ -210,16 +205,16 @@ def main (default_directory='.'): ...@@ -210,16 +205,16 @@ def main (default_directory='.'):
print "Loading hardware access library and opening device.\n" print "Loading hardware access library and opening device.\n"
spec = rr.Gennum() spec = rr.Gennum()
# Load FMC ADC firmware # Load FMC ADC gateware
print "Loading FMC ADC firmware: %s\n" % FMC_ADC_BITSTREAM print "Loading FMC ADC gateware: %s\n" % FMC_ADC_BITSTREAM
if(os.path.isfile(FMC_ADC_BITSTREAM)): if(os.path.isfile(FMC_ADC_BITSTREAM)):
spec.load_firmware(FMC_ADC_BITSTREAM) spec.load_gateware(FMC_ADC_BITSTREAM)
time.sleep(2) time.sleep(2)
else: else:
raise PtsCritical("Firmware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM) raise PtsCritical("Gateware file \"%s\" is missing, test stopped." % FMC_ADC_BITSTREAM)
# Carrier object declaration (SPEC board specific part) # Carrier object declaration (SPEC board specific part)
# Used to check that the firmware is loaded. # Used to check that the gateware is loaded.
try: try:
carrier = CFmcAdc100mSpec(spec, EXPECTED_BITSTREAM_TYPE) carrier = CFmcAdc100mSpec(spec, EXPECTED_BITSTREAM_TYPE)
except FmcAdc100mSpecOperationError as e: except FmcAdc100mSpecOperationError as e:
...@@ -233,7 +228,7 @@ def main (default_directory='.'): ...@@ -233,7 +228,7 @@ def main (default_directory='.'):
try: try:
"""
# Others objects declaration # Others objects declaration
usb_tty = find_usb_tty.CttyUSB() usb_tty = find_usb_tty.CttyUSB()
awg_tty = usb_tty.find_usb_tty(AWG_USB_VENDOR_ID, AWG_USB_PRODUCT_ID) awg_tty = usb_tty.find_usb_tty(AWG_USB_VENDOR_ID, AWG_USB_PRODUCT_ID)
...@@ -241,7 +236,7 @@ def main (default_directory='.'): ...@@ -241,7 +236,7 @@ def main (default_directory='.'):
gen = Agilent33250A(device=awg_tty[0], bauds=AWG_BAUD) gen = Agilent33250A(device=awg_tty[0], bauds=AWG_BAUD)
sine = SineWaveform() sine = SineWaveform()
box = CCalibr_box(box_tty[0]) box = CCalibr_box(box_tty[0])
"""
# Initialise fmc adc # Initialise fmc adc
fmc_adc_init(spec, fmc) fmc_adc_init(spec, fmc)
...@@ -323,15 +318,16 @@ def main (default_directory='.'): ...@@ -323,15 +318,16 @@ def main (default_directory='.'):
################################################## ##################################################
# Set awg sine params # Set awg sine params
################################################## ##################################################
#sine.frequency = 20E3 sine.frequency = 1E3
#sine.amplitude = 0.4 * ADC_FS[IN_RANGE] sine.amplitude = 0.4 * ADC_FS[IN_RANGE]
#sine.dc = 0 sine.dc = 0
#print "\nSine frequency:%3.3fMHz amplitude:%2.3fVp offset:%2.3fV" % (sine.frequency/1E6, sine.amplitude, sine.dc) #print "\nSine frequency:%3.3fMHz amplitude:%2.3fVp offset:%2.3fV" % (sine.frequency/1E6, sine.amplitude, sine.dc)
# Set AWG # Set AWG
#gen.connect() gen.connect()
#gen.play(sine) gen.play(sine)
#gen.output = True #gen.output = True
#time.sleep(AWG_SET_SLEEP) gen.sync = True
time.sleep(AWG_SET_SLEEP)
################################################## ##################################################
# Configure analogue input # Configure analogue input
...@@ -477,8 +473,9 @@ def main (default_directory='.'): ...@@ -477,8 +473,9 @@ def main (default_directory='.'):
open_all_channels(fmc) open_all_channels(fmc)
# Switch AWG OFF # Switch AWG OFF
#gen.output = False gen.output = False
#gen.close() gen.sync = False
gen.close()
# Check if an error occured during frequency response test # Check if an error occured during frequency response test
# if(error != 0): # if(error != 0):
......
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