Commit c665e3a9 authored by Evangelia Gousiou's avatar Evangelia Gousiou

rewrote all the functionality tests so as to make use of the pendulum rather…

rewrote all the functionality tests so as to make use of the pendulum rather than a Fine Delay board; like this the setup for the functionality and the calibration tests is the same
parent 58136c35
...@@ -5,10 +5,20 @@ ...@@ -5,10 +5,20 @@
# Licence: GPL v2 or later. # Licence: GPL v2 or later.
# Website: http://www.ohwr.org # Website: http://www.ohwr.org
LOGDIR=./log_fmctdc1ns5cha
sudo rmmod cp210x
cd ~/fmc-tdc-1ns-5cha-tst/pts
sudo insmod ./cp210x-driver/cp210x.ko
cd usbdriver
sudo ./usbtmc_load
cd ..
cd ~/fmc-tdc-1ns-5cha-tst/pts
LOGDIR=../logs/log_fmctdc1ns5cha
mkdir -p $LOGDIR mkdir -p $LOGDIR
sudo rm -fr $LOGDIR/pts* sudo rm -fr $LOGDIR/fmc-tdc-1ns-5cha-tst*
serial=$1 serial=$1
if [ x$1 = x"" ]; then if [ x$1 = x"" ]; then
...@@ -47,7 +57,18 @@ do ...@@ -47,7 +57,18 @@ do
echo "Test series run $nb_test out of $nb_test_limit" echo "Test series run $nb_test out of $nb_test_limit"
echo " " echo " "
sudo ./pts.py -b FmcTdc1ns5cha -s $serial -e $extra_serial -t./test/fmctdc1ns5cha/python -l $LOGDIR 00 01 02 03 04 05 06 07 08 09 10 11 12 echo "--- Functionality tests ---"
sudo ./pts.py -b FmcTdc1ns5cha_funct -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/functionality/python -l $LOGDIR 00 #01 02 03 04 05 06 07 08 09 10 11 12
echo -n "Do you wish to continue with the calibration tests [y,n]? "
read reply
if [ "$reply" = "y" ]
then
echo "--- Calibration tests ---\n"
LOGDIR=../logs/log_fmctdc1ns5cha_calib
sudo ./pts.py -b FmcTdc1ns5cha_calib -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/calibration/python -l $LOGDIR 16 17 18 #13 14 15 16 17 18
fi
if [ "$nb_test" != "$nb_test_limit" ] if [ "$nb_test" != "$nb_test_limit" ]
then then
......
...@@ -56,7 +56,8 @@ do ...@@ -56,7 +56,8 @@ do
echo "Test series run $nb_test out of $nb_test_limit" echo "Test series run $nb_test out of $nb_test_limit"
echo " " echo " "
sudo ./pts.py -b FmcTdc1ns5cha -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/calibration/python -l $LOGDIR 00 01 02 03 echo "--- Calibration tests ---"
sudo ./pts.py -b FmcTdc1ns5cha_calib -s $serial -e $extra_serial -t ../test/fmctdc1ns5cha/calibration/python -l $LOGDIR 13 14 15 16 17 18
if [ "$nb_test" != "$nb_test_limit" ] if [ "$nb_test" != "$nb_test_limit" ]
then then
......
#!/bin/sh
# Copyright CERN, 2011
# Author: Evangelia Gousiou <egousiou@cern.ch>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
sudo rmmod cp210x
cd ~/pts_cleanup
sudo insmod ./cp210x-driver/cp210x.ko
cd usbdriver
sudo ./usbtmc_load
cd ..
LOGDIR=./log_fmctdc1ns5cha_wrcalib
mkdir -p $LOGDIR
sudo rm -fr $LOGDIR/pts*
serial=$1
if [ x$1 = x"" ]; then
echo -n "Please scan CERN serial number bar-code, then press [ENTER]: "
read serial
fi
if [ x$serial = x"" ]; then
serial=0000
fi
if [ -e serial.txt ]; then
sudo rm -f serial.txt
fi
echo $serial >> serial.txt
extra_serial=$2
if [ x$2 = x"" ]; then
echo -n "If needed input extra serial number and press [ENTER] OR just press [ENTER]: "
read extra_serial
fi
if [ x$extra_serial = x"" ]; then
extra_serial=0000
fi
echo " "
nb_test_limit=2
nb_test=1
while [ "$nb_test" -le "$nb_test_limit" ]
do
echo "--------------------------------------------------------------"
echo "Test series run $nb_test out of $nb_test_limit"
echo " "
sudo ./pts.py -b FmcTdc1ns5cha -s $serial -e $extra_serial -t./test/fmctdc1ns5cha/calibration/python -l $LOGDIR 00 01 02 03 04 05
if [ "$nb_test" != "$nb_test_limit" ]
then
echo " "
echo -n "Do you want to run the test series again [y,n]? "
read reply
if [ "$reply" != "y" ]
then
break
fi
fi
nb_test=$(($nb_test+1))
done
echo "--------------------------------------------------------------"
echo " "
echo -n "End of the test, do you want to switch the computer OFF? [y,n]"
read reply
if [ "$reply" = "y" ]
then
sudo poweroff
fi
...@@ -13,7 +13,7 @@ class CCP210x: ...@@ -13,7 +13,7 @@ class CCP210x:
self.fd = open(device, 'wb') self.fd = open(device, 'wb')
def gpio_set(self, mask): def gpio_set(self, mask):
print("gpio_set %x" % mask), #print("gpio_set %x" % mask),
f = array.array('L', [0]) f = array.array('L', [0])
f[0] = (mask << 8) | 0xff; f[0] = (mask << 8) | 0xff;
fcntl.ioctl(self.fd, 0x8001, f, 0) fcntl.ioctl(self.fd, 0x8001, f, 0)
......
...@@ -109,7 +109,7 @@ BOX_USB_DEVICE_ID = 0xea60 # CP210x Composite Device ...@@ -109,7 +109,7 @@ BOX_USB_DEVICE_ID = 0xea60 # CP210x Composite Device
TEMPID_FAMILY_CODE = 0x28 TEMPID_FAMILY_CODE = 0x28
TEMP_THRES = 46.0 TEMP_THRES = 43.0
TEMP_RIPPLE = 0.3 TEMP_RIPPLE = 0.3
FIFO_SIZE = 20 FIFO_SIZE = 20
MEAS_SLEEP = 1 MEAS_SLEEP = 1
......
...@@ -58,7 +58,7 @@ from numpy import * ...@@ -58,7 +58,7 @@ from numpy import *
from ctypes import * from ctypes import *
from datetime import datetime from datetime import datetime
# Add common modules location tp path # Add common modules location to path
sys.path.append('../../../../pts/') sys.path.append('../../../../pts/')
sys.path.append('../../../../pts/gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../../pts/common/') sys.path.append('../../../../pts/common/')
......
#! /bin/bash #! /bin/bash
ln -s ch_calib.py test00.py ln -s ch_calib.py test13.py
ln -s DAC_calib.py test01.py ln -s DAC_calib.py test14.py
ln -s write_eeprom.py test02.py ln -s write_eeprom.py test15.py
ln -s verify_calib.py test03.py ln -s verify_calib.py test16.py
ln -s wrabbit_calib.py test04.py ln -s wrabbit_calib.py test17.py
ln -s wrabbit_write_eeprom.py test05.py ln -s wrabbit_write_eeprom.py test18.py
#! /bin/bash #! /bin/bash
rm -f test00.py rm -f test13.py
rm -f test01.py rm -f test14.py
rm -f test02.py rm -f test15.py
rm -f test03.py rm -f test16.py
rm -f test04.py rm -f test18.py
rm -f test05.py rm -f test18.py
rm -f test*.pyc rm -f test*.pyc
\ No newline at end of file rm -f test*.py~
...@@ -74,12 +74,12 @@ import math ...@@ -74,12 +74,12 @@ import math
from datetime import datetime from datetime import datetime
# Add common modules location to path # Add common modules location to path
sys.path.append('../../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../../common/') sys.path.append('../../../../pts/common/')
sys.path.append('../../../../common/cp210x') sys.path.append('../../../../pts/common/fmceeprom/python')
sys.path.append('../../../../common/usb_box') sys.path.append('../../../../pts/common/usb_box')
sys.path.append('../../../fmceeprom/python/') sys.path.append('../../../../pts/common/cp210x')
# Import common modules # Import common modules
...@@ -147,7 +147,7 @@ def main (default_directory='.'): ...@@ -147,7 +147,7 @@ def main (default_directory='.'):
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/wrabbit_tdc.bin' FMC_TDC_BITSTREAM_PATH = '../firmwares/wrabbit_tdc.bin'
FPGA_LOADER_PATH = '../../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
FAMILY_CODE = 0x28 FAMILY_CODE = 0x28
WRABBIT_CLK_LOCK_MASK = 0x10 WRABBIT_CLK_LOCK_MASK = 0x10
WRABBIT_CALIB_FILENAME = "wrabbit_calib_data.txt" WRABBIT_CALIB_FILENAME = "wrabbit_calib_data.txt"
......
...@@ -58,10 +58,12 @@ import os ...@@ -58,10 +58,12 @@ import os
import numpy as np import numpy as np
# Add common modules and libraries location to path # Add common modules and libraries location to path
sys.path.append('../../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../../common/') sys.path.append('../../../../pts/common/')
sys.path.append('../../../fmceeprom/python/') sys.path.append('../../../../pts/common/fmceeprom/python')
sys.path.append('../../../../pts/common/usb_box')
sys.path.append('../../../../pts/common/cp210x')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
...@@ -106,9 +108,9 @@ def main (default_directory='.'): ...@@ -106,9 +108,9 @@ def main (default_directory='.'):
start_test_time = time.time() start_test_time = time.time()
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@0001:0000'#'1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc.bin'#spec-fmc-tdcDBG.bin' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc.bin'
FPGA_LOADER_PATH = '../../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
......
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
## | ## |
## Description Testing of the communication with the ACAM chip IC8 of the TDC board. | ## Description Testing of the communication with the ACAM chip IC8 of the TDC board. |
## The test configures the ACAM chip and then checks the status of all its registers.| ## The test configures the ACAM chip and then checks the status of all its registers.|
## In detal these lines are tested: TDC_D[27..0], TDC_ADR[3..0], RESET_N, TDC_WRN, | ## In detail these lines are tested: TDC_D[27..0], TDC_ADR[3..0], RESET_N, TDC_WRN, |
## TDC_RDN, TDC_CSN, TDC_OEN | ## TDC_RDN, TDC_CSN, TDC_OEN |
## | ## |
## | ## |
## FW to load .bin | ## FW to load tdc_allothertests.bit |
## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) | ## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) |
## Website http://www.ohwr.org/projects/pts | ## Website http://www.ohwr.org/projects/pts |
## Date 11/01/2013 | ## Date 11/01/2013 |
...@@ -50,16 +50,14 @@ import math ...@@ -50,16 +50,14 @@ import math
from datetime import datetime from datetime import datetime
# Add common modules location tp path # Add common modules location tp path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
import csr import csr
# Import specific modules
import fmc_tdc import fmc_tdc
...@@ -69,11 +67,16 @@ import fmc_tdc ...@@ -69,11 +67,16 @@ import fmc_tdc
def main (default_directory='.'): def main (default_directory='.'):
start_test_time = time.time()
#-----> PCIe address, firmware, loader constants
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
...@@ -81,8 +84,9 @@ def main (default_directory='.'): ...@@ -81,8 +84,9 @@ def main (default_directory='.'):
print "\n-------------------------------------------------------------------" print "\n-------------------------------------------------------------------"
print "----------------------------- FMC TDC -----------------------------" print "----------------------------- FMC TDC -----------------------------"
print "-------------------- ACAM IC8 communication test ------------------\n" print "-------------------- ACAM IC8 communication test ------------------\n"
print ("Testing of the communication with the ACAM chip IC8." print ("Testing of the communication with the ACAM chip IC8.\n"
" The test\nconfigures the ACAM and then checks the status of its registers.\n") "The test configures the ACAM and then checks the status of all\n"
"its registers.\n")
print "\n_______________________________Info______________________________\n" print "\n_______________________________Info______________________________\n"
print "FMC TDC address to parse: %s"%(FMC_TDC_ADDR) print "FMC TDC address to parse: %s"%(FMC_TDC_ADDR)
...@@ -121,6 +125,8 @@ def main (default_directory='.'): ...@@ -121,6 +125,8 @@ def main (default_directory='.'):
else: else:
print('Access to TDC core OK') print('Access to TDC core OK')
#-----> TDC configuration
# TDC configuration # TDC configuration
print "\n__________________________Configuration__________________________\n" print "\n__________________________Configuration__________________________\n"
tdc.config_acam() tdc.config_acam()
...@@ -152,8 +158,10 @@ def main (default_directory='.'): ...@@ -152,8 +158,10 @@ def main (default_directory='.'):
print (msg) print (msg)
raise PtsError (msg) raise PtsError (msg)
os.close(spec.fd)
print "\n-----------------------------------------------------------------\n\n\n" print "\n\n--------------------------------"
end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
......
...@@ -60,27 +60,28 @@ import os ...@@ -60,27 +60,28 @@ import os
import math import math
# Add common modules location tp path # Add common modules location tp path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
import csr import csr
# Import specific modules
import fmc_tdc import fmc_tdc
def main (default_directory='.'): def main (default_directory='.'):
# Constants declaration start_test_time = time.time()
#-----> PCIe address, firmware, loader constants
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_clks.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_clks.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
#-----> FPGA constants
# Addressing for the retrieval of carrier csr information # Addressing for the retrieval of carrier csr information
CARRIER_CSR = 0x00000 # base address CARRIER_CSR = 0x00000 # base address
CSR_TYPE_VER = 0x00 CSR_TYPE_VER = 0x00
...@@ -98,7 +99,9 @@ def main (default_directory='.'): ...@@ -98,7 +99,9 @@ def main (default_directory='.'):
EN_COUNTERS = 0x28 EN_COUNTERS = 0x28
CLK_31M25_COUNTER = 0x2C CLK_31M25_COUNTER = 0x2C
CLK_125M_COUNTER = 0x3C CLK_125M_COUNTER = 0x3C
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
...@@ -107,8 +110,9 @@ def main (default_directory='.'): ...@@ -107,8 +110,9 @@ def main (default_directory='.'):
print "----------------------------- FMC TDC -----------------------------" print "----------------------------- FMC TDC -----------------------------"
print "--------------------------- Clocks test ---------------------------\n" print "--------------------------- Clocks test ---------------------------\n"
print ("Test of the PLL clocks: 31.25MHz FPGA_TDC_REF_CLK and 125MHz CLK125.\n" print ("Test of the PLL clocks: 31.25MHz FPGA_TDC_REF_CLK and 125MHz CLK125.\n"
"The test starts by configuring the PLL IC4. Then, to verify the clock\n" "The test starts by configuring the PLL IC4. Then, to verify the\n"
"frequencies, there are dedicated counters implemented in the carrier FPGA.\n") "clock frequencies, there are dedicated counters implemented in the\n"
"carrier FPGA.\n")
print "\n_______________________________Info______________________________\n" print "\n_______________________________Info______________________________\n"
print "FMC TDC address to parse: %s"%(FMC_TDC_ADDR) print "FMC TDC address to parse: %s"%(FMC_TDC_ADDR)
...@@ -165,9 +169,9 @@ def main (default_directory='.'): ...@@ -165,9 +169,9 @@ def main (default_directory='.'):
else: else:
print("Mezzanine present : OK") print("Mezzanine present : OK")
time.sleep(3) time.sleep(3)
#-----> Check the clocks
print "\n\n___________________________PLL status____________________________\n" print "\n\n___________________________PLL status____________________________\n"
pll_status = carrier_csr.rd_reg(PLL_STATUS) pll_status = carrier_csr.rd_reg(PLL_STATUS)
if pll_status == 1: if pll_status == 1:
...@@ -189,7 +193,7 @@ def main (default_directory='.'): ...@@ -189,7 +193,7 @@ def main (default_directory='.'):
clk_125M = ((carrier_csr.rd_reg(CLK_125M_COUNTER))/ (2*1e6)) clk_125M = ((carrier_csr.rd_reg(CLK_125M_COUNTER))/ (2*1e6))
# FPGA_TDC_REF_CLK 31.25MHz clock evaluation # FPGA_TDC_REF_CLK 31.25MHz clock evaluation
if (clk_31M25 > 32.8) or (clk_31M25 < 29.6): # 5% limits due to software inacuracies if (clk_31M25 > 32.8) or (clk_31M25 < 29.6): # 5% limits due to software inaccuracies
msg = (("ERROR: PLL IC4: FPGA_TDC_REF_CLK: measured frequency %.2f MHz is out of accepted limits [29.6MHz..32.8MHz]") % (clk_31M25)) msg = (("ERROR: PLL IC4: FPGA_TDC_REF_CLK: measured frequency %.2f MHz is out of accepted limits [29.6MHz..32.8MHz]") % (clk_31M25))
os.close(spec.fd) os.close(spec.fd)
print (msg) print (msg)
...@@ -198,7 +202,7 @@ def main (default_directory='.'): ...@@ -198,7 +202,7 @@ def main (default_directory='.'):
print("FPGA_TDC_REF_CLK: measured frequency: %.2f MHz OK") % (clk_31M25) print("FPGA_TDC_REF_CLK: measured frequency: %.2f MHz OK") % (clk_31M25)
# CLK125 125MHz clock evaluation # CLK125 125MHz clock evaluation
if (clk_125M > 131) or (clk_125M < 118): # 5% limits due to software inacuracies in time measurement (time.sleep(2)) if (clk_125M > 131) or (clk_125M < 118): # 5% limits due to software inaccuracies in time measurement (time.sleep(2))
msg = (("ERROR: PLL IC4: CLK125: measured frequency %.2f MHz is out of accepted limits [118MHz..131MHz]") % (clk_125M)) msg = (("ERROR: PLL IC4: CLK125: measured frequency %.2f MHz is out of accepted limits [118MHz..131MHz]") % (clk_125M))
os.close(spec.fd) os.close(spec.fd)
print (msg) print (msg)
...@@ -207,8 +211,9 @@ def main (default_directory='.'): ...@@ -207,8 +211,9 @@ def main (default_directory='.'):
print("CLK125: measured frequency: %.2f MHz OK") % (clk_125M) print("CLK125: measured frequency: %.2f MHz OK") % (clk_125M)
os.close(spec.fd) print "\n\n--------------------------------"
print "\n\n-----------------------------------------------------------------" end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
main() main()
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
## | ## |
## The test attempts several writings and readbacks on different EEPROM locations. | ## The test attempts several writings and readbacks on different EEPROM locations. |
## | ## |
## FW to load .bin | ## FW to load tdc_allothertests.bit |
## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) | ## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) |
## Website http://www.ohwr.org/projects/pts | ## Website http://www.ohwr.org/projects/pts |
## Date 11/01/2013 | ## Date 11/01/2013 |
...@@ -51,30 +51,36 @@ import sys ...@@ -51,30 +51,36 @@ import sys
import time import time
import os import os
# Add common modules location tp path # Add common modules location to path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
import fmc_tdc import fmc_tdc
##------------------------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------------------------
## main -- ## main --
##------------------------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------------------------
def main (default_directory='.'): def main (default_directory='.'):
start_test_time = time.time()
#-----> PCIe address, firmware, loader constants
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit'#tdc_counters.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
#-----> EEPROM chip constant
EEPROM_ADDR = 0x50 EEPROM_ADDR = 0x50
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
...@@ -92,7 +98,7 @@ def main (default_directory='.'): ...@@ -92,7 +98,7 @@ def main (default_directory='.'):
# Load FMC TDC firmware # Load FMC TDC firmware
print "\n_________________________Initialisations_________________________\n" print "\n_________________________Initialisations_________________________\n"
print "Loading FMC Fine Delay firmware...", print "Loading FMC TDC firmware...",
firmware_loader = os.path.join(default_directory, FPGA_LOADER_PATH) firmware_loader = os.path.join(default_directory, FPGA_LOADER_PATH)
bitstream = os.path.join(default_directory, FMC_TDC_BITSTREAM_PATH) bitstream = os.path.join(default_directory, FMC_TDC_BITSTREAM_PATH)
os.system(firmware_loader + ' ' + bitstream) os.system(firmware_loader + ' ' + bitstream)
...@@ -121,6 +127,8 @@ def main (default_directory='.'): ...@@ -121,6 +127,8 @@ def main (default_directory='.'):
else: else:
print('Access to TDC core OK') print('Access to TDC core OK')
#-----> Accessing the mezzanine EEPROM chip
print "\n__________________________EEPROM IC10 test_______________________\n" print "\n__________________________EEPROM IC10 test_______________________\n"
# Scan FMC I2C bus # Scan FMC I2C bus
try: try:
...@@ -170,8 +178,10 @@ def main (default_directory='.'): ...@@ -170,8 +178,10 @@ def main (default_directory='.'):
else: else:
print('\nEEPROM IC5: Data comparison OK') print('\nEEPROM IC5: Data comparison OK')
os.close(spec.fd)
print "\n\n-----------------------------------------------------------------" print "\n\n--------------------------------"
end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
main() main()
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
## Description Testing of the presence of the TDC board on the SPEC carrier. | ## Description Testing of the presence of the TDC board on the SPEC carrier. |
## | ## |
## The test retrieves information on the carrier board: pcb version, carrier type, | ## The test retrieves information on the carrier board: pcb version, carrier type, |
## status, control, mezzzanine presence. | ## status, control, mezzanine presence. |
## Note that the mezzanine presence flag comes from the FMC pin prsnt_m2c_n_i. | ## Note that the mezzanine presence flag comes from the FMC pin prsnt_m2c_n_i. |
## | ## |
## The WISHBONE master can be accessed at PCIe base address xC0000. | ## The WISHBONE master can be accessed at PCIe base address xC0000. |
## | ## |
## | ## |
## FW to load .bin | ## FW to load tdc_pts_presence.bit |
## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) | ## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) |
## Website http://www.ohwr.org/projects/pts | ## Website http://www.ohwr.org/projects/pts |
## Date 11/01/2013 | ## Date 11/01/2013 |
...@@ -52,26 +52,27 @@ import time ...@@ -52,26 +52,27 @@ import time
import os import os
# Add common modules location tp path # Add common modules location tp path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
import csr import csr
# Import specific modules
import fmc_tdc import fmc_tdc
def main (default_directory='.'): def main (default_directory='.'):
# Constants declaration start_test_time = time.time()
#-----> PCIe address, firmware, loader constants
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_presence.bit'#top_tdc.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_presence.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
#-----> FPGA constants
# Addressing for the retrieval of carrier csr information # Addressing for the retrieval of carrier csr information
CARRIER_CSR = 0x00000 # base address CARRIER_CSR = 0x00000 # base address
CSR_TYPE_VER = 0x00 CSR_TYPE_VER = 0x00
...@@ -82,14 +83,16 @@ def main (default_directory='.'): ...@@ -82,14 +83,16 @@ def main (default_directory='.'):
PCB_VER_MASK = 0x000F PCB_VER_MASK = 0x000F
CARRIER_TYPE_MASK = 0xFFFF0000 CARRIER_TYPE_MASK = 0xFFFF0000
STATUS_FMC_PRES = (1<<0) STATUS_FMC_PRES = (1<<0)
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
# Bind SPEC object to FMC TDC card # Bind SPEC object to FMC TDC card
print "\n-------------------------------------------------------------------" print "\n-------------------------------------------------------------------"
print "---------------------------- FMC TDC ---------------------------- " print "----------------------------- FMC TDC ----------------------------- "
print "-------------------- Mezzanine presence test --------------------\n" print "--------------------- Mezzanine presence test ---------------------\n"
print ("Test of the presence of the mezzanine, on the SPEC carrier.\n") print ("Test of the presence of the mezzanine, on the SPEC carrier.\n")
print "\n_______________________________Info______________________________\n" print "\n_______________________________Info______________________________\n"
...@@ -113,7 +116,7 @@ def main (default_directory='.'): ...@@ -113,7 +116,7 @@ def main (default_directory='.'):
# Check bitsteam type # Check bitsteam type
bitstream_type = carrier_csr.rd_reg(CSR_BSTM_TYPE) bitstream_type = carrier_csr.rd_reg(CSR_BSTM_TYPE)
print('Bitstream type :%.8X') % bitstream_type print('Bitstream type : %.8X') % bitstream_type
if(bitstream_type == 0xFFFFFFFF): if(bitstream_type == 0xFFFFFFFF):
msg = ("FATAL ERROR: Wrong bitstream type loaded") msg = ("FATAL ERROR: Wrong bitstream type loaded")
os.close(spec.fd) os.close(spec.fd)
...@@ -148,8 +151,10 @@ def main (default_directory='.'): ...@@ -148,8 +151,10 @@ def main (default_directory='.'):
else: else:
print("Mezzanine present OK\n") print("Mezzanine present OK\n")
os.close(spec.fd)
print "\n\n-----------------------------------------------------------------" print "\n\n--------------------------------"
end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
main() main()
...@@ -60,7 +60,7 @@ class CFMCTDC: ...@@ -60,7 +60,7 @@ class CFMCTDC:
# ACAM register addresses and expected register contents # ACAM register addresses and expected register contents
ACAM_READBACK_ADDR = [0x40, 0x44, 0x48, 0x4C, 0X50, 0x54, 0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C, 0x70, 0x78] ACAM_READBACK_ADDR = [0x40, 0x44, 0x48, 0x4C, 0X50, 0x54, 0x58, 0x5C, 0x60, 0x64, 0x68, 0x6C, 0x70, 0x78]
ACAM_READBACK_REGS = [0xC1F0FC81, 0xC0000000, 0xC0000E02, 0xC0000000, 0xC200000F, 0xC00007D0, 0xC00000FC, 0xC0001FEA, 0x00000000, 0x00000000, 0x00000000, 0xC3000000, 0xC4000800, 0xC0000000] ACAM_READBACK_REGS = [0xC1F0FC81, 0xC0000000, 0xC0000E02, 0xC0000000, 0xC200000F, 0xC00007D0, 0xC00000FC, 0xC0001FEA, 0x00000000, 0x00000000, 0x00000000, 0xC01F0000, 0xC4000800, 0xC0000000]
# DMA length in bytes # DMA length in bytes
DMA_LENGTH = 4096 DMA_LENGTH = 4096
...@@ -175,8 +175,8 @@ class CFMCTDC: ...@@ -175,8 +175,8 @@ class CFMCTDC:
self.tdc_regs.wr_reg(0x14, 0x7D0) self.tdc_regs.wr_reg(0x14, 0x7D0)
self.tdc_regs.wr_reg(0x18, 0x3) self.tdc_regs.wr_reg(0x18, 0x3)
self.tdc_regs.wr_reg(0x1C, 0x1FEA) self.tdc_regs.wr_reg(0x1C, 0x1FEA)
#self.tdc_regs.wr_reg(0x2C, 0xFF0000) self.tdc_regs.wr_reg(0x2C, 0x1F0000)
self.tdc_regs.wr_reg(0x2C, 0x03000000) #self.tdc_regs.wr_reg(0x2C, 0x03000000)
self.tdc_regs.wr_reg(0x30, 0x4000000) self.tdc_regs.wr_reg(0x30, 0x4000000)
self.tdc_regs.wr_reg(0x38, 0x0) self.tdc_regs.wr_reg(0x38, 0x0)
self.tdc_regs.wr_reg(0xFC, 0x4) self.tdc_regs.wr_reg(0xFC, 0x4)
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
## if all the LEDs are blinking as expected. | ## if all the LEDs are blinking as expected. |
## | ## |
## | ## |
## FW to load .bin | ## FW to load tdc_pts_leds.bit |
## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) | ## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) |
## Website http://www.ohwr.org/projects/pts | ## Website http://www.ohwr.org/projects/pts |
## Date 11/01/2013 | ## Date 11/01/2013 |
...@@ -49,11 +49,13 @@ ...@@ -49,11 +49,13 @@
import sys import sys
import time import time
import os import os
import math
from datetime import datetime
# Add common modules location tp path # Add common modules location tp path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
...@@ -61,24 +63,27 @@ import rr ...@@ -61,24 +63,27 @@ import rr
import csr import csr
def main (default_directory='.'): def main (default_directory='.'):
start_test_time = time.time()
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_leds.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_pts_leds.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
print "\n-------------------------------------------------------------------" print "\n-------------------------------------------------------------------"
print "----------------------------- TDC PTS -----------------------------" print "----------------------------- TDC PTS -----------------------------"
print "---------------------------- LEDs test ----------------------------\n" print "---------------------------- LEDs test ----------------------------\n"
print ("Test of the front panel LEDs. For this test the operator’s intervention\n" print ("Test of the front panel LEDs. For this test the operator’s\n"
"is needed; when prompted, the operator should visually inspect the LEDs.\n") "intervention is needed; when prompted, the operator should visually\n"
"inspect the LEDs.\n")
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
print "\n_________________________Initialisations_________________________\n" print "\n_________________________Initialisations_________________________\n"
# Load FMC TDC firmware # Load FMC TDC firmware
print "Loading FMC TDC firmware...", print "Loading FMC TDC firmware...",
...@@ -89,6 +94,7 @@ def main (default_directory='.'): ...@@ -89,6 +94,7 @@ def main (default_directory='.'):
print "Firmware loaded!" print "Firmware loaded!"
#-----> LEDs inspection
print "\n_________________________LEDs inspection_________________________\n" print "\n_________________________LEDs inspection_________________________\n"
# Standard in/out temporary redirection # Standard in/out temporary redirection
...@@ -112,8 +118,10 @@ def main (default_directory='.'): ...@@ -112,8 +118,10 @@ def main (default_directory='.'):
else: else:
print ("LEDs inspected OK!") print ("LEDs inspected OK!")
os.close(spec.fd)
print "\n\n-----------------------------------------------------------------" print "\n\n--------------------------------"
end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
......
#! /bin/bash
ln -s fmc_presence.py test00.py
ln -s clocks.py test01.py
ln -s fpga_inputs.py test02.py
ln -s fpga_inputs_disable.py test03.py
ln -s onewire_test.py test04.py
ln -s eeprom.py test05.py
ln -s acam.py test06.py
ln -s acam_accuracy.py test07.py
ln -s acam_inputs_disable.py test08.py
ln -s acam_startdis_stopdis.py test09.py
ln -s acam_errflag.py test10.py
ln -s dac.py test11.py
ln -s leds.py test12.py
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
## The test reads the unique ID and the temperature and checks if the received | ## The test reads the unique ID and the temperature and checks if the received |
## values are within reasonable limits. | ## values are within reasonable limits. |
## | ## |
## FW to load .bin | ## FW to load tdc_allothertests.bit |
## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) | ## Authors Evangelia Gousiou (Evangelia.Gousiou@cern.ch) |
## Website http://www.ohwr.org/projects/pts | ## Website http://www.ohwr.org/projects/pts |
## Date 11/01/2013 | ## Date 11/01/2013 |
...@@ -52,16 +52,14 @@ import sys ...@@ -52,16 +52,14 @@ import sys
import time import time
import os import os
# Add common modules location tp path # Add common modules location to path
sys.path.append('../../../') sys.path.append('../../../../pts/')
sys.path.append('../../../gnurabbit/python/') sys.path.append('../../../../pts/gnurabbit/python/')
sys.path.append('../../../common/') sys.path.append('../../../../pts/common/')
# Import common modules # Import common modules
from ptsexcept import * from ptsexcept import *
import rr import rr
# Import specific modules
import fmc_tdc import fmc_tdc
...@@ -70,13 +68,20 @@ import fmc_tdc ...@@ -70,13 +68,20 @@ import fmc_tdc
##------------------------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------------------------
def main (default_directory='.'): def main (default_directory='.'):
start_test_time = time.time()
#-----> PCIe address, firmware, loader constants
# Constants declaration # Constants declaration
FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000' FMC_TDC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit' FMC_TDC_BITSTREAM_PATH = '../firmwares/tdc_allothertests.bit'
FPGA_LOADER_PATH = '../../../gnurabbit/user/fpga_loader' FPGA_LOADER_PATH = '../../../../pts/gnurabbit/user/fpga_loader'
#-----> One Wire chip constant
FAMILY_CODE = 0x28 FAMILY_CODE = 0x28
#-----> FPGA initializations
# SPEC object declaration # SPEC object declaration
spec = rr.Gennum() spec = rr.Gennum()
...@@ -125,6 +130,7 @@ def main (default_directory='.'): ...@@ -125,6 +130,7 @@ def main (default_directory='.'):
print('Access to TDC core OK') print('Access to TDC core OK')
#-----> Accessing the One Wire chip
# Read unique ID and print to log # Read unique ID and print to log
print "\n____________________________Unique ID____________________________\n" print "\n____________________________Unique ID____________________________\n"
try: try:
...@@ -162,8 +168,10 @@ def main (default_directory='.'): ...@@ -162,8 +168,10 @@ def main (default_directory='.'):
else: else:
print('TEMPID IC14: Temperature: %3.2f°C OK') % temp print('TEMPID IC14: Temperature: %3.2f°C OK') % temp
os.close(spec.fd)
print "\n\n-----------------------------------------------------------------" print "\n\n--------------------------------"
end_test_time = time.time()
print "Test elapsed time: %.2f seconds\n\n\n" % (end_test_time-start_test_time)
if __name__ == '__main__' : if __name__ == '__main__' :
main() main()
#! /bin/bash
rm -f test00.py
rm -f test01.py
rm -f test02.py
rm -f test03.py
rm -f test04.py
rm -f test05.py
rm -f test06.py
rm -f test07.py
rm -f test08.py
rm -f test09.py
rm -f test10.py
rm -f test11.py
rm -f test12.py
rm -f test*.pyc
rm -f test*.py~
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