Generic hardware access library
|
Specifies the address and access mode for an item. More...
#include <GeneralHardwareAddress.hh>
Public Member Functions | |
GeneralHardwareAddress (uint32_t address, uint32_t dataWidth) | |
The Constructor of the general hardware address. | |
virtual | ~GeneralHardwareAddress () |
uint32_t | getAddress () const |
Return the address offset for the HardwareAddress. | |
uint32_t | getComputedAddress (const std::vector< uint32_t > &baseaddresses) const |
This function is given for enhanced efficency/ It is possible to retrieve the MapId and the address separately and then add the baseaddress to the obtained address outside of this class. | |
virtual uint32_t | getAddressModifier () const =0 throw ( IllegalOperationException ) |
Return the address modifier for VME modules. | |
uint32_t | getDataWidth () const |
Return the data width in bytes. | |
enum AddressSpace | getAddressSpace () const |
Return the AddressSpace. | |
uint32_t | getMapId () const |
Return the identifier of the addressMap. | |
bool | isConfigSpace () const |
Test on the address space. | |
bool | isMemorySpace () const |
Test on the address space. | |
virtual bool | isIOSpace () const =0 throw ( IllegalOperationException ) |
Test on the address space. | |
virtual void | print (std::ostream &os=std::cout) const =0 |
The implementation depends on the technology. | |
virtual GeneralHardwareAddress * | clone () const =0 |
This method is needed to make deep copies of AddressTables. | |
Protected Attributes | |
uint32_t | address_ |
uint32_t | dataWidth_ |
uint32_t | addressModifier_ |
uint32_t | mapId_ |
for VME this is the functionId (0...7) and for PCI this is the BAR (0...5). | |
enum AddressSpace | addressSpace_ |
This is configuration space or memory space. |
Specifies the address and access mode for an item.
In order to have technology independent interfaces for the HardwareDevice and the AddressTable the concept of the General Hardware Address is introduced with this class. Common to all general addresses is the value for the address itself (a hex number). On the other hand everything which is related to the access mode is technology dependent and therefore implemented in the derived classes.
Definition at line 35 of file GeneralHardwareAddress.hh.
HAL::GeneralHardwareAddress::GeneralHardwareAddress | ( | uint32_t | address, |
uint32_t | dataWidth | ||
) |
The Constructor of the general hardware address.
address | in each technology (PCI or VME) is the offset to some baseaddress. |
Definition at line 3 of file GeneralHardwareAddress.cc.
HAL::GeneralHardwareAddress::~GeneralHardwareAddress | ( | ) | [virtual] |
Definition at line 9 of file GeneralHardwareAddress.cc.
virtual GeneralHardwareAddress* HAL::GeneralHardwareAddress::clone | ( | ) | const [pure virtual] |
This method is needed to make deep copies of AddressTables.
Implemented in HAL::VME64xHardwareAddress, HAL::VMEHardwareAddress, and HAL::PCIHardwareAddress.
uint32_t HAL::GeneralHardwareAddress::getAddress | ( | ) | const |
Return the address offset for the HardwareAddress.
Definition at line 12 of file GeneralHardwareAddress.cc.
virtual uint32_t HAL::GeneralHardwareAddress::getAddressModifier | ( | ) | const throw ( IllegalOperationException ) [pure virtual] |
Return the address modifier for VME modules.
This function throws an Exception for PCI modules since in PCI there are no address modifiers.
Implemented in HAL::VME64xHardwareAddress, HAL::VMEHardwareAddress, and HAL::PCIHardwareAddress.
enum HAL::AddressSpace HAL::GeneralHardwareAddress::getAddressSpace | ( | ) | const |
Return the AddressSpace.
Definition at line 24 of file GeneralHardwareAddress.cc.
uint32_t HAL::GeneralHardwareAddress::getComputedAddress | ( | const std::vector< uint32_t > & | baseaddresses | ) | const |
This function is given for enhanced efficency/ It is possible to retrieve the MapId and the address separately and then add the baseaddress to the obtained address outside of this class.
But this involves two function calls which increases substentially the overhead of the HAL to a read/write operation.
Definition at line 16 of file GeneralHardwareAddress.cc.
uint32_t HAL::GeneralHardwareAddress::getDataWidth | ( | ) | const |
Return the data width in bytes.
Definition at line 20 of file GeneralHardwareAddress.cc.
uint32_t HAL::GeneralHardwareAddress::getMapId | ( | ) | const |
Return the identifier of the addressMap.
Definition at line 28 of file GeneralHardwareAddress.cc.
bool HAL::GeneralHardwareAddress::isConfigSpace | ( | ) | const |
Test on the address space.
Definition at line 32 of file GeneralHardwareAddress.cc.
virtual bool HAL::GeneralHardwareAddress::isIOSpace | ( | ) | const throw ( IllegalOperationException ) [pure virtual] |
Test on the address space.
For VME Hardware Addresses this function throws an exception since there is no IO-space in VME.
Implemented in HAL::VME64xHardwareAddress, HAL::VMEHardwareAddress, and HAL::PCIHardwareAddress.
bool HAL::GeneralHardwareAddress::isMemorySpace | ( | ) | const |
Test on the address space.
Definition at line 36 of file GeneralHardwareAddress.cc.
virtual void HAL::GeneralHardwareAddress::print | ( | std::ostream & | os = std::cout | ) | const [pure virtual] |
The implementation depends on the technology.
Implemented in HAL::VME64xHardwareAddress, HAL::VMEHardwareAddress, and HAL::PCIHardwareAddress.
uint32_t HAL::GeneralHardwareAddress::address_ [protected] |
Definition at line 113 of file GeneralHardwareAddress.hh.
uint32_t HAL::GeneralHardwareAddress::addressModifier_ [protected] |
Reimplemented in HAL::VME64xHardwareAddress, and HAL::VMEHardwareAddress.
Definition at line 115 of file GeneralHardwareAddress.hh.
enum AddressSpace HAL::GeneralHardwareAddress::addressSpace_ [protected] |
This is configuration space or memory space.
In case of PCI it also can be IO-Space.
Definition at line 126 of file GeneralHardwareAddress.hh.
uint32_t HAL::GeneralHardwareAddress::dataWidth_ [protected] |
Definition at line 114 of file GeneralHardwareAddress.hh.
uint32_t HAL::GeneralHardwareAddress::mapId_ [protected] |
for VME this is the functionId (0...7) and for PCI this is the BAR (0...5).
Definition at line 120 of file GeneralHardwareAddress.hh.