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