Public Member Functions | Protected Attributes

abbdaemon::ABBdaemonClient Class Reference

#include <ABBdaemon.h>

Collaboration diagram for abbdaemon::ABBdaemonClient:
Collaboration graph
[legend]

Public Member Functions

 ABBdaemonClient (const char *name="mprace-0", int role=0)
virtual ~ABBdaemonClient ()
void setReg (uint32_t reg, uint32_t value)
void enableDebugMessages (bool enable)
uint32_t submitReset (uint32_t reset=RESET_ALL)
uint32_t submitPut (uint32_t rocid, uint32_t retid, uint32_t addr, uint32_t value)
uint32_t submitNPut (uint32_t rocid, uint32_t retid, int n, uint32_t *addr, uint32_t *values, uint32_t *retvals=0)
uint32_t submitGet (uint32_t rocid, uint32_t retid, uint32_t addr, uint32_t *value)
uint32_t submitNGet (uint32_t rocid, uint32_t retid, int n, uint32_t *addr, uint32_t *value, uint32_t *retvals=0)
uint32_t submitNOper (uint32_t rocid, uint32_t retid, int n, uint32_t *addr, uint32_t *value, uint32_t *retvals=0)
uint32_t submitPutDLM (uint32_t value)
uint32_t submitGetDLM (uint32_t *value)
uint32_t readDMAserialized (const unsigned int address, DMABUFFER_HANDLE buffer_handle, const unsigned int count, const unsigned int offset=0, const bool inc=true, const bool lock=true, const float timeout=0.0)
DMABUFFER_HANDLE registerBuffer (unsigned int len, void *address)
void syncBuffer (DMABUFFER_HANDLE buffer)
void unregisterBuffer (DMABUFFER_HANDLE buffer)
uint32_t getFIFOStatus ()
uint32_t getCTLStatus ()
void getDesignID (uint32_t *version, uint32_t *major, uint32_t *author, uint32_t *minor)

Protected Attributes

mprace::ABB * board
std::ostream * debug

Detailed Description

Definition at line 47 of file ABBdaemon.h.


Constructor & Destructor Documentation

abbdaemon::ABBdaemonClient::ABBdaemonClient ( const char *  name = "mprace-0",
int  role = 0 
)

Definition at line 36 of file ABBdaemon.cxx.

References board, and debug.

abbdaemon::ABBdaemonClient::~ABBdaemonClient (  )  [virtual]

Destructor. Will clean up the connection.

Definition at line 49 of file ABBdaemon.cxx.

References board.


Member Function Documentation

void abbdaemon::ABBdaemonClient::enableDebugMessages ( bool  enable  ) 

Enables or disables debug messages.

Parameters:
enable If true, debug messages will be enabled.

Definition at line 55 of file ABBdaemon.cxx.

References debug.

uint32_t abbdaemon::ABBdaemonClient::getCTLStatus (  ) 

Gets the FIFO status for the CTL FIFO (communication with the ROC). See the ABB (see ABB user guide section 3.1.16).

Definition at line 283 of file ABBdaemon.cxx.

References board, and CTL_STATUS.

Referenced by main().

void abbdaemon::ABBdaemonClient::getDesignID ( uint32_t *  version,
uint32_t *  major,
uint32_t *  author,
uint32_t *  minor 
)

Gets the ABB design ID and stores the different parts of it in the given variables.

Parameters:
version will hold the Design version
major will hold the Design major revision
author will hold the author code
minor will hold the design minor revision

Definition at line 290 of file ABBdaemon.cxx.

References board, and DID.

Referenced by main().

uint32_t abbdaemon::ABBdaemonClient::getFIFOStatus (  ) 

Gets the FIFO status (how many quad-words are inside the FIFO at the moment).

Definition at line 275 of file ABBdaemon.cxx.

References board, and EVENT_BUFFER_STATUS.

Referenced by main(), roc::AbbTransport::Read_Complete(), and roc::AbbTransport::Read_Size().

uint32_t abbdaemon::ABBdaemonClient::readDMAserialized ( const unsigned int  address,
DMABUFFER_HANDLE  buffer_handle,
const unsigned int  count,
const unsigned int  offset = 0,
const bool  inc = true,
const bool  lock = true,
const float  timeout = 0.0 
)

Issue a readDMA, but properly lock before doing it so that multiple processes can use DMA.

Parameters:
board The board to perform the DMA on
address Address in the board.
buf the mprace DMA buffer
count Number of values to read from the board in dwords.
timeout Timeout for the DMA read in milliseconds

Definition at line 232 of file ABBdaemon.cxx.

References board, and debug.

Referenced by main(), and roc::AbbTransport::Read_Complete().

abbdaemon::DMABUFFER_HANDLE abbdaemon::ABBdaemonClient::registerBuffer ( unsigned int  len,
void *  address 
)

Registers the given buffer for use with the ABBdaemon.

Parameters:
len length in bytes of the given buffer
address Address of the buffer
Returns:
DMABUFFER_HANDLE, which is just a void* pointer

Definition at line 251 of file ABBdaemon.cxx.

References board, and debug.

Referenced by main(), and roc::AbbTransport::ProcessPoolChanged().

void abbdaemon::ABBdaemonClient::setReg ( uint32_t  reg,
uint32_t  value 
)

Extra functionality compare to normal daemon - Method to set register on ABB board directly

Definition at line 302 of file ABBdaemon.cxx.

References board.

Referenced by main().

uint32_t abbdaemon::ABBdaemonClient::submitGet ( uint32_t  rocid,
uint32_t  retid,
uint32_t  addr,
uint32_t *  value 
)

Reads the value of the given address using the ABB daemon.

Parameters:
rocid ROC id to send the message to
retid Return host id to receive the data
addr Address on the device from where to read the value
value Pointer where to store the value
Returns:
0 on success

Definition at line 180 of file ABBdaemon.cxx.

References submitNOper().

Referenced by roc::AbbDevice::CreateTransport(), roc::AbbDevice::ExecuteCommand(), and main().

uint32_t abbdaemon::ABBdaemonClient::submitGetDLM ( uint32_t *  value  ) 

Get a DLM from the port.

Parameters:
value Pointer on where to write the incoming message.
Returns:
0 on success

Definition at line 205 of file ABBdaemon.cxx.

References board, debug, and DLM_R2H.

uint32_t abbdaemon::ABBdaemonClient::submitNGet ( uint32_t  rocid,
uint32_t  retid,
int  n,
uint32_t *  addr,
uint32_t *  value,
uint32_t *  retvals = 0 
)

Read an array of n uint32_t addr and value pairs.

See also:
submitGet

Definition at line 185 of file ABBdaemon.cxx.

References submitNOper().

uint32_t abbdaemon::ABBdaemonClient::submitNOper ( uint32_t  rocid,
uint32_t  retid,
int  n,
uint32_t *  addr,
uint32_t *  value,
uint32_t *  retvals = 0 
)

Reads or writes an array of n uint32_t addr and value pairs. The type of the operation is specified in the MSB of the address value (if the MSB is set the operation is write, if it is not set, the operation is read).

Parameters:
retvals Array to store the return values of each command.

Definition at line 89 of file ABBdaemon.cxx.

References board, and debug.

Referenced by roc::AbbDevice::ExecuteCommand(), main(), submitGet(), submitNGet(), submitNPut(), and submitPut().

uint32_t abbdaemon::ABBdaemonClient::submitNPut ( uint32_t  rocid,
uint32_t  retid,
int  n,
uint32_t *  addr,
uint32_t *  values,
uint32_t *  retvals = 0 
)

Submit an array of n uint32_t addr and value pairs. Internally, not only the main message queue is used, but another one is created with message size n * sizeof(uint32_t) and two messages max. The first message will be the addr array, the second one the value array. This queue will be removed by the server after processing the request.

Parameters:
retvals An arry of n * sizeof(uint32_t) size which will store the return values for each put request. You can pass NULL to signalize that you are not interested in the return values.
See also:
submitPut
Returns:
0 on success
Exceptions:
when NULL-pointers are passed

Definition at line 168 of file ABBdaemon.cxx.

References submitNOper().

uint32_t abbdaemon::ABBdaemonClient::submitPut ( uint32_t  rocid,
uint32_t  retid,
uint32_t  addr,
uint32_t  value 
)

Writes a value at the given address using the ABB daemon.

Parameters:
rocid ROC id to send the message to
retid Return host id to receive the ackowledge
addr Address on the device where to write the given value
value The value to write at the specified address
Returns:
0 on success

Definition at line 162 of file ABBdaemon.cxx.

References submitNOper().

Referenced by roc::AbbDevice::ExecuteCommand(), and main().

uint32_t abbdaemon::ABBdaemonClient::submitPutDLM ( uint32_t  value  ) 

Writes a DLM to the port.

Parameters:
value The message to send. Only the 4 lsb are used.
Returns:
0 on success

Definition at line 191 of file ABBdaemon.cxx.

References board, debug, DLM_H2R, and DLM_MASK.

Referenced by roc::AbbDevice::ExecuteCommand(), and main().

uint32_t abbdaemon::ABBdaemonClient::submitReset ( uint32_t  reset = RESET_ALL  ) 
void abbdaemon::ABBdaemonClient::syncBuffer ( DMABUFFER_HANDLE  buffer  ) 

Synchronize the content of the given buffer, which has been registered with registerBuffer before. This should be done after a non-locking DMA is completed to ensure proper memory read.

Definition at line 260 of file ABBdaemon.cxx.

void abbdaemon::ABBdaemonClient::unregisterBuffer ( DMABUFFER_HANDLE  buffer  ) 

Unregisters (frees) the given buffer, which has been registered with registerBuffer before.

Definition at line 267 of file ABBdaemon.cxx.

References debug.

Referenced by main(), and roc::AbbTransport::ProcessPoolChanged().


Field Documentation

mprace::ABB* abbdaemon::ABBdaemonClient::board [protected]
std::ostream* abbdaemon::ABBdaemonClient::debug [protected]

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