Class GbtxParent
- java.lang.Object
-
- cbsw.lhcb.pdmdb.GbtGrandParent
-
- cbsw.lhcb.pdmdb.GbtxParent
-
- All Implemented Interfaces:
Io
- Direct Known Subclasses:
GbtxDepp
,GbtxIcDepp
,GbtxSca
public abstract class GbtxParent extends GbtGrandParent implements Io
This is the abstract base class for the GBTX.
The class maintains a register mirror BitSet that is supposed to faithfully reflect the GBTX register settings. Therefore, when updating a GBTX 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
GbtxParent.I2c
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JCheckBox
gbldCB
-
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 GbtxParent(GbtxType gbtx)
Constructor called by unmarshaller via GbtxAdapter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bypassXpll()
Updates the mirrored register bits that bypass the Xpll.void
configure()
Configures the GBTXvoid
configureEpll(java.lang.String rate)
Configures the Epll for all active egroupsvoid
ecEport()
Updates the mirrored register bits that enable the EC ePortvoid
enableXpll()
Updates the mirrored register bits that enable the Xpll.javax.swing.JPanel
makePanel()
Convenience method that makes a GUI panel.void
minimal()
Overwrites the mirrored register bits with the minimal setvoid
programGBLD()
Triggers the programming of the GBLDvoid
putParity(java.nio.ByteBuffer bb)
Compute and insert LpGbt parity byte at end of command buffer.void
readConfigurationFile(java.lang.String fileName)
Reads the GBTX register file int the register mirror and builds lists of active e-links and clocksvoid
readGBLD()
Triggers the reading of the GBLDvoid
resetEPorts()
Performs a reset of the active GBTX ePortsvoid
resetPhaseShifter()
Performs a reset of the GBTX phase shifter logicvoid
set(java.lang.String key, java.lang.String val)
Writes a register bit-field to the GBTXvoid
setGbld()
Updates GBLD register bits of the mirrored registersjava.lang.String
showStatus()
Updates the GBTX status field in the GUI panel.void
softReset()
Performs a soft reset of the GBTXvoid
test()
A register read/write testbyte[]
trainEports()
Performs the automatic GBTX ePort phase training.-
Methods inherited from class cbsw.lhcb.pdmdb.GbtGrandParent
chooseConfigurationFile, fuse, get, getActiveEPorts, getId, init, load, put, put, readConfigurationFile, reset, setPreferencesRoot, verify
-
-
-
-
Constructor Detail
-
GbtxParent
public GbtxParent(GbtxType gbtx)
Constructor called by unmarshaller via GbtxAdapter.
- Parameters:
gbtx
- The unmarshalled data.
-
-
Method Detail
-
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.
-
makePanel
public javax.swing.JPanel makePanel()
Convenience method that makes a GUI panel.
- Specified by:
makePanel
in classGbtGrandParent
- Returns:
- The panel.
-
set
public void set(java.lang.String key, java.lang.String val)
Writes a register bit-field to the GBTX
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 GBTX.
- Specified by:
set
in classGbtGrandParent
- Parameters:
key
- The register bit-field key nameval
- The value to write
-
setGbld
public void setGbld()
Updates GBLD register bits of the mirrored registers
Does not write the values to the GBTX.
-
enableXpll
public void enableXpll()
Updates the mirrored register bits that enable the Xpll.
Does not write the values to the GBTX.
-
bypassXpll
public void bypassXpll()
Updates the mirrored register bits that bypass the Xpll.
Does not write the values to the GBTX.
-
minimal
public void minimal()
Overwrites the mirrored register bits with the minimal set
Does not write the values to the GBTX.
The minimal set should be enough to get the TCM link alive on power up.
-
ecEport
public void ecEport()
Updates the mirrored register bits that enable the EC ePort
Does not write the values to the GBTX.
-
readConfigurationFile
public void readConfigurationFile(java.lang.String fileName)
Reads the GBTX 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 GBTX status field in the GUI panel.
To avoid overheads, uses current content of read cache. Does not read new data from hardware. Use Csr.readBits() or Csr.verify() to update the cache before calling this if required.
- Specified by:
showStatus
in classGbtGrandParent
- Returns:
- Status summary string
-
configure
public void configure()
Configures the GBTX
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
-
configureEpll
public void configureEpll(java.lang.String rate)
Configures the Epll for all active egroups
Sets the PLL parameters, sets the desired data rate, resets the PLL.
Watchdog and timeout should be disabled during this operation.
- Parameters:
rate
- The data rate
-
programGBLD
public void programGBLD()
Triggers the programming of the GBLD
Note: The GBLD I2C address (0x7e) must be preloaded into GBTX reg 253.
Trigger the transfer of the GBLD registers from the GBTX registers.
-
readGBLD
public void readGBLD()
Triggers the reading of the GBLD
Note: The GBLD I2C address (0x7e) must be preloaded into GBTX reg 253.
Trigger the transfer of the GBLD registers into the GBTX registers.
-
test
public void test()
A register read/write test
Experts only. May have unexpected side-effects and may change without notice.
-
resetPhaseShifter
public void resetPhaseShifter()
Performs a reset of the GBTX 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 GBTX 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 GBTX
When fused with the minimal configuration the GBTX startup completes with many registers not yet programmed. This means that when the remaining registers are set parts of the GBTX 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 GBTX ePort phase training.
The GBTX 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 GBTX does not always choose the same UI for all of the e-links so this method applies GBTXphase%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
-
-