Generic hardware access library
|
Concept: Everything which is related to the VME64x configuration space (NOT the user defined one) is handled by the slot. More...
#include <VMESlot.hh>
Public Member Functions | |
VMESlot (uint32_t slotNumber, VMEConfigurationSpaceHandler *configAdapterPtr, AddressTableContainerInterface &addressTableContainer, ModuleMapperInterface &moduleMapper, bool ignoreChecksumError=false) throw ( IllegalValueException, UnsupportedException ) | |
Constructs the VMEModule if the slot is not empty. | |
VMESlot (StaticVMEItem *staticVME, VMEBusAdapterInterface *busAdapterPtr, AddressTableContainerInterface &addressTableContainer, ModuleMapperInterface &moduleMapper) throw ( IllegalValueException ) | |
A Constructor for a VMESlot with a "standard" ( i.e. | |
virtual | ~VMESlot () |
enum SlotContents | getContents () const |
std::string | getTypeId () const |
std::string | getSerialNumber () const |
Retrieve serial number of the slot. | |
std::list< VME64xFunction * > | getImplementedFunctions () const |
Returns only those functions which are really implemented. | |
VMEDevice * | getVMEDevice () const throw ( IllegalOperationException, IllegalValueException, UnsupportedException, BusAdapterException, NoSuchItemException ) |
Return or create and return the VMEModule in this slot. | |
uint32_t | getSlotId () const |
Retrieve the Id number of the slot. | |
void | stdConfigRead (std::string item, uint32_t *resultPtr, uint32_t offset=0) const throw ( NoSuchItemException, IllegalOperationException, BusAdapterException ) |
Read a standard Configuration Item. | |
void | stdConfigWrite (std::string item, uint32_t data, HalVerifyOption verifyFlag=HAL_NO_VERIFY, uint32_t offset=0) const throw ( NoSuchItemException, IllegalOperationException, BusAdapterException ) |
Write a standard Configuration Item. | |
Private Member Functions | |
void | checkVME64xTable (VMEAddressTable &table) const throw ( IllegalValueException ) |
Check addresstable for consistency against contents of configuration space. | |
Private Attributes | |
uint32_t | slotId_ |
VMEConfigurationSpaceHandler * | configAdapterPtr_ |
VMEBusAdapterInterface * | busAdapterPtr_ |
AddressTableContainerInterface & | addressTableContainer_ |
ModuleMapperInterface & | moduleMapper_ |
enum SlotContents | contents_ |
std::list< VME64xFunction * > | functionPtrs_ |
The list of implemented functions of the module in this slot. | |
std::string | serialNumber_ |
std::string | typeId_ |
std::vector< const VME64xMappedWindow * > | windowVector_ |
There is one entry in this vector for each POSSIBLE window. |
Concept: Everything which is related to the VME64x configuration space (NOT the user defined one) is handled by the slot.
(This is the main "service" of the slot.) This allows to leave the module in the slot to be a normal VMEDevice from the generic part of the HAL. User defined items in the CR/CSR space can be accessed via the VMEDevice by specifiying the items in the address table.
Definition at line 43 of file VMESlot.hh.
HAL::VMESlot::VMESlot | ( | uint32_t | slotNumber, |
HAL::VMEConfigurationSpaceHandler * | configAdapterPtr, | ||
HAL::AddressTableContainerInterface & | addressTableContainer, | ||
HAL::ModuleMapperInterface & | moduleMapper, | ||
bool | ignoreChecksumError = false |
||
) | throw ( IllegalValueException, UnsupportedException ) |
Constructs the VMEModule if the slot is not empty.
The first step of the Constructor is to check if there is a VME64x Module plugged into the slot or not. If so, it's serial number is read which is used to retrieve the AddressTable from the AddressTableContainer. The construction of the VMEDevice must be deferred until the mapping of the baseaddress has been established by the VMECrate. Therefore the VMESlot must contain all functionality to read out the relevant configuration space data which is necessary to establish the baseaddress mapping of the crate.
Definition at line 53 of file VMESlot.cc.
HAL::VMESlot::VMESlot | ( | HAL::StaticVMEItem * | staticVME, |
HAL::VMEBusAdapterInterface * | busAdapterPtr, | ||
HAL::AddressTableContainerInterface & | addressTableContainer, | ||
HAL::ModuleMapperInterface & | moduleMapper | ||
) | throw ( IllegalValueException ) |
A Constructor for a VMESlot with a "standard" ( i.e.
not plug and play ) module plugged into it.
Definition at line 8 of file VMESlot.cc.
HAL::VMESlot::~VMESlot | ( | ) | [virtual] |
Definition at line 143 of file VMESlot.cc.
void HAL::VMESlot::checkVME64xTable | ( | HAL::VMEAddressTable & | table | ) | const throw ( IllegalValueException ) [private] |
Check addresstable for consistency against contents of configuration space.
In addition this function configures the HardwareAddresses of VME64x modules with the address modifier and the data width which will be used to access the module.
Definition at line 232 of file VMESlot.cc.
enum HAL::SlotContents HAL::VMESlot::getContents | ( | ) | const |
Definition at line 150 of file VMESlot.cc.
std::list< HAL::VME64xFunction * > HAL::VMESlot::getImplementedFunctions | ( | ) | const |
Returns only those functions which are really implemented.
This functions leaves the slot "const" and the functions. Only the slot itself should be allowed to change the functions.
Definition at line 221 of file VMESlot.cc.
std::string HAL::VMESlot::getSerialNumber | ( | ) | const |
Retrieve serial number of the slot.
If the slot is empty retyurn "";
Definition at line 158 of file VMESlot.cc.
uint32_t HAL::VMESlot::getSlotId | ( | ) | const |
Retrieve the Id number of the slot.
Definition at line 162 of file VMESlot.cc.
std::string HAL::VMESlot::getTypeId | ( | ) | const |
Definition at line 154 of file VMESlot.cc.
HAL::VMEDevice * HAL::VMESlot::getVMEDevice | ( | ) | const throw ( IllegalOperationException, IllegalValueException, UnsupportedException, BusAdapterException, NoSuchItemException ) |
Return or create and return the VMEModule in this slot.
The caller of the method becomes owner of the VMEDevice and is responsitble for its deletion.
Definition at line 167 of file VMESlot.cc.
void HAL::VMESlot::stdConfigRead | ( | std::string | item, |
uint32_t * | resultPtr, | ||
uint32_t | offset = 0 |
||
) | const throw ( NoSuchItemException, IllegalOperationException, BusAdapterException ) |
Read a standard Configuration Item.
This function allows to read a Standard Configuration Item from the Configuration space. Standard Configuration Items are those which are defined in the VME64x specification. The string to identify these items are defined in the class VMEConfigurationSpaceAddressReader.
THIS METHOD MUST NOT BE USED TO READ USER DEFINED CONFIGURATION SPACE ITEMS!
Definition at line 321 of file VMESlot.cc.
void HAL::VMESlot::stdConfigWrite | ( | std::string | item, |
uint32_t | data, | ||
HalVerifyOption | verifyFlag = HAL_NO_VERIFY , |
||
uint32_t | offset = 0 |
||
) | const throw ( NoSuchItemException, IllegalOperationException, BusAdapterException ) |
Write a standard Configuration Item.
This function allows to write a Standard Configuration Item in the Configuration space. Standard Configuration Items are those which are defined in the VME64x specification. The string to identify these items are defined in the class VMEConfigurationSpaceAddressReader.
Of course this method only works for the writable items in the CSR space.
THIS METHOD MUST NOT BE USED TO WRITE USER DEFINED CONFIGURATION SPACE ITEMS!
Definition at line 339 of file VMESlot.cc.
Definition at line 177 of file VMESlot.hh.
Definition at line 176 of file VMESlot.hh.
Definition at line 175 of file VMESlot.hh.
enum SlotContents HAL::VMESlot::contents_ [private] |
Definition at line 179 of file VMESlot.hh.
std::list< VME64xFunction* > HAL::VMESlot::functionPtrs_ [private] |
The list of implemented functions of the module in this slot.
If there is a standard VME module in the slot (non-VME64x) then there is only the first function implemented.
Definition at line 186 of file VMESlot.hh.
ModuleMapperInterface& HAL::VMESlot::moduleMapper_ [private] |
Definition at line 178 of file VMESlot.hh.
std::string HAL::VMESlot::serialNumber_ [private] |
Definition at line 188 of file VMESlot.hh.
uint32_t HAL::VMESlot::slotId_ [private] |
Definition at line 174 of file VMESlot.hh.
std::string HAL::VMESlot::typeId_ [private] |
Definition at line 189 of file VMESlot.hh.
std::vector< const VME64xMappedWindow* > HAL::VMESlot::windowVector_ [private] |
There is one entry in this vector for each POSSIBLE window.
This means the vector always has the size of 6.
Definition at line 195 of file VMESlot.hh.