Commit 63d4d7b5 authored by Matthieu Cattin's avatar Matthieu Cattin

test23: Update fmc_eeprom interface.

parent 08bdb42c
......@@ -20,6 +20,7 @@ sys.path.append('../../../common/')
# Import common modules
from ptsexcept import *
#from fmc_eeprom import *
import rr
# Import specific modules
......@@ -92,66 +93,55 @@ def main (default_directory='.'):
f_calibr = open(CALIBR_FILENAME, 'r+')
calibr_data = []
for line in iter(f_calibr):
calibr_data.append(int(line, 16))
calibr_data.append(0xFF & int(line, 16))
calibr_data.append(0xFF & (int(line, 16) >> 8))
f_calibr.close()
print "Raw calibration data:"
for data in calibr_data:
print "0x%04X" % (data)
print "0x%02X" % (data)
return
#==================================================
# Create Board Info Area
bia = BoardInfoArea()
# Set Board Info Area fields
bia.set_manufacturer("CERN")
bia.set_product_name("ADC100M")
bia.set_serial_number("1234567890")
bia.set_part_number("ADC100M")
bia.set_fru_file_id("abcde")
bia = BoardInfoArea("CERN", "FmcAdc100m14b4cha", serial, "part number", "fru")
#==================================================
# Multirecords Area
dcload = DCLoadRecord()
# Set DC Load information
set_voltage_required()
set_nominal_voltage()
set_min_voltage()
set_max_voltage()
set_spec_ripple()
set_min_current()
set_max_current()
dcout = DCOutputRecord()
# Set DC Output information
set_output_info()
set_nominal_voltage()
set_max_negative_voltage_deviation()
set_max_positive_voltage_deviation()
set_ripple()
set_min_current_draw()
set_max_current_draw()
oem = OEMRecord()
# Set OEM record information
set_module_size()
set_p1_connector_size()
set_p2_connector_size()
set_clock_direction()
set_nsignals()
set_num_gbt_transceivers()
set_max_clock()
# output number, vnom, vmin, vmax, ripple, imin, imax
dcload0 = DCLoadRecord(0, 2.5, 2.375, 2.625, 0.0, 0, 4000) # VADJ
dcload1 = DCLoadRecord(1, 3.3, 3.135, 3.465, 0.0, 0, 3000) # P3V3
dcload2 = DCLoadRecord(2, 12.0, 11.4, 12.6, 0.0, 0, 1000) # P12V
dcload = [ dcload0, dcload1, dcload2 ]
# output number, vnom, vmin, vmax, ripple, imin, imax
dcout0 = DCOutputRecord(3, 0.0, 0.0, 0.0, 0.0, 0, 0) # VIO_B_M2C
dcout1 = DCOutputRecord(4, 0.0, 0.0, 0.0, 0.0, 0, 0) # VREF_A_M2C
dcout2 = DCOutputRecord(5, 0.0, 0.0, 0.0, 0.0, 0, 0) # VREF_B_M2C
dcout = [ dcout0, dcout1, dcout2 ]
# module size : 0=single width, 1=double width
# P1 size : 0=LPC, 1=HPC
# P2 size : 0=LPC, 1=HPC, 3=not fitted
# clock dir : 0=M2C, 1=C2M
# nb sig P1 A : number
# nb sig P1 B : number
# nb sig P2 A : number
# nb sig P2 B : number
# nb GBT P1 : number
# nb GBT P2 : number
# max TCK freq : frequency in MHz
oem = OEMRecord(0, 0, 3, 0, 68, 0, 0, 0, 0, 0, 0)
#==================================================
# Internal Use Area
iua = InternalUseArea()
iua.set_data([0x11, 0x22, 0x33])
# Takes an array of byte as parameter
iua = InternalUseArea(calibr_data)
#==================================================
# Open, set, write, close!
ipmi_open_file("test.out")
ipmi_open_file("eeprom_content.out")
ipmi_set(bia, dcload, dcout, oem, iua)
ipmi_write()
ipmi_close_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