#include <DCC.hh>
Public Member Functions | |
DCC (bool readonly=false) | |
~DCC () | |
bool | isReadOnly () |
void | setupHAL (const std::string &lrbAddrTableFile, const std::string <bAddrTableFile, const std::string &log12AddrTableFile, const std::string &log123ConfAddrTableFile, const std::string &logicBoardAddrTableFile) |
bool | initialize (VMEBusAdapterInterface *intf, int slot, Logger &parentLogger) throw (std::exception) |
bool | prepareForRun (int ttcAddr, int sourceId, int monitorEventScale, bool enableSLINK) throw (hcalDCC::Exception) |
bool | DCC::enableSLINK () |
int | readoutEvent (int maxEventBytes, void *buffer) throw (hcalDCC::Exception) |
int | getNextEventSize () throw (hcalDCC::Exception) |
void | setSpigotInUse (int nspigot, bool used) |
void | getFirmwareVersions (int &log1, int &log2, int &log3, int &fpga) throw (hcalDCC::Exception) |
void | getLRBFirmwareVersions (int &lrb0v, int &lrb1v, int &lrb2v, int &lrb3v, int &lrb4v, int &lrb5v) throw (hcalDCC::Exception) |
void | getLTBFirmwareVersions (int <b0v, int <b1v, int <b2v, int <b3v, int <b4v, int <b5v) throw (hcalDCC::Exception) |
int | getSlot () const |
void | updateLRBData () throw (hcalDCC::Exception) |
bool | getLRBMonitoring (int nLRB, int *cerr, int *uerr, int *badid, unsigned long *wc, unsigned long *blkc, unsigned long &full_over_mask) |
unsigned long | readItem (const std::string &name) throw (hcalDCC::Exception) |
int | showStatus () |
int | getHTRHeaders (std::vector< unsigned long > &headers) |
Logger | getLogger () |
VMEAddressTable * | getMainAddressMap () |
int | checkRAMPages (int firstPage=0, int lastPage=0x80) throw (hcalDCC::Exception) |
void | resetLTB (int nLTB) throw (hcalDCC::Exception) |
void | writeToLTB (int nLTB, unsigned long header, std::vector< unsigned long > data, unsigned long trailer) throw (hcalDCC::Exception) |
void | readFromLRB (int nLTB, int channel, int &header, std::vector< int > &data, int &trailer) throw (hcalDCC::Exception) |
int | readFromLRB (int nLTB, int channel, unsigned long *buff) throw (hcalDCC::Exception) |
void | readAllLRB () throw (hcalDCC::Exception) |
void | setModeAllLRB (bool normal) |
hcalDCC::Motherboard * | getMotherboard () |
void | sendFakeHTREvent (int nLTB, int eventNo) throw (hcalDCC::Exception) |
void | decodeLRBData (unsigned long *buffer, int size, lrbData &lrbDataStructure) |
int | getMask (int numberOfBits) |
void | disable () throw (hcalDCC::Exception) |
void | printLRBData (lrbData *lrbDataStructure) |
hcal::VMEDeviceBundle * | getMasterDevice () |
The HCAL Data Concentrator Card (DCC) is responsible for buffering the data which is transmitted to the central DAQ and for providing "spy" data over VME to the HCAL system. This class handles the direct VME communication with a single DCC, and can be used separately from the HCAL DAQ by compiling it with "STANDALONE" defined.
Initial configuration of the DCC is performed on the fly. The code scans the three PCI local buses on the DCC thru the Universe II VME-PCI bridge. Once a PCI device is found on a given location of a bus, it is requested to state its memory needs in terms of memory regions (Configuration, Memory, Fast Memory and IO) and their size. The DCC code handles the PCI initialization of the devices found as well as the mapping of these devices on the A32 VME Address Space. As result of this initial configuration a HAL VME address table is created. This is the so-called "master DCC address table" which is fixed as long as the physical configuration of the DCC does not change. This address table gives the base addresses of the link receiver boards (LRBs) and other parts of the DCC (such as the log1/log2 interfaces and the main logic board). The LRBs, log1/log2, and the logic board each have their own address table which gives the location of the specified setting registers within each part. Relative address maps for each of the PCI devices are then used to enable access to the different PCI memory regions.
New in revision 1.2:
|
constructor for an uninitialized DCC |
|
Default destructor |
|
Checks the DCC RAM memory
|
|
Enables the SLINK
|
|
Decodes a buffer of integers into an event lrbData structure
|
|
clear configuration register of the logic board |
|
Gets the FW revisions of log1, log2, log3 and the FPGA
|
|
Diagnostic function. Gets the HTR headers from the DCC
|
|
gets the logger
|
|
Gets the FW revisions of the LRBs in use
|
|
get the LRB monitoring data (return false if there is no LRB there)
|
|
Gets the FW revisions of the LTBs in use
|
|
returns a pointer to the main address table
|
|
Calculates the mask for a particular number of bits
|
|
Gets a pointer to the HAL master VME device
|
|
Gets a pointer to the Motherboard
|
|
Reads the size (in bytes) of the next event in the spy buffer |
|
get the slot
|
|
Initializes the DCC on the given bus adapter interface, slot number and logger, using the maps from setupHAL()
|
|
Checks if we are dealing with a read-only DCC
|
|
Prepare the DCC for running by setting up important parameters inside the DCC including the addresses and enabling the appropriate LRB and LTB channels (see setSpigotInUse())
|
|
Prints out a LRB data structure
|
|
Finds LRBs connected to either HTR or LTB channels |
|
Read data from LRB. Gets a pointer to the LRB data (void*)
|
|
Read data from LRB
|
|
perform a direct read on an item in the DCC motherboard
|
|
Reads out the event into the given buffer
|
|
Resets a given LTB
|
|
Gerenates a fake event HTR thru an LTB
|
|
Set all LRBs to a given operational mode
|
|
Enable/disable a given spigot of the DCC
|
|
Set the address table files to be used for this DCC.
|
|
Diagnostic function. Shows the DCC status
|
|
refresh the LRB data (consistent view) |
|
Write data to LTB
|