Class Asic

  • All Implemented Interfaces:
    Io
    Direct Known Subclasses:
    Claro, FastIc8

    public abstract class Asic
    extends java.lang.Object
    implements Io

    This class encapsulates the interactions with a front-end ASIC (CLARO, FastIC, FastRICH)

    Unmarshalls register descriptors into statically accessible members of this class.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int asic
      The ID of this ASIC
      (package private) Csr csr
      The configuration and status register.
      (package private) int ec
      The EC ID of this ASIC
      (package private) int feb
      The FEB ID of this ASIC
      (package private) I2cIo i2cIo
      The I2C IO interface.
      (package private) java.lang.String id
      The unique identifier for this ASIC
      (package private) Sc sca
      The SCA interface
    • Constructor Summary

      Constructors 
      Constructor Description
      Asic​(AsicType asic)
      Constructor called by the unmarshaller via AsicAdapter
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.lang.String get​(java.lang.String regName)
      Reads a register bit-field
      (package private) Csr getCsr()
      Gets the control and status register.
      (package private) java.lang.String getId()
      Gets the identifier.
      (package private) void init​(Sc sca, I2cIo i2cIo)
      Completes initialisation of this instance.
      (package private) void load()
      Writes a byte array to the hardware.
      (package private) javax.swing.JPanel makePanel()
      Convenience method that makes a GUI panel.
      (package private) void put​(java.lang.String regName, java.lang.String regValue)
      Writes a register bit-field.
      (package private) <T> void set​(java.lang.String key, T val)
      Sets an ASIC register mirror bit-field.
      (package private) abstract void setDefaults()  
      (package private) byte[] toByteArray()
      Returns the current register mirror settings as a byte array.
      (package private) void verify()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface cbsw.Io

        get, put
    • Field Detail

      • sca

        Sc sca

        The SCA interface

      • id

        java.lang.String id

        The unique identifier for this ASIC

      • ec

        int ec

        The EC ID of this ASIC

      • feb

        int feb

        The FEB ID of this ASIC

      • asic

        int asic

        The ID of this ASIC

      • csr

        Csr csr

        The configuration and status register.

      • i2cIo

        I2cIo i2cIo

        The I2C IO interface.

    • Constructor Detail

      • Asic

        public Asic​(AsicType asic)

        Constructor called by the unmarshaller via AsicAdapter

        Parameters:
        asic - Unmarshalled data to construct this Asic type.
    • Method Detail

      • init

        void init​(Sc sca,
                  I2cIo i2cIo)

        Completes initialisation of this instance.

        Call after unmarshalling to complete initialisation.

        Parameters:
        sca - The SCA interface.
        i2cIo - The interface to use for I2C transactions.
      • getId

        java.lang.String getId()

        Gets the identifier.

        Returns:
        The unique indentifier String
      • getCsr

        Csr getCsr()

        Gets the control and status register.

        Returns:
        The Csr
      • set

        <T> void set​(java.lang.String key,
                     T val)

        Sets an ASIC register mirror bit-field.

        The key is treated as a regular expression. All matching registers will be targeted.

        Type Parameters:
        T - The type of the value to set.
        Parameters:
        key - The register bit-field key name.
        val - The value to set.
      • toByteArray

        byte[] toByteArray()

        Returns the current register mirror settings as a byte array.

        Returns:
        The byte array containing the settings.
      • makePanel

        javax.swing.JPanel makePanel()

        Convenience method that makes a GUI panel.

        Returns:
        The panel.
      • put

        void put​(java.lang.String regName,
                 java.lang.String regValue)

        Writes a register bit-field.

        Parameters:
        regName - The register bit-field key name
        regValue - Hex representation of value to write
      • get

        java.lang.String get​(java.lang.String regName)

        Reads a register bit-field

        Parameters:
        regName - The register bit-field key
        Returns:
        Hex encoded String register value
      • load

        void load()

        Writes a byte array to the hardware.

      • verify

        void verify()
      • setDefaults

        abstract void setDefaults()