fdhwlib  2.0.25
hw4::BaseRegister Class Reference

#include <baseregister.h>

Inheritance diagram for hw4::BaseRegister:
Pbus hw4::BaseFIFO hw4::BaseMemory hw4::BaseRegister64 hw4::FltAutoIncRAM hw4::FltCommand hw4::FltControl hw4::FltHitrate hw4::FltHitrateControl hw4::FltHitrateMargins hw4::FltInterrupt hw4::FltKatrinCommand hw4::FltKatrinControl hw4::FltKatrinEventFIFO1 hw4::FltKatrinEventFIFO2 hw4::FltKatrinEventFIFO3 hw4::FltKatrinEventFIFO4 hw4::FltKatrinEventFIFOStatus hw4::FltKatrinHistLastFirst hw4::FltKatrinHistogramSettings hw4::FltKatrinHitrateControl hw4::FltKatrinRunControl hw4::FltKatrinStatus hw4::FltKatrinThreshold hw4::FltMemory hw4::FltPeriphRegister hw4::FltRunControl hw4::FltSecondCounter hw4::FltStatistic hw4::FltStatisticControl hw4::FltStatus hw4::FltThreshold hw4::FltVersion hw4::SltByteRegister hw4::SltCommandReg hw4::SltControlReg hw4::SltCounter hw4::SltDataBlockReg hw4::SltEEPROMControlReg hw4::SltEPCSCommandReg hw4::SltEventStatusMem hw4::SltFIFOReset hw4::SltFIFOStatus hw4::SltI2CCommandReg hw4::SltInterruptReg hw4::SltLongRegister hw4::SltPageManagementReg hw4::SltPageSelectReg hw4::SltReadoutControlReg hw4::SltReadoutStatusReg hw4::SltSetSecondCounter hw4::SltStatusReg hw4::SltTimingReg hw4::SltVersion

List of all members.

Public Member Functions

Public Attributes

Protected Attributes


Detailed Description

The class contains the register address modell of the SLT board.

The individual register address is calculated from the slot ID and the register ID.

The register implementation contains a cache function to avoid unneccessary access to the hardware. To decode the status bits the cache content can be used without storing any additional intermediate data.

Definition at line 148 of file baseregister.h.


Constructor & Destructor Documentation

hw4::BaseRegister::BaseRegister ( const char *  name,
int  slotID,
unsigned int  regID,
int  r,
int  w,
int  len = 1,
int  addrShift = 0,
int  blockLen = 1,
bool  useCache = true 
)

A register (slt object) is defined by it's name and the combination of slot ID and register ID.

Every register also posses the properties readable and writeable. The register object can also be used to access register vectors and memories. For a register vector the number of elements and the address shift needs to be specified. A memory need also this both parameters. Memoreis span a contiuous space so that block access can be used to get the data for all elements.

virtual hw4::BaseRegister::~BaseRegister ( ) [virtual]

The destructor deletes all entries from the item list when called.

Do not remove the item list in the specific register implementation.


Member Function Documentation

virtual int hw4::BaseRegister::getActiveBits ( int  elem = 0,
unsigned long  mask = 0xffffffff 
) [virtual]

Get number of active bits.

unsigned long hw4::BaseRegister::getAddr ( )

Get address.

unsigned long hw4::BaseRegister::getAddrShift ( )
int hw4::BaseRegister::getBlockLength ( )
unsigned long hw4::BaseRegister::getCache ( int  elem = 0,
int  line = 0 
)

Get the cache value.

This command will not read any data from the hardware.

void hw4::BaseRegister::getCache ( unsigned long *  data)
virtual int hw4::BaseRegister::getLength ( ) [virtual]

Reimplemented in hw4::SltByteRegister, and hw4::FltMemory.

const char* hw4::BaseRegister::getName ( )
bool hw4::BaseRegister::isCacheEnabled ( )

Cache management.

If the cache is disabled any access to the cache will cause an exception.

bool hw4::BaseRegister::isReadable ( )
bool hw4::BaseRegister::isWriteable ( )
virtual unsigned long hw4::BaseRegister::read ( ) [virtual]

Read the register return the data and store it in the object cache.

Default: Read all data

Reimplemented in hw4::FltPeriphRegister, hw4::SltCounter, hw4::BaseRegister64, and hw4::SltSecondCounter.

virtual unsigned long hw4::BaseRegister::read ( int  elem) [virtual]

Read the register return the data and store it in the object cache.

Read all data of a element.

Reimplemented in hw4::FltPeriphRegister.

virtual unsigned long hw4::BaseRegister::read ( int  elem,
int  line 
) [virtual]

Read the register return the data and store it in the object cache.

Reads all 'line's of item number 'elem'.

Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.

virtual void hw4::BaseRegister::readBlock ( unsigned long *  data) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

Reimplemented in hw4::FltPeriphRegister, and hw4::BaseFIFO.

virtual void hw4::BaseRegister::readBlock ( unsigned long *  data,
unsigned long  blockLen 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

Reimplemented in hw4::BaseFIFO.

virtual void hw4::BaseRegister::readBlock ( unsigned long *  data,
unsigned long  start,
unsigned long  blockLen 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::readBlock ( int  elem,
unsigned long *  data 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::readBlock ( int  elem,
unsigned long *  data,
unsigned long  blockLen 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::readBlock ( int  elem,
unsigned long *  data,
unsigned long  start,
unsigned long  blockLen 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::readElements ( int  elem0,
int  elem1,
unsigned long *  data 
) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::readElements ( unsigned long *  data = 0) [virtual]

Read all elements of the register vector return the data and store it in the object cache.

virtual void hw4::BaseRegister::setBitsToHigh ( unsigned long  mask) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::setBitsToHigh ( int  elem,
unsigned long  mask 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::setBitsToLow ( unsigned long  mask) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::setBitsToLow ( int  elem,
unsigned long  mask 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

void hw4::BaseRegister::setCache ( unsigned long  data)

Write data to cache.

Reimplemented in hw4::FltPeriphRegister.

void hw4::BaseRegister::setCache ( int  elem,
unsigned long  data 
)

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::setCacheBits ( unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Modify data in cache.

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::setCacheBits ( int  elem,
unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::write ( unsigned long  data) [virtual]

Write data to hardware.

The write access is not cached.

Reimplemented in hw4::FltPeriphRegister, hw4::SltCounter, and hw4::BaseRegister64.

virtual void hw4::BaseRegister::write ( int  elem,
unsigned long  data 
) [virtual]

Write a single register element.

The write access is not cached.

Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.

virtual void hw4::BaseRegister::write ( int  elem,
int  line,
unsigned long  data 
) [virtual]

Write a single register element.

The write access is not cached.

Reimplemented in hw4::FltPeriphRegister, hw4::SltByteRegister, and hw4::FltMemory.

virtual void hw4::BaseRegister::write ( unsigned long *  data) [virtual]

Write all elemens of a register vector.

The write access is not cached.

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::writeBits ( unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::writeBits ( int  elem,
unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::writeBits ( int  elem,
int  line,
unsigned long  data,
unsigned long  mask,
int  shift 
) [virtual]

Reimplemented in hw4::FltPeriphRegister.

virtual int hw4::BaseRegister::writeBitsByName ( char *  name,
unsigned long  data 
) [virtual]

Set a bit field by name.

The bit field have to be defined in the specialized classes.

Parameters:
namename of the bit field
datavaues to write to the specified bit field
Returns:
0 Ok, 1 bit field unknown
virtual void hw4::BaseRegister::writeCache ( ) [virtual]

Write cache to hardware.

virtual void hw4::BaseRegister::writeCache ( int  elem) [virtual]

Write cache to hardware.

Reimplemented in hw4::FltPeriphRegister.

virtual void hw4::BaseRegister::writeCache ( int  elem,
int  line 
) [virtual]

Write cache to hardware.


Member Data Documentation

unsigned long hw4::BaseRegister::addr [protected]

Definition at line 318 of file baseregister.h.

unsigned long hw4::BaseRegister::addrShift [protected]

Definition at line 320 of file baseregister.h.

int hw4::BaseRegister::blockLen [protected]

Definition at line 324 of file baseregister.h.

unsigned long* hw4::BaseRegister::cache [protected]

The register cache contains the last data returned from the hardware.

It can also be used to sample and assemble data from different items before sending the data.

Definition at line 343 of file baseregister.h.

Definition at line 334 of file baseregister.h.

bool hw4::BaseRegister::isMemory [protected]

Definition at line 336 of file baseregister.h.

List of items in the register.

Definition at line 290 of file baseregister.h.

Number of bit fields.

Definition at line 293 of file baseregister.h.

int hw4::BaseRegister::len [protected]

Definition at line 322 of file baseregister.h.

const char* hw4::BaseRegister::name [protected]

Definition at line 326 of file baseregister.h.

bool hw4::BaseRegister::readable [protected]

Definition at line 328 of file baseregister.h.

bool hw4::BaseRegister::useCache [protected]

Definition at line 332 of file baseregister.h.

bool hw4::BaseRegister::writeable [protected]

Definition at line 330 of file baseregister.h.


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