bu_cms_history/NewDccSoftware

SiteMap (Historical BU CMS wiki main page)

Interface to the low-level DCC hardware is provided by the hcalDCC::DCC class. Only a small subset of the functions are actually used! This is an attempt to identify those, so that they can efficiently be updated for the new DCC.

See NewDCCSoftwareFunctions for details on what needs to be implemented for the new DCC.

Summary of DCC accesses in hcalDCCMonitoring.cc

This subsystem depends in gory detail on the items in the DCC Xilinx HAL address table. DCC functions referenced:

  readItem()
  getFirmwareVersions()
  getLRBFirmwareVersions()

Summary of DCC accesses in HyperDAQ Expert View

This subsystem is rather complex, and is driven by a CSV file which lists the HAL address table items to be accessed. In principle it can be updated for the new DCC by making a new CSV file.

hcalDCCExpertView.cc calls only getFirmwareVersions() directly. It then accesses the DCC through the DCCItem class.

DCCItem class digs rather deep into the hardware. It will require a noticeable amount of work. It expects to get access to all the PCI devices by calling dcc.getAllDevices() and looping over the result. If this returns only one item for possibly a list of items for the chips on the new DCC it could be compatible, but care is needed!

Summary of DCC accesses in hcalDCCManager

Functions called from hcalDCC::DCC:

  getSourceId()
  testTTS()
  setLogger()
  setupHAL()
  initialize()
  reloadFirmware()
  writeItem( "err_ctrl...")
  getFirmwareVersions()
  setSpigotInUse()
  prepareForRun()
  getLRBFirmwareVersions()
  startRun()

A list of relevant functions in hcalDCCManager.cc and where edits may be needed:

hcalDCCManager::hcalDCCManager ( xdaq::ApplicationStub *as )

This constructor does essentially noting, so should not need editing.

hcalDCCManager::init()

The init() can can be initially unchanged, provided the getFirmwareVersions() and getLRBFirmwareVersions() aren't touched. Eventually need minor changes to support LRB programming, and perhaps get rid of LOG1 and LOG2.

  getParameters()
  connect();

  for( i=0..MAX_DCCS) {
    m_dccsi
.getFirmwareVersions( fw1, .....)
    if( fw1 != m_dccsi
.m_config.firmwareRevLOG1)
       ...
       m_minimalReprogramming = true;
    for( j=0..18)
      m_dccsi
.setSpigotInUse(...)
    prepareForRun()
  }

  if( m_minimalReprogramming)
    XCEPT_RAISE( ...NeedColdException)

  // LRB stuff should go in loop above, as LRBs can now be reprogrammed
  for( i=0..MAX_DCCS) {
    // check LRB version, LOG4CPLUS_WARN() if mis-match
  }

  for( i=0..MAX_DCCS) {
    // associate monitoring
  }
  // more monitoring stuff

hcalDCCManager::coldInit()

Essentially the same as init() but reprograms firmware if needed. Will need work if flash functions change. Will eventually need to support LRBs.

hcalDCCManager::enable()

Just calls startRun() for each DCC. No changes except getFirmwareVersions().

  for( i=0...MAX_DCCS)
    m_dccsi
.startRun();

    // for each flash sector
    if( // version not correct, reprogramming needed
      reprogramSector( m_dccsi
, "SECTOR");

hcalDCCManager::TTSCallback(...)

Ugly thing which supports TTS testing. Calls '''m_dccsi .testTTS()'''. As long as this still works, should be fine.

hcalDCCManager::connect()

Open hardware connection to DCCs. Should work as-is initially provided that:

  m_intf = hcal::BusAdapterManager::getAdapterFor(m_config_bus);

  // initialize, reconfigure, sleep, initialize (WTF?)
  for( i=0..MAX_DCCS) {
    // setup logger
    m_dccsi
.setupHAL(...)
    m_dccsi
.initialize( m_intf, slot, byteSwapFlag, debugFlag);
    m_dccsi
.reloadFirmware()
    sleep(4)
    m_dccsi
.initialize(...)

    // set by hand err_ctrl registers
    m_dccsi
.writeItem( "err_ctrl_....." ...)

  }

hcalDCCManager::getParameters()

Get cfgScript parameters. Generally ok, except messes with HAL address table paths, so will probably need a little tweaking.

hcalDCCManager::getParametersContext

This function must know in detail about the cfgScript parameters, so any change in cfgScript will have to be reflected here!

hcalDCCManager::reprogramSector

Reprograms one flash sector. Must know about firmware names in database. Will likely need some edits.

  prog = dcc.getProgrammer();
  prog->programFlashSector(...);