Generic hardware access library
HAL::GeneralHardwareAddress Class Reference

Specifies the address and access mode for an item. More...

#include <GeneralHardwareAddress.hh>

Inheritance diagram for HAL::GeneralHardwareAddress:
HAL::PCIHardwareAddress HAL::VME64xHardwareAddress HAL::VMEHardwareAddress

List of all members.

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 GeneralHardwareAddressclone () 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.

Detailed Description

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.

See also:
PCIHardwareAddress, PCIHardwareAddress
Author:
Christoph Schwick
Revision:
1.1
Date:
2007/03/05 18:02:09

Definition at line 35 of file GeneralHardwareAddress.hh.


Constructor & Destructor Documentation

HAL::GeneralHardwareAddress::GeneralHardwareAddress ( uint32_t  address,
uint32_t  dataWidth 
)

The Constructor of the general hardware address.

Parameters:
addressin each technology (PCI or VME) is the offset to some baseaddress.

Definition at line 3 of file GeneralHardwareAddress.cc.


Member Function Documentation

This method is needed to make deep copies of AddressTables.

Implemented in HAL::VME64xHardwareAddress, HAL::VMEHardwareAddress, and HAL::PCIHardwareAddress.

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.

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.

Return the data width in bytes.

Definition at line 20 of file GeneralHardwareAddress.cc.

Return the identifier of the addressMap.

Definition at line 28 of file GeneralHardwareAddress.cc.

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.

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.


Member Data Documentation

Definition at line 113 of file GeneralHardwareAddress.hh.

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.

Definition at line 114 of file GeneralHardwareAddress.hh.

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.


The documentation for this class was generated from the following files: