pit_comm Class Reference

Pit driver class to manage the comunication to the SIU card on the pit hardware via the D-Rorc on the computer running the pit FED server.DDL communication layer class. More...

#include <pit_comm.h>

List of all members.

Public Member Functions

 pit_comm (void)
 ~pit_comm (void)
int PITGetControl0 ()
int PITGetBusStatus ()
 its a special register like wr_len, rd_len with the following status bits : 1 parity error 2 block length mismatch 3 target stoped transaction 4 no target answered before timeout 5 no data input from ddl before timeout 6 fifo overflow error 7 fifo underflow
int PITGetControl1 ()
int PITGetVersion ()
int PITSetControl0 (UInt8 value)
int PITSetControl1 (UInt8 value)
bool PITGetDDLLinkStatus ()
 Getter of DDLLinkStatus.
bool PITCheckCommStatus ()
 Tries to reset, access the hardware and to decode, by the returned value, the status of the DDL link updating DDLLinkStatus and controlFPGAAnswers Method to reset and check DDL link status.
int PITReadBlock (UInt28 address, UInt19 datalength, UInt32 *data)
int PITWriteBlock (UInt28 address, UInt19 datalength, UInt32 *data)
int PITReadWord (UInt28 address, UInt32 *data)
int PITWriteWord (UInt28 address, const UInt32 &data)
int PITrorcReset (void)
 Resets the rorc channel Makes a call from the rorcReset function from the lower level rorc_lib.h.

Private Member Functions

void PITDecodeRORCError (int rorcError, const char *extraInfo)
 DDL library error decoding method, logs error message throws pit_com_exceptions.
void PITDecodeComError (int comError, const char *extraInfo)
 to decode the pit generated errors like the wrong length also logs errors throws pit_com_exceptions
int PITSetWrA (UInt28)
 Private member function, implementation details inside.
int PITSetRdA (UInt28)
 Private member function, implementation details inside.
int PITSetLen (UInt19)
 Private member function, implementation details inside.
int PITGetRdA ()
 Private member function, implementation details inside.
int PITGetWrA ()
 Private member function, implementation details inside.
int PITGetLen ()
 Private member function, implementation details inside.
int PITGetRdLen ()
 Private member function, implementation details inside.
int PITGetWrLen ()
 Private member function, implementation details inside.

Private Attributes

log4cpp::Category * logCom
 pointer to the logger instance
chan_key * rorc
 Communication library handler.
int rorcStatus
 Data member to store fec2rorc library error value.
bool DDLLinkStatus
 No hardware access attempt should be done if this if FAILURE.
int controlFPGAAnswers
 No hardware access attempt should be done if this if FAILURE.
DimService * serviceCommunicationStatus
 Dim service to publish the status of the communication to the PIT hardware, name "PIT/COMMUNICATION_STATUS", type = integer.


Detailed Description

Pit driver class to manage the comunication to the SIU card on the pit hardware via the D-Rorc on the computer running the pit FED server.DDL communication layer class.

This class uses the fec2rorc_lib. Modified by Gianluca on 15/01/2008 to implement exception mechanism.

Author:
Fabrice Pancher, Gianluca Aglieri Rinella, Cesar Matos

Definition at line 26 of file pit_comm.h.


Constructor & Destructor Documentation

pit_comm::pit_comm ( void   ) 

Definition at line 12 of file pit_comm.cpp.

References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, PITCheckCommStatus(), rorc, RORC_CHANNEL, RORC_REVISION, RORC_SERIAL, rorcStatus, and serviceCommunicationStatus.

pit_comm::~pit_comm ( void   ) 

Definition at line 42 of file pit_comm.cpp.

References PITrorcReset(), and rorc.


Member Function Documentation

void pit_comm::PITDecodeRORCError ( int  rorcError,
const char *  extraInfo 
) [private]

DDL library error decoding method, logs error message throws pit_com_exceptions.

Definition at line 137 of file pit_comm.cpp.

References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, and SUCCESS.

Referenced by PITCheckCommStatus(), PITGetBusStatus(), PITGetControl0(), PITGetControl1(), PITGetLen(), PITGetRdA(), PITGetRdLen(), PITGetVersion(), PITGetWrA(), PITGetWrLen(), PITReadBlock(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), and PITWriteBlock().

void pit_comm::PITDecodeComError ( int  comError,
const char *  extraInfo 
) [private]

to decode the pit generated errors like the wrong length also logs errors throws pit_com_exceptions

Definition at line 190 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, ERROR_GENERIC_BUS_STATUS, ERROR_PARITY_CHECK, ERROR_PROTOCOL_DATALENGTH, and logCom.

Referenced by PITReadBlock(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), and PITWriteBlock().

int pit_comm::PITSetWrA ( UInt28   )  [private]

Private member function, implementation details inside.

Definition at line 488 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, PIT_GET_WRA_MSB, PITDecodeComError(), PITDecodeRORCError(), and rorc.

Referenced by PITWriteBlock().

int pit_comm::PITSetRdA ( UInt28   )  [private]

Private member function, implementation details inside.

Definition at line 438 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, PIT_GET_RDA_MSB, PITDecodeComError(), PITDecodeRORCError(), and rorc.

Referenced by PITReadBlock().

int pit_comm::PITSetLen ( UInt19   )  [private]

Private member function, implementation details inside.

Definition at line 536 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, PIT_GET_LEN, PITDecodeComError(), PITDecodeRORCError(), and rorc.

Referenced by PITReadBlock().

int pit_comm::PITGetRdA (  )  [private]

Private member function, implementation details inside.

Definition at line 225 of file pit_comm.cpp.

References PIT_GET_RDA_LSB, PIT_GET_RDA_MSB, PITDecodeRORCError(), and rorc.

int pit_comm::PITGetWrA (  )  [private]

Private member function, implementation details inside.

Definition at line 261 of file pit_comm.cpp.

References PIT_GET_WRA_LSB, PIT_GET_WRA_MSB, PITDecodeRORCError(), and rorc.

int pit_comm::PITGetLen (  )  [private]

Private member function, implementation details inside.

Definition at line 295 of file pit_comm.cpp.

References PIT_GET_LEN, PITDecodeRORCError(), and rorc.

int pit_comm::PITGetRdLen (  )  [private]

Private member function, implementation details inside.

Definition at line 315 of file pit_comm.cpp.

References PIT_GET_RD_LEN, PITDecodeRORCError(), and rorc.

Referenced by PITReadBlock().

int pit_comm::PITGetWrLen (  )  [private]

Private member function, implementation details inside.

Definition at line 335 of file pit_comm.cpp.

References PIT_GET_WR_LEN, PITDecodeRORCError(), and rorc.

Referenced by PITWriteBlock().

int pit_comm::PITGetControl0 (  ) 

Definition at line 355 of file pit_comm.cpp.

References PIT_GET_CONTROL0, PITDecodeRORCError(), and rorc.

int pit_comm::PITGetBusStatus (  ) 

its a special register like wr_len, rd_len with the following status bits : 1 parity error 2 block length mismatch 3 target stoped transaction 4 no target answered before timeout 5 no data input from ddl before timeout 6 fifo overflow error 7 fifo underflow

Definition at line 415 of file pit_comm.cpp.

References PIT_GET_BUS_STATUS, PITDecodeRORCError(), and rorc.

Referenced by PITReadBlock().

int pit_comm::PITGetControl1 (  ) 

Definition at line 375 of file pit_comm.cpp.

References PIT_GET_CONTROL1, PITDecodeRORCError(), and rorc.

int pit_comm::PITGetVersion (  ) 

Definition at line 395 of file pit_comm.cpp.

References PIT_GET_VERSION, PITDecodeRORCError(), and rorc.

Referenced by pit_driver::readFpgaFirmwareVersion().

int pit_comm::PITSetControl0 ( UInt8  value  ) 

Definition at line 586 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, PIT_GET_CONTROL0, PITDecodeComError(), PITDecodeRORCError(), and rorc.

int pit_comm::PITSetControl1 ( UInt8  value  ) 

Definition at line 630 of file pit_comm.cpp.

References ERROR_BAD_REGISTER_WRITE, PIT_GET_CONTROL1, PITDecodeComError(), PITDecodeRORCError(), and rorc.

bool pit_comm::PITGetDDLLinkStatus (  )  [inline]

Getter of DDLLinkStatus.

Definition at line 108 of file pit_comm.h.

References DDLLinkStatus.

bool pit_comm::PITCheckCommStatus (  ) 

Tries to reset, access the hardware and to decode, by the returned value, the status of the DDL link updating DDLLinkStatus and controlFPGAAnswers Method to reset and check DDL link status.

Definition at line 55 of file pit_comm.cpp.

References controlFPGAAnswers, DDLLinkStatus, FAILURE, logCom, PIT_GET_VERSION, PITDecodeRORCError(), PITrorcReset(), rorc, rorcStatus, serviceCommunicationStatus, and SUCCESS.

Referenced by pit_driver_optinBoard::checkBoardPlugged(), pit_driver::executeCommand(), pit_comm(), and pit_driver::refresh().

int pit_comm::PITReadBlock ( UInt28  address,
UInt19  datalength,
UInt32 data 
)

Reads a block of data from pit address space.

Parameters:
address Base address to read from
datalength Length of requested data
data pointer to a piece of memory long enough to store the read block
Returns:
number of 32 bits words actually read

Definition at line 682 of file pit_comm.cpp.

References ERROR_BAD_LENGTH_COMPARISON, ERROR_GENERIC_BUS_STATUS, ERROR_PARITY_CHECK, extractFromUInt32(), PITDecodeComError(), PITDecodeRORCError(), PITGetBusStatus(), PITGetRdLen(), PITSetLen(), PITSetRdA(), and rorc.

Referenced by pit_driver::executeCommand(), pit_driver::pitMemoryAccessTest(), PITReadWord(), testReadMemBlock(), and testReadWord().

int pit_comm::PITWriteBlock ( UInt28  address,
UInt19  datalength,
UInt32 data 
)

Writes a block of data to the pit hardware.

Parameters:
address Base address where to start writing to (general addressing space)
datalength Length of data to write
data Pointer to a piece of memory with data
Returns:
number of 32 bits words actually written to

Definition at line 749 of file pit_comm.cpp.

References ERROR_BAD_LENGTH_COMPARISON, PITDecodeComError(), PITDecodeRORCError(), PITGetWrLen(), PITSetWrA(), and rorc.

Referenced by pit_driver::executeCommand(), pit_driver::pitMemoryAccessTest(), PITWriteWord(), testReadMemBlock(), and testReadWord().

int pit_comm::PITReadWord ( UInt28  address,
UInt32 data 
)

Reads a word from pit address space.

Parameters:
address Base address to read from
data pointer to the memory space where to write the read value
Returns:
Number of actually read words (should be 1 on success)

Definition at line 789 of file pit_comm.cpp.

References logCom, and PITReadBlock().

Referenced by pit_driver_optinBoard::checkBoardPlugged(), pit_driver_foChannel::isRateValid(), pit_driver_foChannel::readCounter(), pit_driver_opticalLink::readErrorCounter(), pit_driver_opticalLink::readLinkSetting(), pit_driver_opticalLink::readLinkStatus(), pit_driver_optinBoard::readMaxFastorCounts(), pit_driver_optinBoard::readMinFastorCounts(), pit_driver_optinBoard::readOptinFirmwareVersion(), pit_driver_optinBoard::readOptinSetting(), pit_driver_optinBoard::readOptinStatus(), pit_driver_procFpga::readReg(), and pit_driver_optinBoard::readTimeStamp().

int pit_comm::PITWriteWord ( UInt28  address,
const UInt32 data 
)

Writes a block of data to the pit hardware.

Parameters:
address Base address where to start writing to (general addressing space)
datalength Length of data to write
data Pointer to a piece of memory with data
Returns:
number of actually written words (should be 1 on success)

Definition at line 781 of file pit_comm.cpp.

References logCom, and PITWriteBlock().

Referenced by simulate_values(), pit_driver_optinBoard::writeMaxFastorCounts(), pit_driver_optinBoard::writeMinFastorCounts(), pit_driver_optinBoard::writeOptinCommand(), pit_driver_optinBoard::writeOptinSetting(), and pit_driver_procFpga::writeReg().

int pit_comm::PITrorcReset ( void   ) 

Resets the rorc channel Makes a call from the rorcReset function from the lower level rorc_lib.h.

the low level function rorcReset is called twice with the options RORC_RESET_SIU and RORC_RESET_RORC for the moment also added a ddlResetSiu call, as see in the siu_reset.c code

Definition at line 101 of file pit_comm.cpp.

References logCom, rorc, and rorcStatus.

Referenced by pit_driver::executeCommand(), PITCheckCommStatus(), and ~pit_comm().


Member Data Documentation

log4cpp::Category* pit_comm::logCom [private]

pointer to the logger instance

Definition at line 33 of file pit_comm.h.

Referenced by pit_comm(), PITCheckCommStatus(), PITDecodeComError(), PITDecodeRORCError(), PITReadWord(), PITrorcReset(), and PITWriteWord().

chan_key* pit_comm::rorc [private]

Communication library handler.

Definition at line 35 of file pit_comm.h.

Referenced by pit_comm(), PITCheckCommStatus(), PITGetBusStatus(), PITGetControl0(), PITGetControl1(), PITGetLen(), PITGetRdA(), PITGetRdLen(), PITGetVersion(), PITGetWrA(), PITGetWrLen(), PITReadBlock(), PITrorcReset(), PITSetControl0(), PITSetControl1(), PITSetLen(), PITSetRdA(), PITSetWrA(), PITWriteBlock(), and ~pit_comm().

int pit_comm::rorcStatus [private]

Data member to store fec2rorc library error value.

Definition at line 36 of file pit_comm.h.

Referenced by pit_comm(), PITCheckCommStatus(), and PITrorcReset().

bool pit_comm::DDLLinkStatus [private]

No hardware access attempt should be done if this if FAILURE.

Definition at line 41 of file pit_comm.h.

Referenced by pit_comm(), PITCheckCommStatus(), PITDecodeRORCError(), and PITGetDDLLinkStatus().

int pit_comm::controlFPGAAnswers [private]

No hardware access attempt should be done if this if FAILURE.

Definition at line 46 of file pit_comm.h.

Referenced by pit_comm(), PITCheckCommStatus(), and PITDecodeRORCError().

DimService* pit_comm::serviceCommunicationStatus [private]

Dim service to publish the status of the communication to the PIT hardware, name "PIT/COMMUNICATION_STATUS", type = integer.

Definition at line 49 of file pit_comm.h.

Referenced by pit_comm(), and PITCheckCommStatus().


The documentation for this class was generated from the following files:
Generated on Sat Mar 29 22:55:55 2008 for pixelTrigger by  doxygen 1.5.0