Class 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.

    • Field Detail

      • 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.
      • reset

        public abstract void reset()

        Resets the GBT

        Specified by:
        reset in class GbtGrandParent
      • 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​(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 class GbtGrandParent
        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 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.
      • 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 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 class GbtGrandParent
        Returns:
        Array of phases