#include <motherboard.hh>
Public Member Functions | |
unsigned char | getSlotNo () const |
unsigned int | getVraiAddress () const |
unsigned int | getVsiBaseAddress (const char *vsiName) |
unsigned int | getU2PciConfBaseAddress () |
Motherboard (VMEBusAdapterInterface &busAdapter, unsigned char slotNumber, Logger logger, unsigned long baseAddress=0, bool readonly=false, int debug=0) throw (hcalDCC::Exception) | |
void | setVraiAddress (unsigned int newAddress) |
int | init () throw (hcalDCC::Exception) |
int | u2SetUpVrai () |
int | u2SetUpVsi (const char *sVsiName) |
U2image * | getImage (const char *imageType) const |
void | updateVmeBase (const U2image *vsi) |
void | updatePciBase (const U2image *vsi) |
int | pciMemAlloc () |
int | initPciDev () |
const char * | getDevAlias (unsigned char busNo, unsigned char devNo) |
const char * | getDevDescription (unsigned char busNo, unsigned char devNo) |
Logger | getLogger () const |
void | setLogger (Logger logger) |
~Motherboard () | |
bool | isReadOnly () |
Static Public Attributes | |
const unsigned char | maxNumOfDev = 14 |
const unsigned char | maxNumOfBuses = 3 |
const unsigned char | maxNumOfDevPerBus = 5 |
const unsigned char | u2ConnectedBusNum = 0 |
const unsigned char | u2ConnectedDevNum = 0 |
const unsigned int | u2ConnectedPciId = 0xAC21104C |
const char * | devAlias [maxNumOfDev] |
const char * | devDescription [maxNumOfDev] |
const unsigned char | bNo [maxNumOfDev] = {0,0,0,0,0, 1,1,1,1,1, 2,2,2,2} |
const unsigned char | dNo [maxNumOfDev] = {0,1,2,3,4, 0,1,2,3,4, 1,2,3,4} |
The class Motherboard is used to instanciate the different U2 motherboards found in a crate. This class provides methods for the low level access to settings and transfers with the Tundra Universe II chip as VME-PCI bridge. Each Motherboard object has a VME Register Access Image (VRAI) and VME Slave Images (VSI) to access the PCI Configuration, Memory, Fast Memory and IO spaces. There is one of these images per U2 motherboard. The size of the VRAI, which is used for the configuration of the U2 chip, is fixed 4Kbytes (0x1000). The size of the ocnfiguration VSI is also fixed taking into account that there are 2 PCI buses and the configuration of each bus requires 64 kbytes, thus the configuration VSI is 192 kbytes big. The sizes of the memory, fast memory and IO VSI is determined by scanning the PCI buses and querying the attached devices for memory needs. This is done by the function CUniverse::pciScanBuses.
|
Class constructor |
|
class destructor |
|
Given a pair bus and device numbers, this function returns the device alias as defined in the file logicalAliases.hh
|
|
Given a pair bus and device numbers, this function returns the device description as defined in the file logicalAliases.hh
|
|
This method returns a pointer to the requested U2 image. Images supported: "vrai", "conf", "mem", "fmem" and "io" which are VRAI, PCI configuration, PCI memory, PCI *fast* memory and PCI I/O respectively.
|
|
Get access to an appropriate logger |
|
Returns the slot number in the VME crate for the current motherboard
|
|
Wrapper function to get the U2 PCI configuration base address |
|
Returns the VRAI VME base address
|
|
Returns the VSI base address from the VSI name |
|
This method allows initializing all PCI devices connected to the tree PCI buses of the current motherboard. In order to achive this, the method performs several steps:
|
|
This method performs the initialization of all PCI devices of the current U2 motherboard. Essetially, it loops over the devices and calls the method PciDev::initDev() for each of them.
|
|
Checks if we are dealing with a read-only motherboard
|
|
This utility function is called by initU2 in order to allocate the memory requested by the PCI devices for each of the types mem, fmem, and io. This function loops over the different PCI devices in the current motherboard and for each of the devices, loops over the memory requests and calls the function PciDev::doMemAlloc() for each of these devices.
|
|
Change the logger for this motherboard |
|
Utility method to set the VME VRAI base address of a motherboard. Note that the value is not written to the hardware but only in the code
|
|
This method set ups the U2 VRAI at the level of software, i.e. sets the data members of the U2image for the VRAI, but also writes the corresponding parameters to the U2 chip using HAL
|
|
This method set ups the U2 VSI specified by the char* sVsiName: "conf", "mem", "fmem" or "io". The method initializes the U2image data members for the VSIs. The values are also written to the corresponding parameters to the U2 chip using HAL
|
|
This utility function is called by u2SetUpVsi in order to increase the PCI base address counter. This parameter will then be used as PCI base addresss of the next VSI.
|
|
This utility function is called by u2SetUpVsi in order to increase the VME base address counter. This parameter will then be used as VME base addresss of the next VSI.
|
|
Array of PCI bus numbers |
|
Initial value: {DA00, DA01, DA02, DA03, DA04, DA10, DA11, DA12, DA13, DA14, DA21, DA22, DA23, DA24} |
|
Initial value: {DD00, DD01, DD02, DD03, DD04, DD10, DD11, DD12, DD13, DD14, DD21, DD22, DD23, DD24} |
|
Array of PCI device numbers |
|
Maximum number of PCI buses per U2 motherboard |
|
Maximum number of PCI device per U2 motherboard |
|
Maximum number of PCI device per PCI bus |
|
U2 primary PCI bus number (Texas intrument bridge, br3, is connected to this bus) |
|
Device number of a device permanently connected to the PCI primary bus (Texas Inst. "PCI2301" PCI-to-PCI bridge) |
|
PCI Id of a device permanently connected to the PCI primary bus (Texas Inst. "PCI2301" PCI-to-PCI bridge) |