DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
timing
python
timing
shells
fanout.py
Go to the documentation of this file.
1
2
from
__future__
import
print_function
3
4
import
click
5
import
time
6
import
collections
7
8
import
timing.cli.toolbox
as
toolbox
9
import
timing.common.definitions
as
defs
10
11
from
.factory
import
ShellFactory, ShellContext
12
from
.master
import
MasterShell
13
from
click
import
echo, style, secho
14
from
timing.core
import
SI534xSlave, I2CExpanderSlave, DACSlave
15
16
from
timing.common.definitions
import
kBoardSim, kBoardFMC, kBoardPC059, kBoardMicrozed, kBoardTLU
17
from
timing.common.definitions
import
kCarrierEnclustraA35, kCarrierKC705, kCarrierMicrozed
18
from
timing.common.definitions
import
kDesignOverlord, kDesignMaster, kDesignOuroboros, kDesignOuroborosSim, kDesignEndpoint, kDesignFanout
19
from
timing.common.definitions
import
kBoardNameMap, kCarrierNameMap, kDesignNameMap
20
21
from
os.path
import
join, expandvars, basename
22
23
24
# ------------------------------------------------------------------------------
25
class
FanoutShell
(
MasterShell
):
26
27
def
scanports
(self):
28
29
lDevice = self.device
30
lGlobal = self.
masterCtx
.globalNode
31
lBoardType = self.info.boardType
32
33
if
lBoardType != kBoardPC059:
34
raise
RuntimeError(
'Mux is only available on PC059 boards'
)
35
36
lLocked = []
37
for
mux
in
range(0,8):
38
secho(
'Scanning slot {}'
.format(mux), fg=
'cyan'
)
39
40
lDevice.getNode(
'io.csr.ctrl.mux'
).write(mux)
41
lDevice.dispatch()
42
# echo('SFP input mux set to {}'.format(mux))
43
44
try
:
45
self.
enableEptAndWaitForReady
()
46
lState = lGlobal.getNode(
'csr.stat.ep_stat'
).read()
47
lFDel = lGlobal.getNode(
'csr.stat.ep_fdel'
).read()
48
lEdge = lGlobal.getNode(
'csr.stat.ep_edge'
).read()
49
lGlobal.getClient().dispatch()
50
51
secho(
'Endpoint locked: state={}, fdel={}, edge={}'
.format(hex(lState), hex(lFDel), hex(lEdge)), fg=
'blue'
)
52
lLocked.append(mux)
53
except
RuntimeError
as
e:
54
secho(
'Slot {}: no lock - {}'
.format(mux,e), fg=
'yellow'
)
55
56
echo()
57
if
lLocked:
58
secho(
'Locked slots {}'
.format(
','
.join( ( str(l)
for
l
in
lLocked))), fg=
'green'
)
59
else
:
60
secho(
'No slots locked'
, fg=
'red'
)
61
return
lLocked
62
63
ShellFactory.registerBoard(kDesignFanout, FanoutShell)
64
65
# ------------------------------------------------------------------------------
timing.shells.fanout.FanoutShell
Definition
fanout.py:25
timing.shells.fanout.FanoutShell.scanports
scanports(self)
Definition
fanout.py:27
timing.shells.master.MasterShell
Definition
master.py:22
timing.shells.master.MasterShell.enableEptAndWaitForReady
enableEptAndWaitForReady(self, aTimeout=0.5)
Definition
master.py:131
timing.shells.master.MasterShell.masterCtx
masterCtx
Definition
master.py:57
timing.cli.toolbox
Definition
toolbox.py:1
timing.common.definitions
Definition
__init__.py:1
timing.core
Definition
__init__.py:1
Generated on
for DUNE-DAQ by
1.17.0