Class LpGbtParent
- java.lang.Object
-
- cbsw.lhcb.pdmdb.GbtGrandParent
-
- cbsw.lhcb.pdmdb.LpGbtParent
-
- All Implemented Interfaces:
Io
- Direct Known Subclasses:
LpGbtDepp
,LpGbtIcDepp
public abstract class LpGbtParent extends GbtGrandParent implements Io
This is the abstract base class for the GBT.
The class maintains a register mirror BitSet that is supposed to faithfully reflect the GBT register settings. Therefore, when updating a GBT register, the register bits in the mirror are updated first, then the array of bytes that span the updated register bit-field are written to the hardware. In this way, any other registers that share the same bytes are re-written with unchanged values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
LpGbtParent.I2c
-
Field Summary
Fields Modifier and Type Field Description (package private) int[]
i2cSclMode
(package private) int[]
i2cSpeed
-
Fields inherited from class cbsw.lhcb.pdmdb.GbtGrandParent
activeEPorts, activeInEGroups, activeOutEGroups, activePSClocks, address, cfgTF, csr, gbi, i2c, id, io, lastI2cTransactionCount, mgt, prefs, txrxBaseAddress
-
-
Constructor Summary
Constructors Constructor Description LpGbtParent(GbtxType gbtx)
Constructor called by unmarshaller via LpGbtAdapter.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
configure()
Configures the GBTjavax.swing.JPanel
makePanel()
Convenience method that makes a GUI panel.void
minimal()
Overwrites the mirrored register bits with the minimal setvoid
putParity(java.nio.ByteBuffer bb)
Compute and insert LpGbt parity byte at end of command buffer.void
readConfigurationFile(java.lang.String fileName)
Reads the GBT register file int the register mirror and builds lists of active e-links and clocksabstract void
reset()
Resets the GBTvoid
resetEPorts()
Performs a reset of the active GBT ePortsvoid
resetPhaseShifter()
Performs a reset of the GBT phase shifter logicvoid
set(java.lang.String key, java.lang.String val)
Writes a register bit-field to the GBTjava.lang.String
showStatus()
Updates the GBT status field in the GUI panelvoid
softReset()
Performs a soft reset of the GBTbyte[]
trainEports()
Performs the automatic GBT ePort phase training.-
Methods inherited from class cbsw.lhcb.pdmdb.GbtGrandParent
chooseConfigurationFile, fuse, get, getActiveEPorts, getId, init, load, put, put, readConfigurationFile, setPreferencesRoot, verify
-
-
-
-
Constructor Detail
-
LpGbtParent
public LpGbtParent(GbtxType gbtx)
Constructor called by unmarshaller via LpGbtAdapter.
- Parameters:
gbtx
- The unmarshalled data.
-
-
Method Detail
-
makePanel
public javax.swing.JPanel makePanel()
Convenience method that makes a GUI panel.
- Specified by:
makePanel
in classGbtGrandParent
- Returns:
- The panel.
-
reset
public abstract void reset()
Resets the GBT
- Specified by:
reset
in classGbtGrandParent
-
set
public void set(java.lang.String key, java.lang.String val)
Writes a register bit-field to the GBT
Field keys are treated as regular expressions for bit-field names except for some special cases when the name is enclosed in []. These update the register mirror with predefined settings but do not write the settings to the GBT.
- Specified by:
set
in classGbtGrandParent
- Parameters:
key
- The register bit-field key nameval
- The value to write
-
minimal
public void minimal()
Overwrites the mirrored register bits with the minimal set
Does not write the values to the GBT.
The minimal set should be enough to get the TCM link alive on power up.
-
readConfigurationFile
public void readConfigurationFile(java.lang.String fileName)
Reads the GBT register file int the register mirror and builds lists of active e-links and clocks
- Overrides:
readConfigurationFile
in classGbtGrandParent
- Parameters:
fileName
- File name path of configuration file
-
showStatus
public java.lang.String showStatus()
Updates the GBT status field in the GUI panel
- Specified by:
showStatus
in classGbtGrandParent
- Returns:
- Status summary string
-
putParity
public void putParity(java.nio.ByteBuffer bb)
Compute and insert LpGbt parity byte at end of command buffer.
- Specified by:
putParity
in classGbtGrandParent
- Parameters:
bb
- The pre-filled command buffer positioned at parity byte.
-
configure
public void configure()
Configures the GBT
Disables the watchdog and timeout feature during the configuration otherwise a timeout might cause the volatile registers to be reset.
This puts the downlinks in 320Mbs mode since this is required for the module tester use case for phase training.
Performs a soft reset.
- Specified by:
configure
in classGbtGrandParent
-
resetPhaseShifter
public void resetPhaseShifter()
Performs a reset of the GBT phase shifter logic
When calling this it is advisable/mandatory to disable the watchdog/timeout feature.
- Specified by:
resetPhaseShifter
in classGbtGrandParent
-
resetEPorts
public void resetEPorts()
Performs a reset of the active GBT ePorts
When calling this it is advisable/mandatory to disable the watchdog/timeout feature.
- Specified by:
resetEPorts
in classGbtGrandParent
-
softReset
public void softReset()
Performs a soft reset of the GBT
When fused with the minimal configuration the GBT startup completes with many registers not yet programmed. This means that when the remaining registers are set parts of the GBT need to be manually reset.
This method manually triggers the required resets.
When calling this it is advisable/mandatory to disable the watchdog/timeout feature.
- Specified by:
softReset
in classGbtGrandParent
-
trainEports
public byte[] trainEports()
Performs the automatic GBT ePort phase training.
The GBT phase scan range is 0-14 with each step UI/8 so almost 2*UI in total. This means that there are two sampling positions that should give stable data. Empirically, the GBT does not always choose the same UI for all of the e-links so this method applies GBTphase%8 to force the value into the range 0-7. This approach gives good results for the PDMDB.
- Specified by:
trainEports
in classGbtGrandParent
- Returns:
- Array of phases
-
-