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='.'): ...@@ -56,7 +56,7 @@ def main (default_directory='.'):
# Do acq on the same channel as selected channel for thresh trig # 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) result = fmc.do_acq( chan_for_thresh, "all_chans" ,"y",post_trig_val,pre_trig_val,0)
print result
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -134,13 +134,26 @@ class CFmcAdc100ks: ...@@ -134,13 +134,26 @@ class CFmcAdc100ks:
# I dont know... # I dont know...
RANGE_CMD_MASK = 0x10 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 REGGISTER ADDRESSES
TRIG_CFG_HW_EN = 0 TRIG_CFG_HW_EN = 0
TRIG_CFG_SW_EN = 1 TRIG_CFG_SW_EN = 1
TRIG_CFG_INT_SEL = 2 TRIG_CFG_INT_SEL = 2
TRIG_CFG_SLOPE = 7 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_CFG_INT_THRES = 16
# TRIG REG MASKS # TRIG REG MASKS
INT_SEL_MASK = 0x0000007C INT_SEL_MASK = 0x0000007C
...@@ -496,7 +509,7 @@ class CFmcAdc100ks: ...@@ -496,7 +509,7 @@ class CFmcAdc100ks:
time.sleep(.1) time.sleep(.1)
self.set_decimation(1) self.set_decimation(1)
time.sleep(.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) time.sleep(.1)
self.start_acq() self.start_acq()
self.start_adc_cont() self.start_adc_cont()
...@@ -607,7 +620,7 @@ class CFmcAdc100ks: ...@@ -607,7 +620,7 @@ class CFmcAdc100ks:
time.sleep(.1) time.sleep(.1)
self.set_decimation(1) self.set_decimation(1)
time.sleep(.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) time.sleep(.1)
self.start_acq() self.start_acq()
self.start_adc_cont() self.start_adc_cont()
...@@ -663,7 +676,7 @@ class CFmcAdc100ks: ...@@ -663,7 +676,7 @@ class CFmcAdc100ks:
else: else:
sw_trig_en =0 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) time.sleep(.1)
self.start_acq() self.start_acq()
......
x1#! /usr/bin/env python #! /usr/bin/env python
# coding: utf8 # coding: utf8
# Copyright CERN, 2011 # Copyright CERN, 2011
...@@ -18,16 +18,20 @@ import csr ...@@ -18,16 +18,20 @@ import csr
""" """
test00: Load firmware and test mezzanine presence line. 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='.'): def main (default_directory='.'):
"""
path_fpga_loader = '../firmwares/fpga_loader'; 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) firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware) bitstream = os.path.join(default_directory, path_firmware)
os.system( firmware_loader + ' ' + bitstream) os.system( firmware_loader + ' ' + bitstream)
time.sleep(2); time.sleep(2);
"""
# Objects declaration # Objects declaration
spec = rr.Gennum() spec = rr.Gennum()
fmc = fmc_adc_test_suite.CFmcAdc100ks(spec) 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 ...@@ -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='.'): def main (default_directory='.'):
path_fpga_loader = '../firmwares/fpga_loader'; # path_fpga_loader = '../firmwares/fpga_loader';
path_firmware = '../firmwares/TestSuite.bin'; # path_firmware = '../firmwares/TestSuite.bin';
firmware_loader = os.path.join(default_directory, path_fpga_loader) # firmware_loader = os.path.join(default_directory, path_fpga_loader)
bitstream = os.path.join(default_directory, path_firmware) # bitstream = os.path.join(default_directory, path_firmware)
os.system( firmware_loader + ' ' + bitstream) # os.system( firmware_loader + ' ' + bitstream)
time.sleep(2); # time.sleep(2);
# Objects declaration # Objects declaration
spec = rr.Gennum() spec = rr.Gennum()
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<FMC_EPROMDATA memory_size = "2000"> <FMC_EPROMDATA memory_size = "2000">
<area number ="1" pos_of_len_field = "2"> <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= "Board Area Format version" type="binary" content="00000001" description= "Indentifies language used" has_typelen = "no" />
<field name= "Language_1" type="binary" content= "00000001" description= "Indentifies language used" has_typelen = "yes" /> <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= "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_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 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= "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= "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"/> <field name= "Custom Mfg fields" type="ascii" content="Userdependant" description= "Delete if undesired" has_typelen = "yes"/>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<area number ="5" pos_of_len_field = "0"> <area number ="5" pos_of_len_field = "0">
<multirecord name= "DC_LOAD" multi_record_num = "1"> <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= "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="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="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" /> <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 ...@@ -19,6 +19,10 @@ import optparse
## Change things so that calib data file can contain whitespace after comma ## Change things so that calib data file can contain whitespace after comma
default_inputFile = './eeprom_input.xml'
######################################## ########################################
# Define New Type # Define New Type
######################################## ########################################
...@@ -213,12 +217,15 @@ def write_to_file(file_name,data_list,addr_list,tag_bytes,debug): ...@@ -213,12 +217,15 @@ def write_to_file(file_name,data_list,addr_list,tag_bytes,debug):
if debug: if debug:
for h in range(len(data_list)): 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])) 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]))
# print ("%s %s %s \n"%(addr_list[h][0],data_list[h][0],tag_bytes[h][0]))
else: else:
for h in range(len(data_list)): for h in range(len(data_list)):
writing_to_file.write("%s %s \n"%(addr_list[h][0],data_list[h][0])) 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: if file_name ==None:
print "Formatted data written to 'EEPROM_FORMATTED_DATA.txt' : in current directory" print "Formatted data written to 'EEPROM_FORMATTED_DATA.txt' : in current directory"
...@@ -473,7 +480,7 @@ typeConvFunctionsMap = { ...@@ -473,7 +480,7 @@ typeConvFunctionsMap = {
######################################## ########################################
##inputFile = './eeprom_input.xml' ##inputFile = './eeprom_input.xml'
default_inputFile = './test.xml' #default_inputFile = './test.xml'
def main(file_name,input_name,debug,calibration_file): 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