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
7b15a673
Commit
7b15a673
authored
Oct 11, 2011
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test09 to launch script, work on test09
parent
01291661
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
fmcadc100m14b4cha.sh
fmcadc100m14b4cha.sh
+1
-1
test09.py
test/fmcadc100m14b4cha/python/test09.py
+39
-9
No files found.
fmcadc100m14b4cha.sh
View file @
7b15a673
...
...
@@ -33,7 +33,7 @@ fi
echo
-n
"--------------------------------------------------------------
\n
"
sudo
./pts.py
-b
FmcAdc100M14b4cha
-s
$serial
-e
$extra_serial
-t
./test/fmcadc100m14b4cha/python
-l
$LOGDIR
00 01 02 03 04 05 06 07 08
sudo
./pts.py
-b
FmcAdc100M14b4cha
-s
$serial
-e
$extra_serial
-t
./test/fmcadc100m14b4cha/python
-l
$LOGDIR
00 01 02 03 04 05 06 07 08
09
echo
-n
"Press enter to exit... "
...
...
test/fmcadc100m14b4cha/python/test09.py
View file @
7b15a673
...
...
@@ -10,8 +10,8 @@ import sys
import
rr
import
time
import
os
from
numpy
import
*
from
pylab
import
*
#
from numpy import *
#
from pylab import *
from
ptsexcept
import
*
...
...
@@ -84,6 +84,18 @@ points = [[1E6, 36300, 1000],
[80E6, 3400, 200]]
"""
def
load_firmware
(
default_directory
):
print
(
'Load firmware to FPGA'
)
path_fpga_loader
=
'../../../gnurabbit/user/fpga_loader'
;
path_firmware
=
'../firmwares/spec_fmcadc100m14b4cha.bin'
;
firmware_loader
=
os
.
path
.
join
(
default_directory
,
path_fpga_loader
)
bitstream
=
os
.
path
.
join
(
default_directory
,
path_firmware
)
print
firmware_loader
+
' '
+
bitstream
os
.
system
(
firmware_loader
+
' '
+
bitstream
)
time
.
sleep
(
2
);
def
open_all_channels
(
fmc
):
for
i
in
range
(
1
,
NB_CHANNELS
+
1
):
fmc
.
set_input_range
(
i
,
'OPEN'
)
...
...
@@ -95,7 +107,7 @@ def set_awg_freq(gen, sine, freq):
print
(
'Sine frequency:
%3.3
fMHz'
)
%
(
sine
.
frequency
/
1E6
)
time
.
sleep
(
AWG_SET_SLEEP
)
def
acquisition
(
gnum
,
pages
,
fmc
,
channel
):
def
acquisition
(
gnum
,
pages
,
fmc
,
channel
_nb
,
channel_data
):
# Start acquisition
fmc
.
stop_acq
()
#print('Acquisition FSM state : %s') % fmc.get_acq_fsm_state()
...
...
@@ -107,21 +119,30 @@ def acquisition(gnum, pages, fmc, channel):
time
.
sleep
(
.1
)
# Retrieve data trough DMA
page1_data_before_dma
=
gnum
.
get_memory_page
(
1
)
gnum
.
add_dma_item
(
0x100
,
pages
[
1
],
DMA_LENGTH
,
0
,
0
)
gnum
.
start_dma
()
gnum
.
wait_irq
()
page1_data
=
gnum
.
get_memory_page
(
1
)
channels
=
[]
if
(
page1_data_before_dma
==
page1_data
):
print
(
'page1 before DMA:'
)
print
page1_data_before_dma
[
0
:
20
]
print
(
'page1 after DMA:'
)
print
page1_data
[
0
:
20
]
#raise PtsError('Acquisition or DMA error')
return
-
1
for
i
in
range
(
len
(
page1_data
)):
channel
s
.
append
(
page1_data
[
i
]
&
0xFFFF
)
channel
s
.
append
(
page1_data
[
i
]
>>
16
)
channel
_data
.
append
(
page1_data
[
i
]
&
0xFFFF
)
channel
_data
.
append
(
page1_data
[
i
]
>>
16
)
return
channels
[
channel
-
1
::
4
]
channel_data
=
channel_data
[
channel_nb
-
1
::
4
]
return
0
def
main
(
default_directory
=
'.'
):
"""
# Load firmware to FPGA
path_fpga_loader = '../../../gnurabbit/user/fpga_loader';
path_firmware = '../firmwares/spec_fmcadc100m14b4cha.bin';
...
...
@@ -175,8 +196,13 @@ def main (default_directory='.'):
for
i
in
range
(
1
,
NB_CHANNELS
+
1
):
fmc
.
set_input_range
(
i
,
'1V'
)
time
.
sleep
(
SSR_SET_SLEEP
)
channel
=
acquisition
(
gnum
,
pages
,
fmc
,
i
)
diff
=
max
(
channel
)
-
min
(
channel
)
channel_data
=
[]
error
=
acquisition
(
gnum
,
pages
,
fmc
,
i
,
channel_data
)
if
(
error
!=
0
):
load_firmware
(
default_directory
)
j
-=
1
break
diff
=
max
(
channel_data
)
-
min
(
channel_data
)
print
(
'CH
%
d diff:
%
d'
)
%
(
i
,
diff
)
ch_diff
.
append
(
diff
)
fmc
.
set_input_range
(
i
,
'OPEN'
)
...
...
@@ -185,6 +211,9 @@ def main (default_directory='.'):
print
(
'Current amplitude:
%
d, expected:
%
d +/-
%
d'
)
%
(
diff
,
points
[
j
][
1
],
points
[
j
][
2
])
raise
PtsError
(
'Channel
%
d frequency response is out of range at freq:
%2.3
fMHz'
%
(
i
,
points
[
j
][
0
]
/
1E6
))
# The following code is to show a graph of the test results
# !! Don't forget to import numpy and pylab !!
"""
pt = array(points)
freq = pt[:,0]
a_min = pt[:,1] - pt[:,2]
...
...
@@ -197,6 +226,7 @@ def main (default_directory='.'):
semilogx(freq, a_max, 'r:', label='Upper limit')
legend()
show()
"""
# Make sure all switches are OFF
open_all_channels
(
fmc
)
...
...
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