Cat
Public Member Functions | Private Attributes | List of all members
RAM Class Reference

#include <inc/RAM.h>

Inheritance diagram for RAM:
IOobject Element Hierarchy Object Attrib

Public Member Functions

 RAM ()
 Standard constructor. More...
 
virtual ~RAM ()
 Destructor. More...
 
void help ()
 
StatusCode setSize (unsigned int, unsigned int)
 
StatusCode raz ()
 
int depth ()
 
int width ()
 
- Public Member Functions inherited from IOobject
 IOobject ()
 Standard constructor. More...
 
virtual ~IOobject ()
 Destructor. More...
 
void reset ()
 
void update ()
 
virtual StatusCode init ()
 
IOdataio ()
 
virtual StatusCode read ()
 
virtual StatusCode write ()
 
void setAddress (U32 address)
 
U32 address ()
 
void dump ()
 
- Public Member Functions inherited from Element
 Element ()
 Standard constructor. More...
 
virtual ~Element ()
 Destructor. More...
 
void recursiveInitElement ()
 
void recursiveInitCommunications ()
 
StatusCode setConnection (Hierarchy *)
 
Hierarchyconnection ()
 
- Public Member Functions inherited from Hierarchy
 Hierarchy ()
 Standard constructor. More...
 
virtual ~Hierarchy ()
 Destructor. More...
 
void clear ()
 
void setParent (Hierarchy *parent)
 
Hierarchyparent ()
 
Hierarchyparent (std::string)
 
Hierarchyorigin ()
 
virtual void addChild (Hierarchy *element)
 
std::vector< Hierarchy * > children ()
 
Hierarchychild (std::string)
 
HierarchychildTyped (std::string)
 
unsigned long numberOfChildren ()
 
bool hasChildren ()
 
void delChild (Hierarchy *)
 
void delChild (std::string)
 
std::string path (std::string=std::string(""))
 
std::string pathTyped (std::string=std::string(""))
 
void tree (std::string indent=std::string(""))
 
void tree ()
 
- Public Member Functions inherited from Object
 Object ()
 Standard constructor. More...
 
virtual ~Object ()
 Destructor. More...
 
std::string name () const
 
std::string type ()
 
unsigned char id ()
 
std::string title ()
 
void msgSvc (int level, std::string msg, std::string name)
 
void msg (std::string mymsg)
 
void verbose (std::string mymsg)
 
void debug (std::string mymsg)
 
void info (std::string mymsg)
 
void warning (std::string mymsg)
 
void error (std::string mymsg)
 
void fatal (std::string mymsg)
 
void msg (std::string mymsg, std::string name)
 
void verbose (std::string mymsg, std::string name)
 
void debug (std::string mymsg, std::string name)
 
void info (std::string mymsg, std::string name)
 
void warning (std::string mymsg, std::string name)
 
void error (std::string mymsg, std::string name)
 
void fatal (std::string mymsg, std::string name)
 
void setName (std::string name)
 
void setType (std::string type)
 
void setId (unsigned char id)
 
void setTitle (std::string title)
 
void setDllName (std::string dllName)
 
std::string dllName ()
 
- Public Member Functions inherited from Attrib
 Attrib ()
 Standard constructor. More...
 
virtual ~Attrib ()
 Destructor. More...
 
bool is (int attribut)
 
void add (int attribut)
 
void remove (int attribut)
 
std::string attributs ()
 

Private Attributes

int m_width
 
int m_depth
 

Additional Inherited Members

- Public Types inherited from IOobject
typedef unsigned long U32
 
typedef unsigned short U16
 
typedef unsigned char U8
 
- Public Types inherited from Attrib
enum  Attribut {
  UNDEFINED, PASSIVE, ACTIVE, INTERFACE,
  IO, IODATA, ELEMENT, HARDWARE,
  PROCESSUS, SOFTWARE
}
 
- Protected Attributes inherited from Element
Hierarchym_connection
 
- Protected Attributes inherited from Attrib
std::string m_attribString [10]
 

Detailed Description

Author
Date
2006-10-23

Definition at line 16 of file RAM.h.

Constructor & Destructor Documentation

◆ RAM()

RAM::RAM ( )

Standard constructor.

Definition at line 17 of file RAM.cpp.

References Object::setName(), and Object::setType().

17  {
18  setName("RAM");
19  setType("RAM");
20 }
void setName(std::string name)
Definition: Object.h:51
void setType(std::string type)
Definition: Object.h:52

◆ ~RAM()

RAM::~RAM ( )
virtual

Destructor.

Definition at line 24 of file RAM.cpp.

24 {}

Member Function Documentation

◆ depth()

int RAM::depth ( )
inline

◆ help()

void RAM::help ( )
inlinevirtual

printout help for the element

Reimplemented from IOobject.

Definition at line 26 of file RAM.h.

References Object::info(), Object::name(), raz(), and setSize().

26 { info("RAM "+name()+". No help.","RAM::help"); };
void info(std::string mymsg)
Definition: Object.h:38
std::string name() const
Definition: Object.h:28

◆ raz()

StatusCode RAM::raz ( )

Definition at line 43 of file RAM.cpp.

References shell::data(), IOdata::dataU8(), IOobject::io(), m_depth, m_width, StatusCode::SUCCESS, and IOobject::write().

Referenced by BOOST_PYTHON_MODULE(), and help().

43  {
44  U8* data=io()->dataU8();
45  for (int i=0; i<m_depth*m_width;++i){
46  data[i]=i;
47  }
48  write();
49  return StatusCode::SUCCESS;
50 }
virtual StatusCode write()
Definition: IOobject.h:80
int m_width
Definition: RAM.h:43
unsigned char U8
Definition: ICECALv3.h:55
int m_depth
Definition: RAM.h:44
def data(object, stream=None)
Definition: shell.py:150
U8 * dataU8()
Definition: IOdata.h:214
IOdata * io()
Definition: IOobject.h:66

◆ setSize()

StatusCode RAM::setSize ( unsigned int  width,
unsigned int  depth 
)

Definition at line 29 of file RAM.cpp.

References IOdata::defDataU8(), depth(), StatusCode::FAILURE, IOobject::io(), itos(), m_depth, m_width, StatusCode::SUCCESS, and Object::warning().

Referenced by A3PE::A3PE(), BOOST_PYTHON_MODULE(), FEB_v1::FEB_v1(), help(), FePGA::MakeRAM(), SeqPGA::SeqPGA(), A3PE::setFifoDepth(), FePGA::spiRead(), SeqPGA::spiRead(), FePGA::spiWrite(), and SeqPGA::spiWrite().

29  {
30  if (0!=width%8){
31  width=(width/8)+8;
32  warning("The width is not an integer number of octet. Width is set to "+
33  itos(width),"RAM::RAM");
34  return StatusCode::FAILURE;
35  }
36  m_width=width/8;
37  m_depth=depth;
39  return StatusCode::SUCCESS;
40 }
std::string itos(int)
Definition: Tools.cpp:46
int m_width
Definition: RAM.h:43
int width()
Definition: RAM.h:36
int m_depth
Definition: RAM.h:44
int depth()
Definition: RAM.h:32
void defDataU8(unsigned long size)
Definition: IOdata.h:179
void warning(std::string mymsg)
Definition: Object.h:39
IOdata * io()
Definition: IOobject.h:66

◆ width()

int RAM::width ( )
inline

Definition at line 36 of file RAM.h.

References m_width.

36  {
37  return m_width;
38  }
int m_width
Definition: RAM.h:43

Member Data Documentation

◆ m_depth

int RAM::m_depth
private

Definition at line 44 of file RAM.h.

Referenced by depth(), raz(), and setSize().

◆ m_width

int RAM::m_width
private

Definition at line 43 of file RAM.h.

Referenced by raz(), setSize(), and width().


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