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

    • Field Detail

      • gbldCB

        javax.swing.JCheckBox gbldCB
    • 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 class GbtGrandParent
        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 class GbtGrandParent
        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 class GbtGrandParent
        Parameters:
        key - The register bit-field key name
        val - 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 class GbtGrandParent
        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 class GbtGrandParent
        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 class GbtGrandParent
      • 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 class GbtGrandParent
      • 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 class GbtGrandParent
      • 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 class GbtGrandParent
      • 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 class GbtGrandParent
        Returns:
        Array of phases