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
a19841bc
Commit
a19841bc
authored
Feb 27, 2013
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test17: update test to work with latest modules version.
parent
768724ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
test17.py
test/fmcadc100m14b4cha/python/test17.py
+32
-11
No files found.
test/fmcadc100m14b4cha/python/test17.py
View file @
a19841bc
...
...
@@ -6,16 +6,26 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Import system modules
import
sys
import
rr
import
time
import
os
from
numpy
import
*
from
pylab
import
*
# Add common modules and libraries location to path
sys
.
path
.
append
(
'../../../'
)
sys
.
path
.
append
(
'../../../gnurabbit/python/'
)
sys
.
path
.
append
(
'../../../common/'
)
# Import common modules
import
rr
from
ptsexcept
import
*
import
spec_fmc_adc
# Import specific modules
from
numpy
import
*
from
pylab
import
*
from
ctypes
import
*
import
fmc_adc_spec
import
fmc_adc
import
calibr_box
import
find_usb_tty
...
...
@@ -191,13 +201,21 @@ def get_mean_value(adc_fs, adc_nbits, acq):
def
main
(
default_directory
=
'.'
):
# Load firmware to FPGA
load_firmware
(
default_directory
)
# Constants declaration
TEST_NB
=
19
EXPECTED_BITSTREAM_TYPE
=
0x1
FMC_ADC_BITSTREAM
=
'../firmwares/spec_fmcadc100m14b4cha.bin'
FMC_ADC_BITSTREAM
=
os
.
path
.
join
(
default_directory
,
FMC_ADC_BITSTREAM
)
# Objects declaration
spec
=
rr
.
Gennum
()
# bind to the SPEC board
spec_fmc
=
spec_fmc_adc
.
CSpecFmcAdc100Ms
(
spec
)
fmc
=
fmc_adc
.
CFmcAdc100Ms
(
spec
)
print
"Loading FMC ADC firmware:
%
s
\n
"
%
FMC_ADC_BITSTREAM
spec
.
load_firmware
(
FMC_ADC_BITSTREAM
)
time
.
sleep
(
2
)
carrier
=
fmc_adc_spec
.
CFmcAdc100mSpec
(
spec
,
EXPECTED_BITSTREAM_TYPE
)
fmc
=
fmc_adc
.
CFmcAdc100m
(
spec
)
usb_tty
=
find_usb_tty
.
CttyUSB
()
awg_tty
=
usb_tty
.
find_usb_tty
(
AWG_USB_VENDOR_ID
,
AWG_USB_DEVICE_ID
)
box_tty
=
usb_tty
.
find_usb_tty
(
BOX_USB_VENDOR_ID
,
BOX_USB_DEVICE_ID
)
...
...
@@ -205,8 +223,11 @@ def main (default_directory = '.'):
sine
=
SineWaveform
()
box
=
calibr_box
.
CCalibr_box
(
box_tty
[
0
])
# Work-around to make dma work with sdb firmware
carrier
.
gnum
.
set_local_bus_freq
(
150
)
# Enable "DMA finished" IRQ
spec_fmc
.
set_irq_en_mask
(
0x1
)
carrier
.
set_irq_en_mask
(
0x1
)
# Initialise fmc adc
fmc_adc_init
(
spec
,
fmc
)
...
...
@@ -218,7 +239,7 @@ def main (default_directory = '.'):
#gen.output = False
# Measure FMC and carrier temperature
print
(
'SPEC temperature:
%3.3
f°C'
)
%
spec_fmc
.
get_temp
()
print
(
'SPEC temperature:
%3.3
f°C'
)
%
carrier
.
get_temp
()
print
(
'FMC temperature :
%3.3
f°C'
)
%
fmc
.
get_temp
()
# Open all switches, reset offset DAC to mid-scale (0V)
...
...
@@ -261,7 +282,7 @@ def main (default_directory = '.'):
time
.
sleep
(
SSR_SET_SLEEP
)
# Measures value on each channel
acq_d
=
acquisition_all
(
fmc
,
spec_fmc
)
acq_d
=
acquisition_all
(
fmc
,
carrier
)
acq_d
=
[
hex2signed
(
item
)
for
item
in
acq_d
]
acq_v
=
[
digital2volt
(
item
,
ADC_FS
,
ADC_NBITS
)
for
item
in
acq_d
]
mean_v
=
get_mean_value
(
ADC_FS
,
ADC_NBITS
,
acq_d
)
...
...
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