Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
FMC ADC 100M 14b 4cha - Testing
Commits
e9fb39c4
Commit
e9fb39c4
authored
May 09, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bitstream and mezzanine presence checked in fmc_adc_spec module init.
Test00 modified consequently. Add test time measurement.
parent
e0e1f378
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
23 deletions
+39
-23
fmc_adc_spec.py
test/fmcadc100m14b4cha/python/fmc_adc_spec.py
+16
-2
test00.py
test/fmcadc100m14b4cha/python/test00.py
+23
-21
No files found.
test/fmcadc100m14b4cha/python/fmc_adc_spec.py
View file @
e9fb39c4
...
...
@@ -128,8 +128,9 @@ class CFmcAdc100mSpec:
#======================================================================
# Class initialisation
def
__init__
(
self
,
bus
):
def
__init__
(
self
,
bus
,
bs_type
):
self
.
bus
=
bus
# Objects declaration
self
.
dma_csr
=
CCSR
(
self
.
bus
,
self
.
GNUM_DMA_CSR_ADDR
)
self
.
gnum
=
CGN4124
(
self
.
bus
,
self
.
dma_csr
)
...
...
@@ -138,9 +139,21 @@ class CFmcAdc100mSpec:
self
.
csr
=
CCSR
(
self
.
bus
,
self
.
CSR_ADDR
)
self
.
utc_core
=
CCSR
(
self
.
bus
,
self
.
UTC_CORE_ADDR
)
self
.
irq_controller
=
CCSR
(
self
.
bus
,
self
.
IRQ_CONTROLLER_ADDR
)
# Get physical addresses of the pages for DMA transfer
self
.
dma_pages
=
self
.
gnum
.
get_physical_addr
()
# Check if the expected bitstream loaded
bs
=
self
.
get_bitstream_type
()
if
(
bs
==
0xFFFFFFFF
):
raise
FmcAdc100mSpecOperationError
(
"Bitstream not properly loaded."
)
if
(
bs
!=
bs_type
):
raise
FmcAdc100mSpecOperationError
(
"Wrong bitsream. Excpect:0x
%08
X, Read:0x
%08
X"
%
(
bs_type
,
bs
))
# Ckeck if a mezzanine is present
if
(
not
self
.
get_fmc_presence
()):
raise
FmcAdc100mSpecOperationError
(
"Mezzanine not present or PRSNT_M2C_L line faulty."
)
#======================================================================
# Generic functions
...
...
@@ -212,8 +225,9 @@ class CFmcAdc100mSpec:
return
self
.
get_reg
(
self
.
csr
,
self
.
CSR
,
'CTRL'
)
# Get FMC presence state
# 1 = mezzanine present, 0 = no nezzanine
def
get_fmc_presence
(
self
):
return
self
.
get_field
(
self
.
csr
,
self
.
CSR
,
'STAT'
,
'FMC_PRES'
)
return
not
self
.
get_field
(
self
.
csr
,
self
.
CSR
,
'STAT'
,
'FMC_PRES'
)
# Get Gennum core P2L PLL lock state
def
get_p2l_pll_lock
(
self
):
...
...
test/fmcadc100m14b4cha/python/test00.py
View file @
e9fb39c4
...
...
@@ -32,46 +32,48 @@ test00: Load firmware, verify firmware type and test mezzanine presence line.
def
main
(
default_directory
=
'.'
):
# Constants declaration
FMC_ADC_ADDR
=
'1a39:0004/1a39:0004@000B:0000'
#
FMC_ADC_ADDR = '1a39:0004/1a39:0004@000B:0000'
FMC_ADC_BITSTREAM
=
'../firmwares/spec_fmcadc100m14b4cha.bin'
EXPECTED_BITSTREAM_TYPE
=
0x1
start_test_time
=
time
.
time
()
print
"================================================================================"
print
"Test00 start
\n
"
# SPEC object declaration
print
"Loading hardware access library and opening device.
\n
"
spec
=
rr
.
Gennum
()
# Bind SPEC object to FMC ADC card
for
name
,
value
in
spec
.
parse_addr
(
FMC_ADC_ADDR
)
.
iteritems
():
print
"
%9
s:0x
%04
X"
%
(
name
,
value
)
#
for name, value in spec.parse_addr(FMC_ADC_ADDR).iteritems():
#
print "%9s:0x%04X"%(name, value)
spec
.
bind
(
FMC_ADC_ADDR
)
#
spec.bind(FMC_ADC_ADDR)
# Load FMC ADC firmware
print
"
\n
Loading FMC ADC firmware:
%
s
"
%
FMC_ADC_BITSTREAM
print
"
Loading FMC ADC firmware:
%
s
\n
"
%
FMC_ADC_BITSTREAM
spec
.
load_firmware
(
FMC_ADC_BITSTREAM
)
time
.
sleep
(
2
)
# Carrier object declaration (SPEC board specific part)
carrier
=
CFmcAdc100mSpec
(
spec
)
try
:
carrier
=
CFmcAdc100mSpec
(
spec
,
EXPECTED_BITSTREAM_TYPE
)
except
FmcAdc100mSpecOperationError
as
e
:
raise
PtsCritical
(
"The test is stopped due to the following critical error: "
+
e
)
#
Check
bitsteam type
#
Print
bitsteam type
bitstream_type
=
carrier
.
get_bitstream_type
()
print
(
'
\n
Bitstream type:
%.8
X'
)
%
bitstream_type
if
(
bitstream_type
==
0xFFFFFFFF
):
raise
PtsCritical
(
"Firmware not properly loaded."
)
if
(
bitstream_type
!=
EXPECTED_BITSTREAM_TYPE
):
raise
PtsCritical
(
"Wrong bitstream type."
)
else
:
print
"Bitstream type OK."
# Dump carrier CSR to log
print
(
'Bitstream type:0x
%.8
X'
)
%
bitstream_type
print
"Bitstream type OK.
\n
"
# Print carrier CSR registers
carrier
.
print_csr
()
# Check mezzanine presence flag
if
(
carrier
.
get_fmc_presence
()):
raise
PtsCritical
(
"Mezzanine not present or PRSNT_M2C_L line faulty."
)
else
:
print
"Mezzanine present, tests can continue."
print
"End of test00
\n
"
print
"================================================================================"
end_test_time
=
time
.
time
()
print
"Test00 elapsed time:
%.2
f seconds
\n
"
%
(
end_test_time
-
start_test_time
)
if
__name__
==
'__main__'
:
...
...
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