Class LpGbtParent
- java.lang.Object
-
- cbsw.lhcb.pdmdb.GbtGrandParent
-
- cbsw.lhcb.pdmdb.LpGbtParent
-
- All Implemented Interfaces:
Io
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) classLpGbtParent.I2c(package private) static classLpGbtParent.I2cCmd
-
Field Summary
Fields Modifier and Type Field Description (package private) int[]i2cSclMode(package private) int[]i2cSpeed(package private) inticecSelect-
Fields inherited from class cbsw.lhcb.pdmdb.GbtGrandParent
activeEPorts, activeInEGroups, activeOutEGroups, activePSClocks, address, cfgTF, csr, gbi, i2c, id, io, lastI2cTransactionCount, mgt, prefs, puStateTF, regs, sc, sca, tcmMgt, txrxBaseAddress, type
-
-
Constructor Summary
Constructors Constructor Description LpGbtParent(GbtxType gbtx)Constructor called by unmarshaller via LpGbtAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure()Configures the GBTvoidfuse(java.lang.Runnable pulse)Burn the e-fuses.(package private) voidgetIcEc(int offset, int len, byte command)Appends an IC/EC read command block to the multi-block ByteBuffer.javax.swing.JPanelmakePanel()Convenience method that makes a GUI panel.voidminimal()Overwrites the mirrored register bits with the minimal set(package private) voidprepareIcEc()Prepare (re-initialise) the multi-command IC/EC buffer.(package private) voidputIcEc(int offset, byte[] regBuf, byte command)Appends an IC/EC write command block to the multi-block ByteBuffer.voidputParity(java.nio.ByteBuffer bb)Compute and insert LpGbt parity byte at end of command buffer.voidreadConfigurationFile()Reads the GBT register file into the register mirror and builds lists of active e-links and clocksvoidreset()Reset the GBT.voidresetEPorts()Performs a reset of the active GBT ePortsvoidresetPhaseShifter()Performs a reset of the GBT phase shifter logicvoidset(java.lang.String key, java.lang.String val)Writes a register bit-field to the GBTjava.lang.StringshowStatus()Updates the GBT status field in the GUI panelvoidsoftReset()Performs a soft reset of the GBTbyte[]trainEports()Performs the automatic GBT ePort phase training.-
Methods inherited from class cbsw.lhcb.pdmdb.GbtGrandParent
chooseConfigurationFile, get, getActiveEPorts, getId, init, load, makePanel, put, put, setPreferencesRoot, toString, 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:
makePanelin classGbtGrandParent- Returns:
- The panel.
-
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:
setin 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()
Reads the GBT register file into the register mirror and builds lists of active e-links and clocks
- Overrides:
readConfigurationFilein classGbtGrandParent
-
showStatus
public java.lang.String showStatus()
Updates the GBT status field in the GUI panel
- Specified by:
showStatusin 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:
putParityin classGbtGrandParent- Parameters:
bb- The pre-filled command buffer positioned at parity byte.
-
prepareIcEc
void prepareIcEc()
Prepare (re-initialise) the multi-command IC/EC buffer.
-
putIcEc
void putIcEc(int offset, byte[] regBuf, byte command)Appends an IC/EC write command block to the multi-block ByteBuffer.
- Parameters:
offset- Offset to hardware register.regBuf- Array of register values.command- LpGbt command byte..
-
getIcEc
void getIcEc(int offset, int len, byte command)Appends an IC/EC read command block to the multi-block ByteBuffer.
- Parameters:
offset- Offset to hardware register.len- Number of bytes to read.command- LpGbt command 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:
configurein 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:
resetPhaseShifterin 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:
resetEPortsin 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:
softResetin classGbtGrandParent
-
trainEports
public byte[] trainEports()
Performs the automatic GBT ePort phase training.
The GBT phase scan range is 2*UI in total. This means that there are two sampling positions that should give stable data.
For FastRICH lanes either the FastRICH aurora lane scrambling should be enabled or the lane should be configured to send a PRBS sequence.
For use with muDAQ, FastRICH aurora scrambling should be disabled so FastRICH serialisers must be in PRBS mode before calling this method.
- Specified by:
trainEportsin classGbtGrandParent- Returns:
- Array of phases
-
reset
public void reset()
Reset the GBT.
- Specified by:
resetin classGbtGrandParent
-
fuse
public void fuse(java.lang.Runnable pulse)
Description copied from class:GbtGrandParentBurn the e-fuses.
- Specified by:
fusein classGbtGrandParent- Parameters:
pulse- A runnable that generates the fuse pulse signal
-
-