pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib Namespace Reference

This version of the fast control code interfaces with the CMS Fast control library which can be controlled over MMap/UIO. More...

Namespaces

namespace  algorithm
 housing of higher-level methods for repeatable tasks
 
namespace  logging
 hold logging infrastructure in namespace
 
namespace  utility
 Dumping ground for various functions that are used in many places.
 
namespace  version
 pflib Version file copying parameters in from the CMake build configuration
 

Classes

class  AD5593R
 Partial clone from python code, with just needed functionalities for testing for now. More...
 
class  Backend
 Abstract interface for various backend manipulations. More...
 
class  Bias
 The HGC ROC has 4 MAX5825 chips doing the DAC for the bias voltages. More...
 
class  Capture_zcu
 
class  Compiler
 The object that does the compiling. More...
 
class  DAQ
 Interface with DAQ via a WishboneInterface. More...
 
class  EcalModule
 Class holding a set of ROCs and ECONs representing a HexaModule. More...
 
class  EcalMotherboard
 
class  EcalSMMTargetBW
 
class  EcalSMMTargetZCU
 
class  ECON
 
class  ECOND_Formatter
 
class  Elinks
 Interface for configuring the elinks. More...
 
class  Exception
 PFlib. More...
 
class  FastControl
 Representation of FastControl controller. More...
 
class  FastControlCMS_MMap
 
class  GPIO
 Representation of GPIO controller. More...
 
class  GPIO_HcalHGCROCZCU
 
class  HcalBackplane
 representing an HcalBackplane More...
 
class  HcalBackplaneBW
 
class  HcalBackplaneZCU
 
class  HcalFiberless
 
class  I2C
 Base class which encapsulates the I2C interface, represents a single bus. More...
 
class  I2C_Linux
 
class  lpGBT
 Class which provides an interface with an lpGBT ASIC as mounted on an LDMX mezzanine. More...
 
class  lpGBT_ConfigTransport
 
class  lpGBT_ConfigTransport_I2C
 
struct  Mapping
 
class  MAX5825
 Class representing communication with the Digital-Analog Converter on the HGC ROC. More...
 
class  OptoLink
 Represents an interface to the optical links (GTX, GTH, GTY) and the upper levels of the encoder/decoder blocks. More...
 
class  Parameters
 Class encapsulating parameters for generically holding configuration parameters. More...
 
class  Periodic
 
class  power_ctl_mezz
 
class  ROC
 
class  Target
 encapulating a given setup's access rules More...
 
class  UIO
 

Functions

TargetmakeTargetEcalSMMBittware (int ilink, const char *dev)
 
TargetmakeTargetHcalBackplaneBittware (int ilink, uint8_t board_mask, const char *dev)
 
std::string upper_cp (const std::string &str)
 Get a copy of the input string with all caps.
 
std::size_t msb (uint64_t v)
 Calculate the Most Significant Bit of the input unsigned integer.
 
uint32_t getParam (const std::vector< uint8_t > &data, size_t shift, uint32_t mask)
 
std::vector< uint8_t > newParam (std::vector< uint8_t > prev_value, uint16_t reg_addr, int nbytes, uint32_t mask, int shift, uint32_t value)
 
FastControlmake_FastControlCMS_MMap ()
 
GPIOmake_GPIO_HcalHGCROCZCU ()
 
static uint32_t rotate_right (uint32_t value, int shift)
 
std::any extract_scalar (const YAML::Node &node)
 no easy way to do it, so we just try the three that we care about.
 
std::any extract_sequence (const YAML::Node &node)
 
void extract (std::filesystem::path config_dir, const YAML::Node &yaml_config, Parameters &deduced_config, bool overlay)
 
TargetmakeTargetFiberless ()
 
TargetmakeTargetEcalSMMZCU (int ilink)
 
Elinksget_Elinks_zcu ()
 
DAQget_DAQ_zcu ()
 
TargetmakeTargetHcalBackplaneZCU (int ilink, uint8_t board_mask)
 

Variables

static constexpr int ADDR_ECAL_SMM_DAQ = 0x78 | 0x04
 
static constexpr int ADDR_ECAL_SMM_TRIG = 0x78
 
static constexpr int I2C_BUS_M0 = 1
 
static constexpr int ADDR_HCAL_BACKPLANE_DAQ = 0x78 | 0x04
 
static constexpr int ADDR_HCAL_BACKPLANE_TRIG = 0x78
 
static constexpr int I2C_BUS_ECONS = 0
 
static constexpr int I2C_BUS_HGCROCS = 1
 
static constexpr int I2C_BUS_BIAS = 1
 
static constexpr int I2C_BUS_BOARD = 0
 
static constexpr int ADDR_MUX_BIAS = 0x70
 
static constexpr int ADDR_MUX_BOARD = 0x71
 
static const int CTL_OCCUPANCY_REG = 4
 
static const uint32_t CTL_OCCUPANCY_MASK = 0x3F
 
static const int CTL_OCCUPANCY_CURRENT_SHIFT = 8
 
static const int CTL_OCCUPANCY_MAXIMUM_SHIFT = 0
 
static const int CTL_CONTROL_REG = 1
 
static const uint32_t CTL_RESET = 0x20000000
 
static const uint32_t CTL_LINK_COUNT_MASK = 0xFF00
 
static const int CTL_LINK_COUNT_SHIFT = 8
 
static const int CTL_FPGAID_REG = 3
 
static const int CTL_FPGAID_MASK = 0xFF
 
static const uint32_t CTL_LINK_ENABLE = 0x0001
 
static const uint32_t CTL_LINK_ZS_ENABLE = 0x0002
 
static const uint32_t CTL_LINK_ZS_FULLSUPPRESS = 0x0004
 
static constexpr int I2C_ECON_D = 0x64
 
static constexpr int I2C_ECON_T = 0x24
 
static constexpr int I2C_ROCS [] = {0x08, 0x18, 0x28, 0x48, 0x58, 0x68}
 
static const uint64_t ADDR_RUNBIT = 0x03C5
 
static const uint32_t MASK_RUNBIT = 1
 
static const int SHIFT_RUNBIT = 23
 
static const int NBYTES_RUNBIT = 3
 
static const uint64_t ADDR_PUSMSTATE = 0x3DF
 
static const uint32_t MASK_PUSMSTATE = 15
 
static const int SHIFT_PUSMSTATE = 0
 
static const int NBYTES_PUSMSTATE = 4
 
static const uint64_t ADDR_FCMDSTATUS = 0x03AB
 
static const int NBYTES_FCMDSTATUS = 1
 
static const uint64_t ADDR_FCMD = 0x03A7
 
static const int NBYTES_FCMD = 1
 
static const int SHIFT_FCMDEDGE = 0
 
static const uint32_t MASK_FCMDEDGE = 1
 
static const int SHIFT_FCMDINVERT = 3
 
static const uint32_t MASK_FCMDINVERT = 1
 
static const uint32_t ALIGN_PATTERN = 0xACCCCCCCu
 
static const int REG_CONTROL1 = 1
 
static const uint32_t CTL_COUNTER_CLEAR = 0x00000001u
 
static const int REG_CONTROL2 = 2
 
static const uint32_t CTL_TX_PHASE_MASK = 0x0000000Fu
 
static const int CTL_TX_PHASE_SHIFT = 0
 
static const uint32_t CTL_TX_DRIVE_RESET = 0x00000040u
 
static const uint32_t CTL_MULTISAMPLE_ENABLE = 0x00080000u
 
static const uint32_t CTL_MULTISAMPLE_MASK = 0x00070000u
 
static const int CTL_MULTISAMPLE_SHIFT = 16
 
static const int REG_SINGLE_ERROR_COUNTER = 4
 
static const int REG_DOUBLE_ERROR_COUNTER = 5
 
static const int REG_CMD_COUNTER_BASE = 8
 
static const int CMD_COUNT = 8
 
static const size_t ADDR_CTL_REG = 0
 
static const size_t ADDR_REQUEST = 1
 
static const uint32_t REQ_CLEAR_COUNTERS = 0x2
 
static const uint32_t CTL_ENABLE_ORBITSYNC = 0x0004
 
static const uint32_t CTL_ENABLE_L1AS = 0x0008
 
static const char * myname = "PFLIB_GPIO_HCALROCZCU"
 
static constexpr uint16_t REG_PIODIRH = 0x053
 Register constants here are all correct for V1 and V2 lpGBTs.
 
static constexpr uint16_t REG_PIOPULLENAH = 0x057
 
static constexpr uint16_t REG_PIOUPDOWNH = 0x059
 
static constexpr uint16_t REG_PIODRIVEH = 0x05b
 
static constexpr uint16_t REG_POWERUP2 = 0x0fb
 
static constexpr uint16_t REG_PIOOUTH = 0x055
 
static constexpr uint16_t REG_PIOOUTL = 0x056
 
static constexpr uint16_t REG_PIOINH = 0x1AF
 
static constexpr uint16_t REG_PIOINL = 0x1B0
 
static constexpr uint16_t REG_VREFCNTR = 0x01c
 
static constexpr uint16_t REG_DAC_CONFIG_H = 0x06a
 
static constexpr uint16_t REG_CURDAC_VALUE = 0x06c
 
static constexpr uint16_t REG_CURDAC_CHN = 0x06d
 
static constexpr uint16_t REG_ADC_SELECT = 0x121
 
static constexpr uint16_t REG_ADCMON = 0x122
 
static constexpr uint16_t REG_ADC_CONFIG = 0x123
 
static constexpr uint16_t REG_ADC_STATUS_H = 0x1ca
 
static constexpr uint16_t REG_ADC_STATUS_L = 0x1cb
 
static constexpr uint16_t REG_EPTXDATARATE = 0x0a8
 
static constexpr uint16_t REG_EPTXCONTROL = 0x0a9
 
static constexpr uint16_t REG_EPTX10ENABLE = 0x0aa
 
static constexpr uint16_t REG_EPTXECCHNCNTR = 0x0ac
 
static constexpr uint16_t REG_EPTX00ChnCntr = 0x0ae
 
static constexpr uint16_t REG_EPTX01_00ChnCntr = 0x0be
 
static constexpr uint16_t REG_EPRX0CONTROL = 0x0c8
 
static constexpr uint16_t REG_EPRXTRAIN10 = 0x115
 
static constexpr uint16_t REG_EPRX00CHNCNTR = 0x0d0
 
static constexpr uint16_t REG_ECLK_BASE = 0x06e
 
static constexpr uint16_t REG_POWERUP_STATUS = 0x1d9
 
static constexpr uint16_t REG_I2CM0CONFIG = 0x100
 
static constexpr uint16_t REG_I2CM0ADDRESS = 0x101
 
static constexpr uint16_t REG_I2CM0DATA0 = 0x102
 
static constexpr uint16_t REG_I2CM0CMD = 0x106
 
static constexpr uint16_t REG_I2CM0STATUS = 0x171
 
static constexpr uint16_t REG_I2CM0READBYTE = 0x173
 
static constexpr uint16_t REG_I2CM0READ0 = 0x174
 
static constexpr uint16_t REG_I2CM0READ15 = 0x183
 
static constexpr uint16_t REG_I2C_WSTRIDE = 7
 
static constexpr uint16_t REG_I2C_RSTRIDE = 21
 
static constexpr uint16_t REG_FUSECONTROL = 0x119
 
static constexpr uint16_t REG_FUSEADDRH = 0x11E
 
static constexpr uint16_t REG_FUSEADDRL = 0x11F
 
static constexpr uint16_t REG_FUSESTATUS = 0x1B1
 
static constexpr uint16_t REG_FUSEREADA = 0x1B2
 
static constexpr uint8_t CMD_I2C_WRITE_CR = 0
 
static constexpr uint8_t CMD_I2C_1BYTE_WRITE = 2
 
static constexpr uint8_t CMD_I2C_1BYTE_READ = 3
 
static constexpr uint8_t CMD_I2C_W_MULTI_4BYTE0 = 8
 
static constexpr uint8_t CMD_I2C_W_MULTI_4BYTE1 = 9
 
static constexpr uint8_t CMD_I2C_W_MULTI_4BYTE2 = 10
 
static constexpr uint8_t CMD_I2C_W_MULTI_4BYTE3 = 11
 
static constexpr uint8_t CMD_I2C_WRITE_MULTI = 0xC
 
static constexpr uint8_t CMD_I2C_READ_MULTI = 0xD
 
static const int TOP_PAGE = 45
 
static const int MASK_RUN_MODE = 0x3
 
static const int SUBSYSTEM_ID_HCAL_DAQ = 0x07
 
static constexpr int I2C_BUS_M0 = 1
 
static const uint32_t MASK_CAPTURE_WIDTH = 0x3F000000
 
static const uint32_t MASK_CAPTURE_DELAY = 0x00FF0000
 
static const uint32_t MASK_BITSLIP = 0x00003E00
 
static const uint32_t MASK_PHASE = 0x000001FF
 
static const uint32_t MASK_RESET_BUFFER = 0x00010000
 
static const uint32_t MASK_ADVANCE_FIFO = 0x00020000
 
static const uint32_t MASK_SOFTWARE_L1A = 0x00040000
 
static const uint32_t MASK_OCCUPANCY = 0x000000FF
 
static const uint32_t MASK_BUFFER_FULL = 0x00000100
 
static const uint32_t MASK_BUFFER_EMPTY = 0x00000200
 
static const size_t ADDR_TOP_CTL = 0x0
 
static const size_t ADDR_LINK_STATUS_BASE = 0x26
 
static const size_t ADDR_OFFSET_BUFSTATUS = 1
 
static std::unique_ptr< Capture_zcuthe_capture_
 
static constexpr int I2C_BUS_ECONS = 0
 
static constexpr int I2C_BUS_HGCROCS = 1
 
static constexpr int I2C_BUS_BIAS = 1
 
static constexpr int I2C_BUS_BOARD = 0
 
static constexpr int ADDR_MUX_BIAS = 0x70
 
static constexpr int ADDR_MUX_BOARD = 0x71
 
std::map< std::string, Mappinggl_mappings
 SHOULD REALLY BE PROTECTED BY MUTEX.
 

Detailed Description

This version of the fast control code interfaces with the CMS Fast control library which can be controlled over MMap/UIO.

This class exists to enable reliable, safe operation of UIO due to issues observed with very-closely spaced writes causing crashes.

Function Documentation

◆ msb()

std::size_t pflib::msb ( uint64_t v)

Calculate the Most Significant Bit of the input unsigned integer.

This is not safe and could be very slow if the value input is malformed (i.e. not a safely constructed unsigned integer).