Class LpGbtParent

  • All Implemented Interfaces:
    Io
    Direct Known Subclasses:
    LpGbtDepp, LpGbtIcEc

    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.

    • Field Detail

      • icecSelect

        int icecSelect
      • i2cSpeed

        int[] i2cSpeed
      • i2cSclMode

        int[] i2cSclMode
    • 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 class GbtGrandParent
        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:
        set in class GbtGrandParent
        Parameters:
        key - The register bit-field key name
        val - 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:
        readConfigurationFile in class GbtGrandParent
      • showStatus

        public java.lang.String showStatus()

        Updates the GBT status field in the GUI panel

        Specified by:
        showStatus in class GbtGrandParent
        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 class GbtGrandParent
        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:
        configure in class GbtGrandParent
      • 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 class GbtGrandParent
      • 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 class GbtGrandParent
      • 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 class GbtGrandParent
      • 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:
        trainEports in class GbtGrandParent
        Returns:
        Array of phases
      • fuse

        public void fuse​(java.lang.Runnable pulse)
        Description copied from class: GbtGrandParent

        Burn the e-fuses.

        Specified by:
        fuse in class GbtGrandParent
        Parameters:
        pulse - A runnable that generates the fuse pulse signal