Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
euro-adc-65m-14b-40cha-gw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
eurocard
euro-adc-65m-14b-40cha
euro-adc-65m-14b-40cha-gw
Commits
e903e2a5
Commit
e903e2a5
authored
Nov 06, 2017
by
Dan Saunders
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version of builk aligning
parent
67d42e74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
14 deletions
+10
-14
align_adc.py
projects/64ch/software/align_adc.py
+4
-5
align_adc_bulk.py
projects/64ch/software/align_adc_bulk.py
+5
-8
setup.py
projects/64ch/software/setup.py
+1
-1
No files found.
projects/64ch/software/align_adc.py
View file @
e903e2a5
...
...
@@ -68,8 +68,7 @@ for i in adcs:
spi_write
(
spi
,
0x4
,
patt
&
0xff
)
# Test pattern
for
i_chan
in
chans
:
board
.
getNode
(
"csr.ctrl.chan"
)
.
write
(
i_chan
)
# Talk to channel 0
board
.
getNode
(
"csr.ctrl.chan"
)
.
write
(
i_chan
)
# Talk to channel 0
board
.
getNode
(
"daq.chan.csr.ctrl.mode"
)
.
write
(
0x1
)
# Set to capture mode
board
.
getNode
(
"daq.chan.csr.ctrl.src"
)
.
write
(
0x0
)
# Set source to ADC
board
.
getNode
(
"daq.chan.csr.ctrl.en_sync"
)
.
write
(
0x1
)
# Enable sync commands
...
...
@@ -99,9 +98,9 @@ for i_chan in chans:
for
w
in
d
:
if
int
(
w
)
&
0x3ff
==
patt
:
c
+=
1
#
print hex(w),
#
print hex(i_chan), hex(i_slip), hex(i_tap), c
res
[
offsets
[
i_slip
]
*
taps_per_slip
+
(
31
-
i_tap
)]
=
(
c
==
cap_len
)
print
hex
(
w
),
print
hex
(
i_chan
),
hex
(
i_slip
),
hex
(
i_tap
),
c
res
[
offsets
[
i_slip
]
*
taps_per_slip
+
(
31
-
i_tap
)]
=
(
c
==
cap_len
)
ok
=
(
c
==
cap_len
)
or
ok
board
.
getNode
(
"daq.timing.csr.ctrl.chan_inc"
)
.
write
(
0x1
)
# Increment tap
board
.
getNode
(
"daq.timing.csr.ctrl.chan_inc"
)
.
write
(
0x0
)
...
...
projects/64ch/software/align_adc_bulk.py
View file @
e903e2a5
#!/usr/bin/python
import
dataset
import
uhal
import
time
import
sys
...
...
@@ -37,23 +38,19 @@ offsets = [0, 13, 2, 1, 4, 3, 6, 5, 8, 7, 10, 9, 12, 11]
invert
=
[
0x1d
,
0x1e
,
0x1f
,
0x20
,
0x21
,
0x22
,
0x23
,
0x24
,
0x25
]
# Db stuff.
ips
=
detector_config_tools
.
currentIPs
(
False
)
ips
=
[
9
2
]
ips
=
[
6
2
]
db
=
dataset
.
connect
(
'mysql://DAQGopher:gogogadgetdatabase@localhost/solid_phase1_running'
)
configID
=
0
#first time case
if
len
(
db
[
'TapSlips'
])
!=
0
:
configID
=
max
(
db
[
'TapSlips'
][
'configID'
])[
'configID'
]
+
1
print
'Bulk scanning ips:'
,
ips
print
'New TapSlips configID'
,
configID
uhal
.
setLogLevelTo
(
uhal
.
LogLevel
.
ERROR
)
for
ith_ip
in
ips
:
ith_slips
,
ith_taps
=
[],
[]
print
'
\n\n
*********** About to align ip:'
,
ith_ip
board
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235."
+
str
(
ith_ip
)
+
":50001"
,
"file://addrtab/top.xml"
)
uhal
.
setLogLevelTo
(
uhal
.
LogLevel
.
ERROR
)
board
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235.50:50001"
,
"file://addrtab/top.xml"
)
#board = uhal.getDevice("board", "ipbusudp-2.0://192.168.235.16:50001", "file://addrtab/top_sim.xml")
board
.
getClient
()
.
setTimeoutPeriod
(
10000
)
v
=
board
.
getNode
(
"csr.id"
)
.
read
()
board
.
dispatch
()
...
...
@@ -114,8 +111,8 @@ for ith_ip in ips:
for
w
in
d
:
if
int
(
w
)
&
0x3ff
==
patt
:
c
+=
1
#
print hex(w),
#
print hex(i_chan), hex(i_slip), hex(i_tap), c
print
hex
(
w
),
print
hex
(
i_chan
),
hex
(
i_slip
),
hex
(
i_tap
),
c
res
[
offsets
[
i_slip
]
*
taps_per_slip
+
(
31
-
i_tap
)]
=
(
c
==
cap_len
)
ok
=
(
c
==
cap_len
)
or
ok
board
.
getNode
(
"daq.timing.csr.ctrl.chan_inc"
)
.
write
(
0x1
)
# Increment tap
...
...
projects/64ch/software/setup.py
View file @
e903e2a5
...
...
@@ -7,7 +7,7 @@ from I2CuHal import I2CCore
from
si5344
import
si5344
uhal
.
setLogLevelTo
(
uhal
.
LogLevel
.
INFO
)
hw
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235.
100
:50001"
,
"file://addrtab/top.xml"
)
hw
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235.
62
:50001"
,
"file://addrtab/top.xml"
)
hw
.
getNode
(
"csr.ctrl.soft_rst"
)
.
write
(
1
)
# Reset ipbus registers
hw
.
dispatch
()
...
...
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