Rcuxx::RcuMemory Class Reference
[RCU interface classes]

#include <rcuxx/Rcu.h>

Inheritance diagram for Rcuxx::RcuMemory:

Inheritance graph
Collaboration diagram for Rcuxx::RcuMemory:

Collaboration graph

List of all members.


Detailed Description

Interface to the RCU memory banks.

Public Types

typedef std::vector< unsigned int > Cache_t

Public Member Functions

 RcuMemory (Rcu &rcu, const char *name, unsigned int base, unsigned int size, unsigned int max, bool commit, RcuCommand *clear=0, RcuCommand *exec=0, RcuCommand *abort=0)
virtual ~RcuMemory ()
virtual unsigned int Update ()
virtual unsigned int Commit ()
virtual unsigned int Update (size_t off, size_t n)
virtual unsigned int Commit (size_t off, size_t n)
virtual unsigned int Clear ()
virtual unsigned int Exec (unsigned int arg)
virtual unsigned int Abort ()
virtual bool Load (std::istream &in)
virtual bool Save (std::ostream &out)
virtual void Zero ()
unsigned int Size () const
unsigned int Max () const
const Cache_tData () const
Cache_tData ()
void Set (size_t off, size_t n, unsigned int *d)
void Get (size_t off, size_t n, unsigned int *d)
unsigned int Base () const
virtual void Print () const
const std::string & Name () const
virtual bool IsWriteable () const
virtual bool IsClearable () const
virtual bool IsExecutable () const

Protected Attributes

RcufRcu
std::string fName
unsigned int fBase
Cache_t fData
unsigned int fSize
unsigned int fMax
bool fWriteable
RcuCommandfClear
RcuCommandfExec
RcuCommandfAbort

Member Typedef Documentation

typedef std::vector<unsigned int> Rcuxx::RcuMemory::Cache_t

Type of cache.


Constructor & Destructor Documentation

Rcuxx::RcuMemory::RcuMemory ( Rcu rcu,
const char *  name,
unsigned int  base,
unsigned int  size,
unsigned int  max,
bool  commit,
RcuCommand clear = 0,
RcuCommand exec = 0,
RcuCommand abort = 0 
) [inline]

Constructor.

Parameters:
rcu Reference to RCU
name Name of the memory
base Base address
size Number of words in the memory
max Maximum value of words in the memory
commit Whether the memory is writeable
clear Command to clear
exec Command to execute
abort Command to abort execution.

References Zero().

virtual Rcuxx::RcuMemory::~RcuMemory (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual unsigned int Rcuxx::RcuMemory::Update (  )  [inline, virtual]

virtual unsigned int Rcuxx::RcuMemory::Commit (  )  [inline, virtual]

Commit to the RCU.

Returns:
0 on success, error code otherwise

Reimplemented in Rcuxx::RcuACL, and Rcuxx::RcuDMEM.

References fSize.

Referenced by Rcuxx::RcuRegister::Commit(), Rcuxx::RcuDMEM::Commit(), Rcuxx::RcuACTFEC::Commit(), Rcuxx::RcuACL::Commit(), and Rcuxx::RcuIMEM::Execute().

unsigned int Rcuxx::RcuMemory::Update ( size_t  off,
size_t  n 
) [inline, virtual]

Update the cache (restricted).

Parameters:
off Where to start reading
n How many words to read
Returns:
0 on success, error code otherwise

Reimplemented in Rcuxx::RcuACL, Rcuxx::RcuDMEM, and Rcuxx::RcuSTATUS.

References fBase, fData, fRcu, fSize, and Rcuxx::Rcu::ReadMemory().

unsigned int Rcuxx::RcuMemory::Commit ( size_t  off,
size_t  n 
) [inline, virtual]

Write to the hardware (restricted).

Parameters:
off Where to start reading
n How many words to read
Returns:
0 on success, error code otherwise

Reimplemented in Rcuxx::RcuACL, and Rcuxx::RcuDMEM.

References fBase, fData, fRcu, fSize, and Rcuxx::Rcu::WriteMemory().

unsigned int Rcuxx::RcuMemory::Clear (  )  [inline, virtual]

Clear memory.

Reimplemented in Rcuxx::RcuACL.

References Rcuxx::RcuCommand::Commit(), and fClear.

unsigned int Rcuxx::RcuMemory::Exec ( unsigned int  arg  )  [inline, virtual]

Clear memory.

References Rcuxx::RcuCommand::Commit(), and fExec.

Referenced by Rcuxx::RcuIMEM::Execute().

unsigned int Rcuxx::RcuMemory::Abort (  )  [inline, virtual]

Clear memory.

References Rcuxx::RcuCommand::Commit(), and fAbort.

bool Rcuxx::RcuMemory::Load ( std::istream &  in  )  [inline, virtual]

Load a file into the cache.

Returns:
true on success, false otherwise

References fData.

bool Rcuxx::RcuMemory::Save ( std::ostream &  out  )  [inline, virtual]

Save the cache to file.

Returns:
true on success, false otherwise

References fData.

void Rcuxx::RcuMemory::Zero (  )  [inline, virtual]

Zero the memory.

Reimplemented in Rcuxx::RcuACL.

References fData.

Referenced by RcuMemory(), and Rcuxx::RcuACL::Zero().

unsigned int Rcuxx::RcuMemory::Size (  )  const [inline]

Returns:
Get the size

References fSize.

Referenced by Rcuxx::RcuACTFEC::ACLSync(), and Rcuxx::RcuACTFEC::SyncToACL().

unsigned int Rcuxx::RcuMemory::Max (  )  const [inline]

Returns:
maximum value of each entry

References fMax.

const Cache_t& Rcuxx::RcuMemory::Data (  )  const [inline]

Returns:
Get the data

References fData.

Cache_t& Rcuxx::RcuMemory::Data (  )  [inline]

Returns:
Get the data

Reimplemented in Rcuxx::RcuACL.

References fData.

void Rcuxx::RcuMemory::Set ( size_t  off,
size_t  n,
unsigned int *  d 
) [inline]

Set the cache.

Parameters:
off Starting offset
n How many words (size of d)
d The values Set

Reimplemented in Rcuxx::RcuACL.

References fData, and fMax.

Referenced by Rcuxx::RcuIMEM::Append(), Rcuxx::RcuRegister::Commit(), Rcuxx::RcuACTFEC::Commit(), and Rcuxx::RcuACL::Set().

void Rcuxx::RcuMemory::Get ( size_t  off,
size_t  n,
unsigned int *  d 
) [inline]

Get the cache.

Parameters:
off Starting offset
n How many words (size of d)
d On return, the values

Reimplemented in Rcuxx::RcuACL.

References fData, and fMax.

Referenced by Rcuxx::RcuACL::Get(), Rcuxx::RcuRegister::Update(), and Rcuxx::RcuACTFEC::Update().

unsigned int Rcuxx::RcuMemory::Base (  )  const [inline]

Get the base address.

References fBase.

Referenced by Rcuxx::RcuRegister::Print().

void Rcuxx::RcuMemory::Print (  )  const [inline, virtual]

Print cache to standard output.

Reimplemented in Rcuxx::RcuACL, and Rcuxx::RcuSTATUS.

Examples:
rwr_trcfg.cxx.

References fData, and fName.

const std::string& Rcuxx::RcuMemory::Name (  )  const [inline]

Get the name.

References fName.

virtual bool Rcuxx::RcuMemory::IsWriteable (  )  const [inline, virtual]

Whether we got Clear.

References fWriteable.

virtual bool Rcuxx::RcuMemory::IsClearable (  )  const [inline, virtual]

Whether we got Clear.

References fClear.

virtual bool Rcuxx::RcuMemory::IsExecutable (  )  const [inline, virtual]

Whether we got Clear.

References fExec.


Member Data Documentation

std::string Rcuxx::RcuMemory::fName [protected]

Name.

Referenced by Name(), Rcuxx::RcuSTATUS::Print(), and Print().

unsigned int Rcuxx::RcuMemory::fBase [protected]

unsigned int Rcuxx::RcuMemory::fMax [protected]

Max value of each entry in the memory.

Referenced by Get(), Max(), and Set().

bool Rcuxx::RcuMemory::fWriteable [protected]

Whether the memory is writeable.

Referenced by IsWriteable().

Clear command, if any.

Referenced by Clear(), and IsClearable().

Execute command, if any.

Referenced by Exec(), and IsExecutable().

Abort command, if any.

Referenced by Abort().


The documentation for this class was generated from the following file:
Top of page Last update Wed Jun 4 00:51:26 2008
Copyright © 2004 Christian Holm Created by DoxyGen 1.5.6