DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
timing.shells.tlu.TLUShell Class Reference
Inheritance diagram for timing.shells.tlu.TLUShell:
[legend]
Collaboration diagram for timing.shells.tlu.TLUShell:
[legend]

Public Member Functions

 getAX3Slave (self)
 
 getUIDSlave (self)
 
 resetI2CnPll (self)
 
 resetLockMon (self)
 
 configureExpanders (self)
 
 configure_pllSwing (self)
 
 configure_dacs (self)
 
 reset (self, soft, forcepllcfg)
 
- Public Member Functions inherited from timing.shells.boards.BoardShell
 soft_reset (self)
 
 enableI2CSwitch (self)
 
 readUID (self)
 
 scanI2C (self)
 
 pingI2CSlaves (self)
 
 measureClockFrequency (self)
 
 status (self)
 
 pllstatus (self, verbose=False)
 

Static Public Attributes

int kTLURev1 = 6
 
dict kUIDRevisionMap
 
dict kClockConfigMap
 
list i2cMasters
 

Additional Inherited Members

- Public Attributes inherited from timing.shells.boards.BoardShell
 i2cMasters = lIO.getNode(lI2CName)
 

Detailed Description

docstring for PC059Shell

Definition at line 20 of file tlu.py.

Member Function Documentation

◆ configure_dacs()

timing.shells.tlu.TLUShell.configure_dacs ( self)

Definition at line 113 of file tlu.py.

113 def configure_dacs(self):
114 lI2CBusNode = self.device.getNode("io.i2c")
115
116 lDAC1 = DACSlave(lI2CBusNode, lI2CBusNode.get_slave('DAC1').get_i2c_address())
117 lDAC2 = DACSlave(lI2CBusNode, lI2CBusNode.get_slave('DAC2').get_i2c_address())
118
119 # BI signals are NIM
120 lBISignalThreshold = 0x589D
121
122 lDAC1.set_interal_ref(False);
123 lDAC2.set_interal_ref(False);
124 lDAC1.set_dac(7, lBISignalThreshold);
125 lDAC2.set_dac(7, lBISignalThreshold);
126
127 secho("DAC1 and DAC2 set to " + hex(lBISignalThreshold), fg='cyan')

◆ configure_pllSwing()

timing.shells.tlu.TLUShell.configure_pllSwing ( self)

Definition at line 105 of file tlu.py.

105 def configure_pllSwing(self):
106 lI2CBusNode = self.device.getNode("io.i2c")
107 lSIChip = SI534xSlave(lI2CBusNode, lI2CBusNode.get_slave('SI5345').get_i2c_address())
108
109 lSIChip.write_i2cArray(0x113, [0x9, 0x33])

◆ configureExpanders()

timing.shells.tlu.TLUShell.configureExpanders ( self)

Definition at line 74 of file tlu.py.

74 def configureExpanders(self):
75
76 lI2CBusNode = self.device.getNode("io.i2c")
77
78 lIC6 = I2CExpanderSlave(lI2CBusNode, lI2CBusNode.get_slave('Expander1').get_i2c_address())
79 lIC7 = I2CExpanderSlave(lI2CBusNode, lI2CBusNode.get_slave('Expander2').get_i2c_address())
80
81 # Bank 0
82 lIC6.set_inversion(0, 0x00)
83 lIC6.set_io(0, 0x00)
84 lIC6.set_outputs(0, 0x00)
85
86 # Bank 1
87 lIC6.set_inversion(1, 0x00)
88 lIC6.set_io(1, 0x00)
89 lIC6.set_outputs(1, 0x88)
90
91
92 # Bank 0
93 lIC7.set_inversion(0, 0x00)
94 lIC7.set_io(0, 0x00)
95 lIC7.set_outputs(0, 0xf0)
96
97 # Bank 1
98 lIC7.set_inversion(1, 0x00)
99 lIC7.set_io(1, 0x00)
100 lIC7.set_outputs(1, 0xf0)

◆ getAX3Slave()

timing.shells.tlu.TLUShell.getAX3Slave ( self)

Definition at line 36 of file tlu.py.

36 def getAX3Slave(self):
37 lIO = self.device.getNode('io')
38 return lIO.getNode('i2c').get_slave('AX3_Switch')

◆ getUIDSlave()

timing.shells.tlu.TLUShell.getUIDSlave ( self)

Definition at line 43 of file tlu.py.

43 def getUIDSlave(self):
44 lIO = self.device.getNode('io')
45 return lIO.getNode('i2c').get_slave('UID_PROM')

◆ reset()

timing.shells.tlu.TLUShell.reset ( self,
soft,
forcepllcfg )
Perform a hard reset on the timing master, including

\b
- ipbus registers
- i2c buses
- pll and pll configuration

\b
Fanout mode:
0 = local master
1 = sfp

Definition at line 131 of file tlu.py.

131 def reset(self, soft, forcepllcfg):
132 '''
133 Perform a hard reset on the timing master, including
134
135 \b
136 - ipbus registers
137 - i2c buses
138 - pll and pll configuration
139
140 \b
141 Fanout mode:
142 0 = local master
143 1 = sfp
144 '''
145
146 lDevice = self.device
147 lBoardType = self.info.boardType
148 lCarrierType = self.info.carrierType
149 lDesignType = self.info.designType
150
151 echo('Resetting ' + click.style(lDevice.id(), fg='blue'))
152
153 lIO = lDevice.getNode('io')
154
155 # Global soft reset
156 self.soft_reset()
157
158 if not (soft or lBoardType == kBoardSim):
159
160 time.sleep(0.1)
161
162 # PLL and I@C reset
163 self.resetI2CnPll()
164
165 # Enable I2C routing on carrier
166 self.enableI2CSwitch()
167
168 lUniqueID = self.readUID()
169
170 try:
171 lRevision = self.kUIDRevisionMap[lUniqueID]
172 except KeyError:
173 raise click.ClickException("No revision associated to UID "+hex(lUniqueID))
174
175 # Access the clock chip
176 lI2CBusNode = lDevice.getNode("io.i2c")
177 lSIChip = SI534xSlave(lI2CBusNode, lI2CBusNode.get_slave('SI5345').get_i2c_address())
178 lSIVersion = lSIChip.read_device_version()
179 echo("PLL version : "+style(hex(lSIVersion), fg='blue'))
180
181 # Ensure that the board revision has a registered clock config
182 if forcepllcfg is not None:
183 lFullClockConfigPath = forcepllcfg
184 echo("Using PLL Clock configuration file: "+style(basename(lFullClockConfigPath), fg='green') )
185 else:
186 try:
187 lClockConfigPath = self.kClockConfigMap[lRevision]
188 except KeyError:
189 raise ClickException("Board revision " << lRevision << " has no associated clock configuration")
190
191 echo("PLL Clock configuration file: "+style(lClockConfigPath, fg='green') )
192
193 # Configure the clock chip
194 lFullClockConfigPath = expandvars(join('${TIMING_SHARE}/config/etc/clock', lClockConfigPath))
195
196 lSIChip.configure(lFullClockConfigPath)
197 echo("SI3545 configuration id: {}".format(style(lSIChip.read_config_id(), fg='green')))
198
199 self.configureExpanders()
200
201 # Tweak the PLL swing
202 lI2CBusNode = lDevice.getNode("io.i2c")
203 self.configure_pllSwing()
204
205 self.configure_dacs()
206
207 self.resetLockMon()
208# ------------------------------------------------------------------------------
209

◆ resetI2CnPll()

timing.shells.tlu.TLUShell.resetI2CnPll ( self)

Definition at line 49 of file tlu.py.

49 def resetI2CnPll(self):
50 lIO = self.device.getNode('io')
51
52 # PLL and I@C reset
53 lIO.getNode('csr.ctrl.pll_rst').write(0x1)
54 lIO.getNode('csr.ctrl.rst_i2c').write(0x1)
55 lIO.getClient().dispatch()
56
57 lIO.getNode('csr.ctrl.pll_rst').write(0x0)
58 lIO.getNode('csr.ctrl.rst_i2c').write(0x0)
59 lIO.getClient().dispatch()

◆ resetLockMon()

timing.shells.tlu.TLUShell.resetLockMon ( self)

Definition at line 64 of file tlu.py.

64 def resetLockMon(self):
65 lIO = self.device.getNode('io')
66
67 lIO.getNode('csr.ctrl.rst_lock_mon').write(0x1)
68 lIO.getNode('csr.ctrl.rst_lock_mon').write(0x0)
69 lIO.getClient().dispatch()

Member Data Documentation

◆ i2cMasters

list timing.shells.tlu.TLUShell.i2cMasters
static
Initial value:
= [
'i2c',
]

Definition at line 32 of file tlu.py.

◆ kClockConfigMap

dict timing.shells.tlu.TLUShell.kClockConfigMap
static
Initial value:
= {
kTLURev1: "wr/TLU_EXTCLK_10MHZ_NOZDM.txt"
}

Definition at line 28 of file tlu.py.

◆ kTLURev1

int timing.shells.tlu.TLUShell.kTLURev1 = 6
static

Definition at line 22 of file tlu.py.

◆ kUIDRevisionMap

dict timing.shells.tlu.TLUShell.kUIDRevisionMap
static
Initial value:
= {
0x5410ecbb9426: kTLURev1,
}

Definition at line 24 of file tlu.py.


The documentation for this class was generated from the following file: