OpenASIP  2.0
Public Member Functions | List of all members
UnboundedRegisterFile Class Reference

#include <UnboundedRegisterFile.hh>

Inheritance diagram for UnboundedRegisterFile:
Inheritance graph
Collaboration diagram for UnboundedRegisterFile:
Collaboration graph

Public Member Functions

 UnboundedRegisterFile (const std::string &name, int width, RegisterFile::Type type)
 
virtual ~UnboundedRegisterFile ()
 
virtual int numberOfRegisters () const
 
virtual void setMaxReads (int reads)
 
virtual void setMaxWrites (int maxWrites)
 
virtual void setNumberOfRegisters (int registers)
 
virtual void setWidth (int width)
 
virtual void setName (const std::string &name)
 
virtual void setType (RegisterFile::Type type)
 
virtual void loadState (const ObjectState *state)
 
- Public Member Functions inherited from TTAMachine::RegisterFile
 RegisterFile (const std::string &name, unsigned int size, unsigned int width, unsigned int maxReads, unsigned int maxwrites, unsigned int guardLatency, Type type, bool zeroRegister=false)
 
 RegisterFile (const ObjectState *state)
 
virtual ~RegisterFile ()
 
virtual RegisterFilecopy () const
 
virtual int maxReads () const
 
virtual int maxWrites () const
 
virtual RegisterFile::Type type () const
 
virtual bool isNormal () const
 
virtual bool isVolatile () const
 
virtual bool isReserved () const
 
virtual void setType (RegisterFile::Type type)
 
virtual int guardLatency () const
 
virtual void setGuardLatency (int latency)
 
virtual void unsetMachine ()
 
virtual ObjectStatesaveState () const
 
virtual bool isArchitectureEqual (const RegisterFile &rf) const
 
virtual bool isUsedAsGuard () const
 
virtual bool zeroRegister () const
 
virtual void setZeroRegister (const bool &value)
 
PortfirstReadPort () const
 
PortfirstWritePort () const
 
- Public Member Functions inherited from TTAMachine::BaseRegisterFile
virtual ~BaseRegisterFile ()
 
virtual int width () const
 
virtual int size () const
 
virtual RFPortport (const std::string &name) const
 
virtual RFPortport (int index) const
 
- Public Member Functions inherited from TTAMachine::Unit
virtual ~Unit ()
 
virtual bool hasPort (const std::string &name) const
 
virtual int portCount () const
 
virtual int outputPortCount (bool countBidir=false) const
 
virtual int inputPortCount (bool countBidir=false) const
 
virtual int bidirPortCount () const
 
virtual void setMachine (Machine &mach)
 
- Public Member Functions inherited from TTAMachine::Component
virtual ~Component ()
 
virtual TCEString name () const
 
virtual Machinemachine () const
 
virtual void ensureRegistration (const Component &component) const
 
virtual bool isRegistered () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Additional Inherited Members

- Public Types inherited from TTAMachine::RegisterFile
enum  Type { NORMAL, RESERVED, VOLATILE }
 Type of the register file indicates how the RF is used. More...
 
- Static Public Attributes inherited from TTAMachine::RegisterFile
static const std::string OSNAME_REGISTER_FILE = "reg_file"
 ObjectState name for RegisterFile. More...
 
static const std::string OSKEY_TYPE = "type"
 ObjectState attribute key for register file type. More...
 
static const std::string OSVALUE_NORMAL = "normal"
 ObjectState attribute value for normal register file type. More...
 
static const std::string OSVALUE_RESERVED = "reserved"
 ObjectState attribute value for reserved register file type. More...
 
static const std::string OSVALUE_VOLATILE = "volatile"
 ObjectState attribute value for volatile register file type. More...
 
static const std::string OSKEY_MAX_READS = "max_r"
 ObjectState attribute key for maximum simultaneous readers. More...
 
static const std::string OSKEY_MAX_WRITES = "max_w"
 ObjectState attribute key for maximum simultaneous writers. More...
 
static const std::string OSKEY_GUARD_LATENCY = "g_latency"
 ObjectState attribute key for the guard latency. More...
 
static const std::string OSKEY_ZERO_REGISTER = "zero_register"
 ObjectState attribute key for zero register flag. More...
 
- Static Public Attributes inherited from TTAMachine::BaseRegisterFile
static const std::string OSNAME_BASE_REGISTER_FILE = "baseregfile"
 ObjectState name for BaseRegisterFile. More...
 
static const std::string OSKEY_SIZE = "size"
 ObjectState attribute key for the number of registers. More...
 
static const std::string OSKEY_WIDTH = "width"
 ObjectState attribute key for bit width of the registers. More...
 
- Static Public Attributes inherited from TTAMachine::Unit
static const std::string OSNAME_UNIT = "unit"
 ObjectState name for Unit. More...
 
- Static Public Attributes inherited from TTAMachine::Component
static const std::string OSNAME_COMPONENT = "component"
 ObjectState name for component. More...
 
static const std::string OSKEY_NAME = "name"
 ObjectState attribute key for the name of the component. More...
 
- Protected Member Functions inherited from TTAMachine::BaseRegisterFile
 BaseRegisterFile (const std::string &name, int size, int width)
 
 BaseRegisterFile (const ObjectState *state)
 
- Protected Member Functions inherited from TTAMachine::Unit
 Unit (const std::string &name)
 
 Unit (const ObjectState *state)
 
virtual void removePort (Port &port)
 
- Protected Member Functions inherited from TTAMachine::Component
 Component (const std::string &name)
 
 Component (const ObjectState *state)
 
void internalSetMachine (Machine &machine)
 
void internalUnsetMachine ()
 
- Protected Member Functions inherited from TTAMachine::MachinePart
 MachinePart ()
 
virtual ~MachinePart ()
 

Detailed Description

UnboundedRegisterFile class represents a register file which has unlimited amount of registers. This kind of register files are used in UniversalMachine.

Definition at line 43 of file UnboundedRegisterFile.hh.

Constructor & Destructor Documentation

◆ UnboundedRegisterFile()

UnboundedRegisterFile::UnboundedRegisterFile ( const std::string &  name,
int  width,
RegisterFile::Type  type 
)

The constructor.

Parameters
nameThe name of the register file.
widthBit width of the registers in the register file.
typeType of the register file.
Exceptions
InvalidNameIf one of the given names is not a valid component name.
OutOfRangeIf the bit width is out of range.

Definition at line 50 of file UnboundedRegisterFile.cc.

52  : RegisterFile(name, INT_MAX, width, 1, 1, 0, type) {}

◆ ~UnboundedRegisterFile()

UnboundedRegisterFile::~UnboundedRegisterFile ( )
virtual

The destructor.

Definition at line 57 of file UnboundedRegisterFile.cc.

57  {
58 }

Member Function Documentation

◆ loadState()

void UnboundedRegisterFile::loadState ( const ObjectState state)
virtual

Aborts the program. It is not allowed to load UniversalMachine from an ObjectState tree. DO NOT CALL THIS METHOD!

Parameters
stateNever used.
Exceptions
ObjectStateLoadingExceptionNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 181 of file UnboundedRegisterFile.cc.

181  {
182  const string procName = "UnboundedRegisterFile::loadState";
183  const string errorMsg =
184  "Tried to load state of UnboundedRegisterFile from an ObjectState"
185  "tree!";
186  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
188 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ numberOfRegisters()

int UnboundedRegisterFile::numberOfRegisters ( ) const
virtual

Returns INT_MAX.

UnboundedRegisterFile has "unlimited" amount of registers.

Returns
INT_MAX.

Reimplemented from TTAMachine::BaseRegisterFile.

Definition at line 69 of file UnboundedRegisterFile.cc.

69  {
70  return INT_MAX;
71 }

◆ setMaxReads()

void UnboundedRegisterFile::setMaxReads ( int  reads)
virtual

Aborts the program. It is not allowed to call this method of UnboundedRegisterFile. DO NOT CALL THIS METHOD!

Parameters
readsNever used.
Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 82 of file UnboundedRegisterFile.cc.

82  {
83  const string procName = "UnboundedRegisterFile::setMaxReads";
84  const string errorMsg =
85  "Tried to set max reads of UnboundedRegisterFile!";
86  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
88 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setMaxWrites()

void UnboundedRegisterFile::setMaxWrites ( int  maxWrites)
virtual

Aborts the program. It is not allowed to call this method of UnboundedRegisterFile. DO NOT CALL THIS METHOD!

Parameters
maxWritesNever used.
Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 98 of file UnboundedRegisterFile.cc.

98  {
99  const string procName = "UnboundedRegisterFile::setMaxWrites";
100  const string errorMsg = "Tries to set maxWrites of UnboundedRegisterFile!";
101  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
103 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setName()

void UnboundedRegisterFile::setName ( const std::string &  name)
virtual

Aborts the program. It is not allowed to change the name of UnboundedRegisterFile once it is set at construction. DO NOT CALL THIS METHOD!

Parameters
nameNever used.
Exceptions
ComponentAlreadyExistsNever thrown.
InvalidNameNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 149 of file UnboundedRegisterFile.cc.

149  {
150  const string procName = "UnboundedRegisterFile::setName";
151  const string errorMsg =
152  "Tried to set the name of UnboundedRegisterFile!";
153  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
155 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setNumberOfRegisters()

void UnboundedRegisterFile::setNumberOfRegisters ( int  registers)
virtual

Aborts the program. It is not allowed to set the number of registers of UnboundedRegisterFile. It has always unlimited amount of registers. DO NOT CALL THIS METHOD.

Parameters
registersNever used.
Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 114 of file UnboundedRegisterFile.cc.

114  {
115  const string procName = "UnboundedRegisterFile::setNumberOfRegisters";
116  const string errorMsg =
117  "Tried to set the number of registers of UnboundedRegisterFile!";
118  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
120 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setType()

void UnboundedRegisterFile::setType ( RegisterFile::Type  type)
virtual

Aborts the program. It is not allowed to set the type of UnboundedRegisterFile once it is set at construction. DO NOT CALL THIS METHOD!

Parameters
typeNever used.

Definition at line 165 of file UnboundedRegisterFile.cc.

165  {
166  const string procName = "UnboundedRegisterFile::setType";
167  const string errorMsg = "Tried to the type of UnboundedRegisterFile!";
168  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
170 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

◆ setWidth()

void UnboundedRegisterFile::setWidth ( int  width)
virtual

Aborts the program. It is not allowed to set the bit width of UnboundedRegisterFile once it is set at construction. DO NOT CALL THIS METHOD.

Parameters
widthNever used.
Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::BaseRegisterFile.

Definition at line 131 of file UnboundedRegisterFile.cc.

131  {
132  const string procName = "UnboundedRegisterFile::setWidth";
133  const string errorMsg =
134  "Tried to set the bit width of UnboundedRegisterFile!";
135  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
137 }

References Application::abortProgram(), and Application::writeToErrorLog().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
Application::writeToErrorLog
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
Definition: Application.cc:224
TTAMachine::RegisterFile::RegisterFile
RegisterFile(const std::string &name, unsigned int size, unsigned int width, unsigned int maxReads, unsigned int maxwrites, unsigned int guardLatency, Type type, bool zeroRegister=false)
Definition: RegisterFile.cc:74
Application::abortProgram
static void abortProgram() __attribute__((noreturn))
Definition: Application.cc:266
TTAMachine::BaseRegisterFile::width
virtual int width() const
TTAMachine::RegisterFile::type
virtual RegisterFile::Type type() const
Definition: RegisterFile.cc:147