Generic hardware access library
|
Browses the contents of a crate and delivers the VME-Modules contained in the crate. More...
#include <VME64xCrate.hh>
Classes | |
struct | MappedItem |
A helper structure which stores information about an occupied region of the address space. More... | |
class | MappedItemSorter |
A functor to sort the list of occupied address regions. More... | |
class | WindowSorter |
A functor to sort the list of mapped Windows. More... | |
Public Member Functions | |
VME64xCrate (VMEBusAdapterInterface &busAdapter, AddressTableContainerInterface &addressTables, ModuleMapperInterface &moduleMapper) throw ( HardwareProblemException, IllegalValueException, UnsupportedException ) | |
VME64xCrate (VMEBusAdapterInterface &busAdapter, AddressTableContainerInterface &addressTableContainer, ModuleMapperInterface &moduleMapper, const StaticVMEConfiguration &staticConfiguration) throw ( HardwareProblemException, IllegalValueException, UnsupportedException ) | |
A constructor for a crate which also contains standard (i.e. | |
VMEDevice * | getVMEDevice (uint32_t slotId) const throw ( IllegalOperationException, IllegalValueException, UnsupportedException, BusAdapterException, NoSuchItemException ) |
Retrieve VMEDevice for a slot. | |
VMESlot * | getVMESlot (uint32_t slotId) const throw ( IllegalValueException ) |
Retrieve the VMESlot pointer for a given slot. | |
void | printAddressMap (std::ostream &out) const |
Print out the Mapping of the crate. | |
Private Member Functions | |
void | configurePlugAndPlay () throw ( IllegalValueException, UnsupportedException ) |
Helper function which contains functionality needed in all constructors. | |
void | populateWithStaticConfiguration (const StaticVMEConfiguration &staticConfiguration) throw ( IllegalValueException ) |
Evaluate a static VMEConfiguration given in the Constructor. | |
void | populateWithPlugAndPlay () throw ( IllegalValueException, UnsupportedException ) |
Find all plug and play modules in the create and fill the corresponding data structures. | |
void | getAllWindows () |
Build a list of all mapped windows of all modules in the crate. | |
void | mapCrate () |
Map the address space for the whole crate. | |
void | mapWindow (VME64xMappedWindow *windowPtr, uint32_t maxAddress, uint32_t baseMin) |
Map a Window in the address space. | |
bool | isOccupied (uint32_t base, uint32_t space, bool bit33) |
Test if an address-region is already occupied. | |
void | makeOccupiedList () |
Initilize the occupied address space with the static vme configuration. | |
void | enablePlugAndPlayModules () throw ( IllegalOperationException ) |
Enable all mapped plug and play modules in the crate. | |
Private Attributes | |
bool | mapped_ |
VMEBusAdapterInterface & | busAdapter_ |
AddressTableContainerInterface & | addressTableContainer_ |
ModuleMapperInterface & | moduleMapper_ |
VMEConfigurationSpaceHandler | vmeConfigSpaceHandler_ |
std::vector< VMESlot * > | slotPtrVector_ |
std::list< struct MappedItem * > | occupiedItemList_ |
std::list< VME64xMappedWindow * > | windowList_ |
std::list< const VME64xMappedWindow * > | notMappedList_ |
Browses the contents of a crate and delivers the VME-Modules contained in the crate.
This class should provide all services which are needed to configure a VME64x crate with the plug and play mechanism. The result of the configuration is a list of VMEModules which can be retrieved by the user.
Definition at line 38 of file VME64xCrate.hh.
HAL::VME64xCrate::VME64xCrate | ( | HAL::VMEBusAdapterInterface & | busAdapter, |
HAL::AddressTableContainerInterface & | addressTableContainer, | ||
HAL::ModuleMapperInterface & | moduleMapper | ||
) | throw ( HardwareProblemException, IllegalValueException, UnsupportedException ) |
Definition at line 6 of file VME64xCrate.cc.
HAL::VME64xCrate::VME64xCrate | ( | HAL::VMEBusAdapterInterface & | busAdapter, |
HAL::AddressTableContainerInterface & | addressTableContainer, | ||
HAL::ModuleMapperInterface & | moduleMapper, | ||
const StaticVMEConfiguration & | staticConfiguration | ||
) | throw ( HardwareProblemException, IllegalValueException, UnsupportedException ) |
A constructor for a crate which also contains standard (i.e.
non "plug-and-play") VME modules.
For every standard VME module a StaticVMEConfiguration has to be provided. Plug and play modules are then mapped around these standard VME modules which typically have the address-space defined by jumpers.
During debugging this constructor can also be used to avoid the automatic configuration of a plug-and-play VME64x module.
Definition at line 30 of file VME64xCrate.cc.
void HAL::VME64xCrate::configurePlugAndPlay | ( | ) | throw ( IllegalValueException, UnsupportedException ) [private] |
Helper function which contains functionality needed in all constructors.
Definition at line 63 of file VME64xCrate.cc.
void HAL::VME64xCrate::enablePlugAndPlayModules | ( | ) | throw ( IllegalOperationException ) [private] |
Enable all mapped plug and play modules in the crate.
Definition at line 292 of file VME64xCrate.cc.
void HAL::VME64xCrate::getAllWindows | ( | ) | [private] |
Build a list of all mapped windows of all modules in the crate.
The resulting list is sorted in ascending order with respect to the size of the region occupied by the window.
Definition at line 161 of file VME64xCrate.cc.
HAL::VMEDevice * HAL::VME64xCrate::getVMEDevice | ( | uint32_t | slotId | ) | const throw ( IllegalOperationException, IllegalValueException, UnsupportedException, BusAdapterException, NoSuchItemException ) |
Retrieve VMEDevice for a slot.
IMPORTANT: the caller of this function becomes owner of the VMEDevice and is responsible for its deletion!
Definition at line 88 of file VME64xCrate.cc.
HAL::VMESlot * HAL::VME64xCrate::getVMESlot | ( | uint32_t | slotId | ) | const throw ( IllegalValueException ) |
Retrieve the VMESlot pointer for a given slot.
The VME64xCrate remains owner of the VMESlot. The VMESlot is deleted when the VME64xCrate is destroyed.
Definition at line 101 of file VME64xCrate.cc.
bool HAL::VME64xCrate::isOccupied | ( | uint32_t | base, |
uint32_t | space, | ||
bool | bit33 | ||
) | [private] |
Test if an address-region is already occupied.
Figure out, if at a the address base there is enough "space" to map a window.
Compare against all occupied windows in the crate.
Definition at line 248 of file VME64xCrate.cc.
void HAL::VME64xCrate::makeOccupiedList | ( | ) | [private] |
Initilize the occupied address space with the static vme configuration.
Find all configured Mapped Windows and build a list of mapped Items which contain the occupied addressSpace.
Definition at line 272 of file VME64xCrate.cc.
void HAL::VME64xCrate::mapCrate | ( | ) | [private] |
Map the address space for the whole crate.
Definition at line 183 of file VME64xCrate.cc.
void HAL::VME64xCrate::mapWindow | ( | HAL::VME64xMappedWindow * | windowPtr, |
uint32_t | maxAddress, | ||
uint32_t | baseMin | ||
) | [private] |
Map a Window in the address space.
The algorithm tries to map a window stating from the highest possible address the module can use. It assumes lazy address decoding by the VME module.
maxAddress | is the highest address the module can possibly address (for A32 0 is used, for A24 0x1000000, for A16 0x10000). |
baseMin | is the lowest possible baseAddress ( usually the lowest 64kB are reserved for A16 and the lowest 16MB (without the A16 window) for A24). |
Definition at line 214 of file VME64xCrate.cc.
void HAL::VME64xCrate::populateWithPlugAndPlay | ( | ) | throw ( IllegalValueException, UnsupportedException ) [private] |
Find all plug and play modules in the create and fill the corresponding data structures.
After this routine has run there is a VMESlot object for each possilbe slot in the crate.
Definition at line 144 of file VME64xCrate.cc.
void HAL::VME64xCrate::populateWithStaticConfiguration | ( | const StaticVMEConfiguration & | staticConfiguration | ) | throw ( IllegalValueException ) [private] |
Evaluate a static VMEConfiguration given in the Constructor.
This routine is necessary in order to allow the mapping of the crate in case there are plug-and-play VME64x and VME modules coexisting in the crate.
Definition at line 115 of file VME64xCrate.cc.
void HAL::VME64xCrate::printAddressMap | ( | std::ostream & | out | ) | const |
Print out the Mapping of the crate.
Definition at line 309 of file VME64xCrate.cc.
Definition at line 218 of file VME64xCrate.hh.
Definition at line 217 of file VME64xCrate.hh.
bool HAL::VME64xCrate::mapped_ [private] |
Definition at line 216 of file VME64xCrate.hh.
Definition at line 219 of file VME64xCrate.hh.
std::list< const VME64xMappedWindow * > HAL::VME64xCrate::notMappedList_ [private] |
Definition at line 224 of file VME64xCrate.hh.
std::list< struct MappedItem * > HAL::VME64xCrate::occupiedItemList_ [private] |
Definition at line 222 of file VME64xCrate.hh.
std::vector< VMESlot* > HAL::VME64xCrate::slotPtrVector_ [private] |
Definition at line 221 of file VME64xCrate.hh.
Definition at line 220 of file VME64xCrate.hh.
std::list< VME64xMappedWindow * > HAL::VME64xCrate::windowList_ [private] |
Definition at line 223 of file VME64xCrate.hh.