Main Page | Class List | Class Members

hcalDCC::PciDev Class Reference

These class is used to model the devices connected to the PCI buses of a U2 motherboard. More...

#include <pcidev.hh>

List of all members.

Public Member Functions

const int getDevNo () const
const int getBusNo () const
bool isBridge ()
int initBridge (unsigned char busNo, unsigned char maxNumBuses) throw (hcalDCC::Exception)
const char * getDevAlias ()
const char * getDevDescription ()
void setDevAlias (const char *alias="")
void setDevDescription (const char *description="")
int setDeviceType (unsigned char busNo, unsigned char devNo, const char *alias, const char *description) throw (hcalDCC::Exception)
int findMem () throw (hcalDCC::Exception)
int doMemAlloc () throw (hcalDCC::Exception)
const MemorygetFirstMem () const
MemorygetFirstMem ()
MemorygetNextMem (Memory *pMem)
const MemorygetNextMem (const Memory *pMem) const
const MemorygetMem (unsigned int barOffs) const
void addMemReq (Memory *pMem)
 PciDev (Motherboard *pU2, bool readonly=false, bool debug=false)
 ~PciDev ()
int initDev () throw (hcalDCC::Exception)
void setConfVmeBaseAddress (unsigned int address)
unsigned int getConfVmeBaseAddress () const
const unsigned int getVendorID ()
const unsigned int getDeviceID ()
const unsigned int getPciInfo ()
const unsigned int getRevisionNo ()


Detailed Description

These class is used to model the devices connected to the PCI buses of a U2 motherboard.

Author:
Fernando Varela (Boston University)
Revision
1.1

Date
2005/04/29 19:52:42

These class is used to model the devices connected to the PCI buses of a U2 motherboard The class provides methods to initialize the devices. In addition, methods are provided query the PCI devices about their memory needs, i.e. type and size of the memory regions. Finally, the class also implements methods to be able to loop over the memory regions of a given PCI device.


Constructor & Destructor Documentation

hcalDCC::PciDev::PciDev Motherboard pU2,
bool  readonly = false,
bool  debug = false
 

Class constructor providing the motherboard to which this device is connected

hcalDCC::PciDev::~PciDev  ) 
 

Class destructor


Member Function Documentation

void hcalDCC::PciDev::addMemReq Memory pMem  ) 
 

Adds a new memory request to the device's internal list This function is typically called from finMem in order to populate the internal list of memory requests.

Parameters:
pMem is a pointer to the memory region as a CMemory*

int hcalDCC::PciDev::doMemAlloc  )  throw (hcalDCC::Exception)
 

This function loops over the different PCI memory requests defined in the internal list CMemory *m_memList, and it does its allocation i.e. set the BAR Offset, Offset w.r.t. to the VSI base address, etc. This function must be called after findMem().

Returns:
STATUS OK or ERROR depending upon the execution of the procedure

int hcalDCC::PciDev::findMem  )  throw (hcalDCC::Exception)
 

Determines the amount of sizes and types of the PCI memory regions used by the device and sets the internal list of memory request to be then allocated allocated by doMemAlloc().

Returns:
STATUS OK or ERROR depending upon the execution of the procedure

const int hcalDCC::PciDev::getBusNo  )  const [inline]
 

Gets the PCI bus number of the current device

Returns:
PCI bus number as int

unsigned int hcalDCC::PciDev::getConfVmeBaseAddress  )  const [inline]
 

Gets the VME addresss of the PCI configuration region

Returns:
VME base address of the PCI configuration region of the device as a unsigned int

const char* hcalDCC::PciDev::getDevAlias  )  [inline]
 

Returns an alias for logical position of device. Supported aliases (alias - device #):

PCIbus3: "br3" - 0, "dp3" - 1, "u2" - 2, "bc" - 3, "mlc" - 4

PCIbus2: "br2" - 0, "dp2" - 1, "lbr3" - 2, "lbr4" - 3, "lbr5" - 4

PCIbus1: "dp1" - 1, "lbr0" - 2, "lbr1" - 3, "lbr2" - 4

where: "br" - PCI-PCI bridge, "dp" - logic board PMC site,

"bc" - Buffer Control PMC site, "u2" - UniverseII,

"mlc" - local control FPGA, "lrb" - Link Reciever Board or PC-MIP site

const char* hcalDCC::PciDev::getDevDescription  )  [inline]
 

Returns the device description as defined in logicalAliases.hh

Returns:
The description of the PCI device as a const char*

const unsigned int hcalDCC::PciDev::getDeviceID  ) 
 

Gets the PCI Device ID

Returns:
The PCI device ID

const int hcalDCC::PciDev::getDevNo  )  const [inline]
 

Gets the PCI device number of the current device

Returns:
PCI device number as int

Memory* hcalDCC::PciDev::getFirstMem  )  [inline]
 

Utility functions to loop over the internal CMemory requests

Returns:
A pointer to the first memory requrest of the internal list as a CMemory*.

const Memory* hcalDCC::PciDev::getFirstMem  )  const [inline]
 

Utility functions to loop over the internal CMemory requests

Returns:
A pointer to the first memory requrest of the internal list as a CMemory*.

const Memory * hcalDCC::PciDev::getMem unsigned int  barOffs  )  const
 

Given a Base Address Register (BAR) offset, it allows to find the associated CMemory request object

Parameters:
barOffs is the offset of the BAR we want to find the memory request for defined as a unsigned int
Returns:
CMemory* is a pointer to the CMemory object associated to the BAR specified in the argument.

const Memory * hcalDCC::PciDev::getNextMem const Memory pMem  )  const
 

Utility functions to loop over the internal CMemory requests

Parameters:
pMem is a pointer to the current CMemory object of the internal list of CMemory requests, m_memList
Returns:
pointer to the next memory requrest object of the internal list as a const CMemory*.

Memory * hcalDCC::PciDev::getNextMem Memory pMem  ) 
 

Utility functions to loop over the internal CMemory requests

Parameters:
pMem is a pointer to the current CMemory object of the internal list of CMemory requests, m_memList
Returns:
A pointer to the next memory requrest object of the internal list as a CMemory

const unsigned int hcalDCC::PciDev::getPciInfo  ) 
 

Gets the PCI Id of device (vendor Id + (device Id << 16))

Returns:
PCI Id of device (vendor Id + (device Id << 16))

const unsigned int hcalDCC::PciDev::getRevisionNo  ) 
 

Gets the PCI revision number of the device

Returns:
PCI revision number of the device

const unsigned int hcalDCC::PciDev::getVendorID  ) 
 

Gets the PCI vendor ID

Returns:
The PCI vendor ID

int hcalDCC::PciDev::initBridge unsigned char  busNo,
unsigned char  maxNumBuses
throw (hcalDCC::Exception)
 

This function performs the initialization of a PCI-PCI bridge

Parameters:
busNo is the primary bus number
maxNumBuses is the maximum number of PCI devices in a U2 motherboard.
Returns:
STATUS OK or ERROR depending upon the execution of the procedure.

int hcalDCC::PciDev::initDev  )  throw (hcalDCC::Exception)
 

Performs the initialization of PCI devices. Sets the BARs and enables memory. Works for regular devices and bridges

Returns:
STATUS OK or ERROR depending upon the execution of the procedure

bool hcalDCC::PciDev::isBridge  ) 
 

Returns a flag to signal whether the device we are dealing with is a PCI-PCI bridge (true) or a regular PCI device (false)

Returns:
bool, true means the device is a bridge

void hcalDCC::PciDev::setConfVmeBaseAddress unsigned int  address  )  [inline]
 

Sets the VME addresss of the PCI configuration region of the device

Parameters:
address is the new VME address as a unsigned int

void hcalDCC::PciDev::setDevAlias const char *  alias = ""  )  [inline]
 

Sets an alias to a device given its geographical positon

Parameters:
alias is the new device alias. By default the alias will be empty

void hcalDCC::PciDev::setDevDescription const char *  description = ""  )  [inline]
 

Sets a description to a device given its geographical positon

Parameters:
description is the new device description. By default it will be set to an empty string

int hcalDCC::PciDev::setDeviceType unsigned char  busNo,
unsigned char  devNo,
const char *  alias,
const char *  description
throw (hcalDCC::Exception)
 

Initializes the attributes of the current device which will define its type, e.g. if the device is a bridge

Parameters:
busNo is the PCI bus number to be assigned to the device for geographical positioning
devNo is the PCI device number to be assigned to the device for geographical positioning
alias is the device logical or geographical alias (as defined in logicalAlias.hh)
description is the device description (as defined in logicalAlias.hh)
Returns:
STATUS OK or ERROR depending upon the execution of the procedure.


The documentation for this class was generated from the following files:
Generated on Fri Jul 8 20:52:05 2005 for HCAL Data Concentrator Card by  doxygen 1.3.9.1