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
34b3e6ab
Commit
34b3e6ab
authored
Mar 13, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fmc_adc_spec: Add verbose param, remove unsless 3sec sleep.
parent
ec0e2f93
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
fmc_adc_spec.py
test/fmcadc100m14b4cha/python/fmc_adc_spec.py
+15
-9
No files found.
test/fmcadc100m14b4cha/python/fmc_adc_spec.py
View file @
34b3e6ab
...
...
@@ -470,13 +470,14 @@ class CFmcAdc100mSpec:
# Writes data pattern to carrier's DDR memory
def
put_data
(
self
,
carrier_addr
,
pattern
,
length
):
def
put_data
(
self
,
carrier_addr
,
pattern
,
length
,
verbose
=
False
):
# Configure DMA
items_required
=
int
(
math
.
ceil
(
length
/
float
(
self
.
DMA_LENGTH
)))
if
(
128
<
items_required
):
print
(
'Required items:
%
d'
)
%
items_required
raise
Exception
(
'Current gn4124 class only supports up to 128 items.'
)
print
(
'Required items:
%
d'
)
%
items_required
if
verbose
:
print
(
'Required items:
%
d'
)
%
items_required
for
num
in
range
(
items_required
):
if
(
items_required
==
num
+
1
):
next_item
=
0
...
...
@@ -498,20 +499,24 @@ class CFmcAdc100mSpec:
# Write pattern to DMA reserved host memory pages
for
page
in
range
(
1
,
items_required
):
print
(
"Writting
%8
X pattern on host memory page
%
d"
%
(
pattern
,
page
))
if
verbose
:
print
(
"Writting
%8
X pattern on host memory page
%
d"
%
(
pattern
,
page
))
self
.
gnum
.
set_memory_page
(
page
,
pattern
)
#self.print_irq_controller_regs()
time
.
sleep
(
3
)
#
time.sleep(3)
# Start DMA
self
.
gnum
.
start_dma
()
# Wait for end of DMA interrupt
print
(
'Wait GN4124 interrupt'
)
if
verbose
:
print
(
'Wait GN4124 interrupt'
)
self
.
gnum
.
wait_irq
()
print
(
'GN4124 interrupt occured'
)
if
verbose
:
print
(
'GN4124 interrupt occured'
)
dma_finished
=
0
self
.
print_irq_controller_regs
()
#print('irq mask:%.4X')%self.get_irq_en_mask()
if
verbose
:
self
.
print_irq_controller_regs
()
print
(
'irq mask:
%.4
X'
)
%
self
.
get_irq_en_mask
()
while
(
0
==
dma_finished
):
irq_src
=
self
.
get_irq_source
()
#print('IRQ source : %.4X')%irq_src
...
...
@@ -522,6 +527,7 @@ class CFmcAdc100mSpec:
#print('IRQ source : %.4X')%self.get_irq_source()
dma_finished
=
1
time
.
sleep
(
0.005
)
print
(
'DMA finished!'
)
if
verbose
:
print
(
'DMA finished!'
)
###########################################################################
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