Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
Production Test Suite
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Production Test Suite
Commits
2ecc6fb6
Commit
2ecc6fb6
authored
May 29, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test23: Use EDA number as part_number, use current date as FRU.
Improve content comparison report.
parent
1cd3aef7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
15 deletions
+27
-15
test23.py
test/fmcadc100m14b4cha/python/test23.py
+27
-15
No files found.
test/fmcadc100m14b4cha/python/test23.py
View file @
2ecc6fb6
...
...
@@ -40,6 +40,7 @@ def main (default_directory='.'):
# Constants declaration
TEST_NB
=
23
EXPECTED_BITSTREAM_TYPE
=
0x1
PART_NUMBER
=
"EDA-02063-V5-0"
SERIAL_FILENAME
=
"../../../serial.txt"
SERIAL_FILENAME
=
os
.
path
.
join
(
default_directory
,
SERIAL_FILENAME
)
CALIBR_FILENAME
=
"calibration_data.txt"
...
...
@@ -87,7 +88,7 @@ def main (default_directory='.'):
ref_date
=
datetime
.
datetime
(
1996
,
1
,
1
)
diff_date
=
now_date
-
ref_date
current_date
=
int
(
diff_date
.
total_seconds
()
//
60
)
print
"
Mfg
date/time:
%
d minutes (since 0:00 1/1/96)
\n
"
%
current_date
print
"
Current
date/time:
%
d minutes (since 0:00 1/1/96)
\n
"
%
current_date
#==================================================
# Read calibration data from file
...
...
@@ -98,32 +99,32 @@ def main (default_directory='.'):
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
%02
X"
%
(
data
)
#
print "Raw calibration data:"
#
for data in calibr_data:
#
print "0x%02X" % (data)
################################################################################
# C
HECK IF A MANUFACTURING DATE IS PRESENT IN THE
EEPROM.
# I
F NOT, PUT THE CURRENT DATE (IT MEANS IT'S THE FIRST TIME THE TEST IS RUN
).
# I
F A DATE IS PRESENT, KEEP IT
.
# C
heck if a manufacturing date is present in the
EEPROM.
# I
f not, put the current date (it means it's the first time the test is run
).
# I
f a date is present, keep it
.
# EEPROM clear code used to test the test!
#eeprom_data = [0x0] * EEPROM_SIZE
#fmc.sys_i2c_eeprom_write(eeprom_data)
# Read entire EEPROM
print
"Read EEPROM content."
#
print "Read EEPROM content."
eeprom_data_read
=
fmc
.
sys_i2c_eeprom_read
(
0
,
EEPROM_SIZE
)
# Write EEPROM data to binary file
print
"Write EEPROM content to file (binary)."
#
print "Write EEPROM content to file (binary)."
f_eeprom
=
open
(
EEPROM_BIN_FILENAME
,
"wb"
)
for
byte
in
eeprom_data_read
:
f_eeprom
.
write
(
chr
(
byte
))
f_eeprom
.
close
()
# Get manufacturing date from EEPROM data, if exists
print
"Get manufacturing date from
binary file
."
print
"Get manufacturing date from
EEPROM
."
eeprom_data
=
open
(
EEPROM_BIN_FILENAME
,
"rb"
)
.
read
()
mfg_date
=
ipmi_get_mfg_date
(
eeprom_data
)
...
...
@@ -132,13 +133,15 @@ def main (default_directory='.'):
print
"No manufacturing date found in the EEPROM, taking current date:
%
d"
%
current_date
mfg_date
=
current_date
else
:
print
"Manufacturing date found in EEPROM:
%
d"
%
mfg_date
print
"Manufacturing date found in EEPROM:
%
d
(will be preserved)
\n
"
%
mfg_date
#==================================================
# Create Board Info Area
# FRU field is used to store the date of generation of the eeprom content
# This could be used later to determine if the content has to be udated (bug fix, ...)
bia
=
BoardInfoArea
(
mfg_date
,
"CERN"
,
"FmcAdc100m14b4cha"
,
serial
,
"part number"
,
"fru"
)
print
"EEPROM content generated:
%
s
\n
"
%
now_date
fru
=
"
%
s"
%
now_date
bia
=
BoardInfoArea
(
mfg_date
,
"CERN"
,
"FmcAdc100m14b4cha"
,
serial
,
PART_NUMBER
,
fru
)
#==================================================
# Multirecords Area
...
...
@@ -196,12 +199,13 @@ def main (default_directory='.'):
#==================================================
# Write content to EEPROM via I2C
print
"Write EEPROM content.
\n
"
fmc
.
sys_i2c_eeprom_write
(
eeprom_data
)
#==================================================
# Read back EEPROM content via I2C
eeprom_data_read
=
fmc
.
sys_i2c_eeprom_read
(
0
,
len
(
eeprom_data
))
print
"EEPROM content comparision"
mismatch
=
0
for
i
in
range
(
len
(
eeprom_data
)):
wr_data
=
eeprom_data
[
i
]
rd_data
=
eeprom_data_read
[
i
]
...
...
@@ -209,10 +213,18 @@ def main (default_directory='.'):
check
=
"OK"
else
:
check
=
"FAILED"
print
"0x
%02
X 0x
%02
X =>
%
s"
%
(
wr_data
,
rd_data
,
check
)
mismatch
+=
1
print
"0x
%02
X 0x
%02
X =>
%
s"
%
(
wr_data
,
rd_data
,
check
)
#print "0x%02X 0x%02X => %s" % (wr_data, rd_data, check)
print
"EEPROM content comparision => "
,
if
(
mismatch
==
0
):
print
"OK"
else
:
print
"FAILED"
raise
PtsError
(
"EEPROM comparison failed:
%
d mismatch found."
%
mismatch
)
except
FmcAdc100mOperationError
as
e
:
raise
PtsError
(
"
t
est failed:
%
s"
%
e
)
raise
PtsError
(
"
T
est failed:
%
s"
%
e
)
###########################################################################
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment