Commit 6f3b026c authored by Ross Millar's avatar Ross Millar

Update fmcadc200k tests and eeprom gen tool.

parent 1447116b
......@@ -56,7 +56,7 @@ def main (default_directory='.'):
# Do acq on the same channel as selected channel for thresh trig
result = fmc.do_acq( chan_for_thresh, "all_chans" ,"y",post_trig_val,pre_trig_val,0)
print result
if __name__ == '__main__':
......
......@@ -134,13 +134,26 @@ class CFmcAdc100ks:
# I dont know...
RANGE_CMD_MASK = 0x10
# TRIG REGGISTER ADDRESSES
#TRIG_CFG_HW_EN = 0
#TRIG_CFG_SW_EN = 1
#TRIG_CFG_INT_SEL = 2
#TRIG_CFG_SLOPE = 7
#TRIG_CFG_DUMMY = 8
#TRIG_CFG_INT_THRES = 16
# TRIG REGGISTER ADDRESSES
TRIG_CFG_HW_EN = 0
TRIG_CFG_SW_EN = 1
TRIG_CFG_INT_SEL = 2
TRIG_CFG_SLOPE = 7
TRIG_CFG_DUMMY = 8
#TRIG_CFG_DUMMY = 8
TRIG_CFG_EDGE_EN = 8
TRIG_CFG_DUMMY = 9
TRIG_CFG_INT_THRES = 16
# TRIG REG MASKS
INT_SEL_MASK = 0x0000007C
......@@ -496,7 +509,7 @@ class CFmcAdc100ks:
time.sleep(.1)
self.set_decimation(1)
time.sleep(.1)
self.set_trig_config(0,1,0x1,0xFFFF,0,0)
self.set_trig_config(0,1,0x1,0xFFFF,0,0,0)
time.sleep(.1)
self.start_acq()
self.start_adc_cont()
......@@ -607,7 +620,7 @@ class CFmcAdc100ks:
time.sleep(.1)
self.set_decimation(1)
time.sleep(.1)
self.set_trig_config(0,1,0x1,0xFFFF,0,0)
self.set_trig_config(0,1,0x1,0xFFFF,0,0,0)
time.sleep(.1)
self.start_acq()
self.start_adc_cont()
......@@ -663,7 +676,7 @@ class CFmcAdc100ks:
else:
sw_trig_en =0
self.set_trig_config(thresh,sw_trig_en,0x1,0x1000,1,0)
self.set_trig_config(thresh,sw_trig_en,0x1,0x1000,1,0,0)
time.sleep(.1)
self.start_acq()
......
x1#! /usr/bin/env python
#! /usr/bin/env python
# coding: utf8
# Copyright CERN, 2011
......@@ -18,16 +18,20 @@ import csr
"""
test00: Load firmware and test mezzanine presence line.
This test is required to be run first so the firmware is loaded for the test suite
"""
def main (default_directory='.'):
"""
path_fpga_loader = '../firmwares/fpga_loader';
path_firmware = '../firmwares/TestSuite.bin';
#path_firmware = '../firmwares/TestSuite_8ch_ref.bin';
path_firmware = '../firmwares/TestSuite_8ch_ref_mnt.bin';
firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware)
os.system( firmware_loader + ' ' + bitstream)
time.sleep(2);
"""
# Objects declaration
spec = rr.Gennum()
fmc = fmc_adc_test_suite.CFmcAdc100ks(spec)
......
......@@ -32,12 +32,12 @@ EEPROM test, tests if you can write and then read a result from the EEPROM on th
def main (default_directory='.'):
path_fpga_loader = '../firmwares/fpga_loader';
path_firmware = '../firmwares/TestSuite.bin';
firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware)
os.system( firmware_loader + ' ' + bitstream)
time.sleep(2);
# path_fpga_loader = '../firmwares/fpga_loader';
# path_firmware = '../firmwares/TestSuite.bin';
# firmware_loader = os.path.join(default_directory, path_fpga_loader)
# bitstream = os.path.join(default_directory, path_firmware)
# os.system( firmware_loader + ' ' + bitstream)
# time.sleep(2);
# Objects declaration
spec = rr.Gennum()
......
<?xml version="1.0" encoding="UTF-8"?>
<FMC_EPROMDATA memory_size = "2000">
<area number ="1" pos_of_len_field = "2">
<field name= "Board Area Format version" type="binary" content="00000001" description= "Indentifies language used" has_typelen = "yes" />
<field name= "Language_1" type="binary" content= "00000001" description= "Indentifies language used" has_typelen = "yes" />
<field name= "Board Area Format version" type="binary" content="00000001" description= "Indentifies language used" has_typelen = "no" />
<field name= "Language" type="binary" content= "00000001" description= "Indentifies language used" has_typelen = "no" />
<field name= "Mfg. Date/Time" type="binary" content="00000010 01010101" description="Num of mins from 00:00hrs 1/1/96 - little endian" has_typelen = "no" />
<field name= "Board_manufacturer" type="ascii" content="CERN" description="the manufacturer of the board" has_typelen = "yes" />
<field name= "Board product name" type="ascii" content="ADC 200k 16bit" description="name of the board" has_typelen = "yes" />
<field name= "Board_serial_number" type="bcd" content="1241921" description="serial number for board" has_typelen = "yes" />
<field name= "Board_serial_number" type="binary" content="00000000" description="serial number for board" has_typelen = "yes" />
<field name= "Board_part_number" type="ascii" content="Desired input" description= "Part number for the board" has_typelen = "yes"/>
<field name= "FRU File ID" type="ascii" content="User dependant" description= "User desired - identification of EEPROM info source" has_typelen = "yes"/>
<field name= "Custom Mfg fields" type="ascii" content="Userdependant" description= "Delete if undesired" has_typelen = "yes"/>
......@@ -14,7 +14,7 @@
<area number ="5" pos_of_len_field = "0">
<multirecord name= "DC_LOAD" multi_record_num = "1">
<field name= "DC Load number" type="binary" content= "00000001" description= "DC load multirecord number" has_typelen = "no" />
<field name= "Nominal Voltage" type="signed_short" content= "+3.30" description= "Nominal voltage for Vadj" has_typelen = "no" />
<field name= "Nominal Voltage" type="signed_short" content= "+0.00" description= "Nominal voltage for Vadj" has_typelen = "no" />
<field name="min_v" type="signed_short" content="+0.00" description="Spec'd min voltage for Vadj" has_typelen = "no" />
<field name="max_v" type="signed_short" content="+0.00" description="Spec'd max voltage for Vadj" has_typelen = "no" />
<field name="ripple_pk_pk" type="signed_short" content="+0.00" description="Spec'd Ripple and noise pk - pk for vadj" has_typelen = "no" />
......
......@@ -19,6 +19,10 @@ import optparse
## Change things so that calib data file can contain whitespace after comma
default_inputFile = './eeprom_input.xml'
########################################
# Define New Type
########################################
......@@ -213,12 +217,15 @@ def write_to_file(file_name,data_list,addr_list,tag_bytes,debug):
if debug:
for h in range(len(data_list)):
writing_to_file.write("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
print ("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
writing_to_file.write("%s %s %s\n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
# print ("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
else:
for h in range(len(data_list)):
writing_to_file.write("%s %s \n"%(addr_list[h][0],data_list[h][0]))
print ("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
#print ("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
if file_name ==None:
print "Formatted data written to 'EEPROM_FORMATTED_DATA.txt' : in current directory"
......@@ -473,7 +480,7 @@ typeConvFunctionsMap = {
########################################
##inputFile = './eeprom_input.xml'
default_inputFile = './test.xml'
#default_inputFile = './test.xml'
def main(file_name,input_name,debug,calibration_file):
......
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