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

Public Member Functions

 getAX3Slave (self)
 
 getUIDSlave (self)
 
 getSIChipSlave (self)
 
 resetI2CnPll (self)
 
 resetLockMon (self)
 
 configureSFPExpander (self)
 
 reset (self, soft, fanout, forcepllcfg)
 
 selectMux (self, mux)
 
- 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 kPC059Rev1 = 3
 
int kPC059FanoutSFP = 5
 
dict kUIDRevisionMap
 
dict kClockConfigMap
 
list i2cMasters
 

Additional Inherited Members

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

Detailed Description

Definition at line 19 of file pc059.py.

Member Function Documentation

◆ configureSFPExpander()

timing.shells.pc059.PC059Shell.configureSFPExpander ( self)

Definition at line 91 of file pc059.py.

91 def configureSFPExpander(self):
92
93 lI2CBusNode = self.device.getNode("io.i2c")
94 lSFPExp = I2CExpanderSlave(lI2CBusNode, lI2CBusNode.get_slave('SFPExpander').get_i2c_address())
95
96 # Set invert registers to default for both banks
97 lSFPExp.set_inversion(0, 0x00)
98 lSFPExp.set_inversion(1, 0x00)
99
100 # BAnk 0 input, bank 1 output
101 lSFPExp.set_io(0, 0x00)
102 lSFPExp.set_io(1, 0xff)
103
104 # Bank 0 - enable all SFPGs (enable low)
105 lSFPExp.set_outputs(0, 0x00)

◆ getAX3Slave()

timing.shells.pc059.PC059Shell.getAX3Slave ( self)

Definition at line 43 of file pc059.py.

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

◆ getSIChipSlave()

timing.shells.pc059.PC059Shell.getSIChipSlave ( self)

Definition at line 56 of file pc059.py.

56 def getSIChipSlave(self):
57 # Access the clock chip
58 lI2CBusNode = self.device.getNode("io.i2c")
59 return SI534xSlave(lI2CBusNode, lI2CBusNode.get_slave('SI5345').get_i2c_address())

◆ getUIDSlave()

timing.shells.pc059.PC059Shell.getUIDSlave ( self)

Definition at line 50 of file pc059.py.

50 def getUIDSlave(self):
51 lIO = self.device.getNode('io')
52 return lIO.getNode('i2c').get_slave('FMC_UID_PROM')

◆ reset()

timing.shells.pc059.PC059Shell.reset ( self,
soft,
fanout,
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 110 of file pc059.py.

110 def reset(self, soft, fanout, forcepllcfg):
111 '''
112 Perform a hard reset on the timing master, including
113
114 \b
115 - ipbus registers
116 - i2c buses
117 - pll and pll configuration
118
119 \b
120 Fanout mode:
121 0 = local master
122 1 = sfp
123 '''
124
125
126 lDevice = self.device
127 lBoardType = self.info.boardType
128 lCarrierType = self.info.carrierType
129 lDesignType = self.info.designType
130
131 echo('Resetting ' + click.style(lDevice.id(), fg='blue'))
132
133 lIO = lDevice.getNode('io')
134
135 if ( fanout ):
136 secho("Fanout mode enabled", fg='green')
137
138 # Global soft reset
139 self.soft_reset()
140
141 if not soft:
142
143 # PLL and I@C reset
144 time.sleep(0.1)
145
146 # PLL and I2C reset
147 self.resetI2CnPll()
148
149 # Enable the i2c switch on the board
150 self.enableI2CSwitch()
151
152 lUniqueID = self.readUID()
153 # echo("Timing Board PROM UID: "+style(hex(lUniqueID), fg="blue"))
154
155 # Access the clock chip
156 lSIChip = self.getSIChipSlave()
157
158 # Ensure that the board is known to the revision DB
159 try:
160 lRevision = self.kUIDRevisionMap[lUniqueID]
161 except KeyError:
162 raise click.ClickException("No revision associated to UID "+hex(lUniqueID))
163
164 # Ensure that the board revision has a registered clock config
165 if forcepllcfg is not None:
166 lFullClockConfigPath = forcepllcfg
167 echo("Using PLL Clock configuration file: "+style(basename(lFullClockConfigPath), fg='green') )
168
169 else:
170 if lDesignType == kDesignFanout and fanout in [0]:
171 secho("Overriding clock config - fanout mode", fg='green')
172 lClockConfigPath = self.kClockConfigMap[self.kPC059FanoutSFP]
173 else:
174 try:
175 lClockConfigPath = self.kClockConfigMap[lRevision]
176 except KeyError:
177 raise ClickException("Board revision " << lRevision << " has no associated clock configuration")
178
179
180 echo("PLL Clock configuration file: "+style(lClockConfigPath, fg='green') )
181
182 # Configure the clock chip
183 lFullClockConfigPath = expandvars(join('${TIMING_SHARE}/config/etc/clock', lClockConfigPath))
184
185 lSIChip.configure(lFullClockConfigPath)
186 echo("SI3545 configuration id: {}".format(style(lSIChip.read_config_id(), fg='green')))
187
188 self.configureSFPExpander()
189
190 self.resetLockMon()
191
192 if lDesignType == kDesignFanout:
193 lDevice.getNode('switch.csr.ctrl.master_src').write(fanout)
194 lIO.getNode('csr.ctrl.mux').write(0)
195 lDevice.dispatch()
196
197 echo()
198# ------------------------------------------------------------------------------
199
200
201# ------------------------------------------------------------------------------

◆ resetI2CnPll()

timing.shells.pc059.PC059Shell.resetI2CnPll ( self)

Definition at line 64 of file pc059.py.

64 def resetI2CnPll(self):
65 lIO = self.device.getNode('io')
66
67 # PLL and I@C reset
68 lIO.getNode('csr.ctrl.pll_rst').write(0x1)
69 lIO.getNode('csr.ctrl.rst_i2c').write(0x1)
70 lIO.getNode('csr.ctrl.rst_i2cmux').write(0x1)
71 lIO.getClient().dispatch()
72
73 lIO.getNode('csr.ctrl.pll_rst').write(0x0)
74 lIO.getNode('csr.ctrl.rst_i2c').write(0x0)
75 lIO.getNode('csr.ctrl.rst_i2cmux').write(0x0)
76 lIO.getClient().dispatch()

◆ resetLockMon()

timing.shells.pc059.PC059Shell.resetLockMon ( self)

Definition at line 81 of file pc059.py.

81 def resetLockMon(self):
82 lIO = self.device.getNode('io')
83
84 lIO.getNode('csr.ctrl.rst_lock_mon').write(0x1)
85 lIO.getNode('csr.ctrl.rst_lock_mon').write(0x0)
86 lIO.getClient().dispatch()

◆ selectMux()

timing.shells.pc059.PC059Shell.selectMux ( self,
mux )

Definition at line 202 of file pc059.py.

202 def selectMux(self, mux):
203 lDevice = self.device
204
205 lDevice.getNode('io.csr.ctrl.mux').write(mux)
206 lDevice.dispatch()
207 # secho('SFP input mux set to {}'.format(mux), fg='yellow')
208# ------------------------------------------------------------------------------
209

Member Data Documentation

◆ i2cMasters

list timing.shells.pc059.PC059Shell.i2cMasters
static
Initial value:
= [
'i2c',
'usfp_i2c',
]

Definition at line 38 of file pc059.py.

◆ kClockConfigMap

dict timing.shells.pc059.PC059Shell.kClockConfigMap
static
Initial value:
= {
kPC059Rev1: "SI5345/PDTS0005.txt",
kPC059FanoutSFP: "wr/FANOUT_PLL_WIDEBW_SFPIN.txt",
}

Definition at line 33 of file pc059.py.

◆ kPC059FanoutSFP

int timing.shells.pc059.PC059Shell.kPC059FanoutSFP = 5
static

Definition at line 22 of file pc059.py.

◆ kPC059Rev1

int timing.shells.pc059.PC059Shell.kPC059Rev1 = 3
static

Definition at line 21 of file pc059.py.

◆ kUIDRevisionMap

dict timing.shells.pc059.PC059Shell.kUIDRevisionMap
static
Initial value:
= {
0xd88039d980cf: kPC059Rev1,
0xd88039d98adf: kPC059Rev1,
0xd88039d92491: kPC059Rev1,
0xd88039d9248e: kPC059Rev1,
0xd88039d98ae9: kPC059Rev1,
0xd88039d92498: kPC059Rev1,
}

Definition at line 24 of file pc059.py.


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