OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes | List of all members
TTAMachine::NullRegisterFile Class Reference

#include <NullRegisterFile.hh>

Inheritance diagram for TTAMachine::NullRegisterFile:
Inheritance graph
Collaboration diagram for TTAMachine::NullRegisterFile:
Collaboration graph

Public Member Functions

virtual Machinemachine () const
 
virtual void ensureRegistration (const Component &component) const
 
virtual bool isRegistered () const
 
virtual bool hasPort (const std::string &name) const
 
virtual int portCount () const
 
virtual void setMachine (Machine &mach)
 
virtual void unsetMachine ()
 
virtual int numberOfRegisters () const
 
virtual int width () const
 
virtual void setNumberOfRegisters (int registers)
 
virtual void setWidth (int width)
 
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 TCEString name () const
 
virtual void setName (const std::string &name)
 
virtual void setMaxReads (int reads)
 
virtual void setMaxWrites (int maxWrites)
 
virtual void setType (RegisterFile::Type type)
 
virtual int guardLatency () const
 
virtual void setGuardLatency (int latency)
 
virtual ObjectStatesaveState () const
 
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 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 size () const
 
virtual RFPortport (const std::string &name) const
 
virtual RFPortport (int index) const
 
- Public Member Functions inherited from TTAMachine::Unit
virtual ~Unit ()
 
virtual int outputPortCount (bool countBidir=false) const
 
virtual int inputPortCount (bool countBidir=false) const
 
virtual int bidirPortCount () const
 
- Public Member Functions inherited from TTAMachine::Component
virtual ~Component ()
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Member Functions

static NullRegisterFileinstance ()
 

Private Member Functions

 NullRegisterFile ()
 
virtual ~NullRegisterFile ()
 

Static Private Attributes

static NullRegisterFile instance_
 The only instance. More...
 

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

Null version of RegisterFile class. This is a singleton class.

Definition at line 43 of file NullRegisterFile.hh.

Constructor & Destructor Documentation

◆ NullRegisterFile()

TTAMachine::NullRegisterFile::NullRegisterFile ( )
private

The constructor.

Definition at line 42 of file NullRegisterFile.cc.

42  :
43  RegisterFile("NULL", 1, 1, 1, 1, 0, RegisterFile::NORMAL) {
44 }

◆ ~NullRegisterFile()

TTAMachine::NullRegisterFile::~NullRegisterFile ( )
privatevirtual

The destructor.

Definition at line 50 of file NullRegisterFile.cc.

50  {
51 }

Member Function Documentation

◆ ensureRegistration()

void TTAMachine::NullRegisterFile::ensureRegistration ( const Component component) const
virtual

Aborts the program with error message.

Exceptions
IllegalRegistrationNever thrown.

Reimplemented from TTAMachine::Component.

Definition at line 81 of file NullRegisterFile.cc.

81  {
82  abortWithError("ensureRegistration()");
83 }

References abortWithError.

◆ guardLatency()

int TTAMachine::NullRegisterFile::guardLatency ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 314 of file NullRegisterFile.cc.

314  {
315  abortWithError("guardLatency()");
316  return 0;
317 }

References abortWithError.

◆ hasPort()

bool TTAMachine::NullRegisterFile::hasPort ( const std::string &  name) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Unit.

Definition at line 103 of file NullRegisterFile.cc.

103  {
104  abortWithError("hasPort()");
105  return false;
106 }

References abortWithError.

◆ instance()

NullRegisterFile & TTAMachine::NullRegisterFile::instance ( )
static

Returns the only instance of NullRegisterFile.

Definition at line 58 of file NullRegisterFile.cc.

58  {
59  return instance_;
60 }

References instance_.

◆ isNormal()

bool TTAMachine::NullRegisterFile::isNormal ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 226 of file NullRegisterFile.cc.

226  {
227  abortWithError("isNormal()");
228  return false;
229 }

References abortWithError.

◆ isRegistered()

bool TTAMachine::NullRegisterFile::isRegistered ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 91 of file NullRegisterFile.cc.

91  {
92  abortWithError("isRegistered()");
93  return false;
94 }

References abortWithError.

◆ isReserved()

bool TTAMachine::NullRegisterFile::isReserved ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 250 of file NullRegisterFile.cc.

250  {
251  abortWithError("isReserved()");
252  return false;
253 }

References abortWithError.

◆ isVolatile()

bool TTAMachine::NullRegisterFile::isVolatile ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 238 of file NullRegisterFile.cc.

238  {
239  abortWithError("isVolatile()");
240  return false;
241 }

References abortWithError.

◆ loadState()

void TTAMachine::NullRegisterFile::loadState ( const ObjectState state)
virtual

Aborts the program with error message.

Exceptions
ObjectStateLoadingExceptionNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 348 of file NullRegisterFile.cc.

348  {
349  abortWithError("loadState()");
350 }

References abortWithError.

◆ machine()

Machine * TTAMachine::NullRegisterFile::machine ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 69 of file NullRegisterFile.cc.

69  {
70  abortWithError("machine()");
71  return NULL;
72 }

References abortWithError.

◆ maxReads()

int TTAMachine::NullRegisterFile::maxReads ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 190 of file NullRegisterFile.cc.

190  {
191  abortWithError("maxReads()");
192  return 0;
193 }

References abortWithError.

◆ maxWrites()

int TTAMachine::NullRegisterFile::maxWrites ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 202 of file NullRegisterFile.cc.

202  {
203  abortWithError("maxWrites()");
204  return 0;
205 }

References abortWithError.

◆ name()

TCEString TTAMachine::NullRegisterFile::name ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Component.

Definition at line 262 of file NullRegisterFile.cc.

262  {
263  abortWithError("name()");
264  return "";
265 }

References abortWithError.

◆ numberOfRegisters()

int TTAMachine::NullRegisterFile::numberOfRegisters ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::BaseRegisterFile.

Definition at line 146 of file NullRegisterFile.cc.

146  {
147  abortWithError("numberOfRegisters()");
148  return 0;
149 }

References abortWithError.

◆ portCount()

int TTAMachine::NullRegisterFile::portCount ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::Unit.

Definition at line 115 of file NullRegisterFile.cc.

115  {
116  abortWithError("portCount()");
117  return 0;
118 }

References abortWithError.

◆ saveState()

ObjectState * TTAMachine::NullRegisterFile::saveState ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 336 of file NullRegisterFile.cc.

336  {
337  abortWithError("saveState()");
338  return NULL;
339 }

References abortWithError.

◆ setGuardLatency()

void TTAMachine::NullRegisterFile::setGuardLatency ( int  latency)
virtual

Aborts the program with error message.

Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 326 of file NullRegisterFile.cc.

326  {
327  abortWithError("setGuardLatency()");
328 }

References abortWithError.

◆ setMachine()

void TTAMachine::NullRegisterFile::setMachine ( Machine mach)
virtual

Aborts the program with error message.

Exceptions
ComponentAlreadyExistsNever thrown.

Reimplemented from TTAMachine::Unit.

Definition at line 127 of file NullRegisterFile.cc.

127  {
128  abortWithError("setMachine");
129 }

References abortWithError.

◆ setMaxReads()

void TTAMachine::NullRegisterFile::setMaxReads ( int  reads)
virtual

Aborts the program with error message.

Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 285 of file NullRegisterFile.cc.

285  {
286  abortWithError("setMaxReads()");
287 }

References abortWithError.

◆ setMaxWrites()

void TTAMachine::NullRegisterFile::setMaxWrites ( int  maxWrites)
virtual

Aborts the program with error message.

Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 295 of file NullRegisterFile.cc.

295  {
296  abortWithError("setMaxWrites()");
297 }

References abortWithError.

◆ setName()

void TTAMachine::NullRegisterFile::setName ( const std::string &  name)
virtual

Aborts the program with error message.

Exceptions
ComponentAlreadyExistsNever thrown.
InvalidNameNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 275 of file NullRegisterFile.cc.

275  {
276  abortWithError("setName()");
277 }

References abortWithError.

◆ setNumberOfRegisters()

void TTAMachine::NullRegisterFile::setNumberOfRegisters ( int  registers)
virtual

Aborts the program with error message.

Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 170 of file NullRegisterFile.cc.

170  {
171  abortWithError("setNumberOfRegisters()");
172 }

References abortWithError.

◆ setType()

void TTAMachine::NullRegisterFile::setType ( RegisterFile::Type  type)
virtual

Aborts the program with error message.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 303 of file NullRegisterFile.cc.

303  {
304  abortWithError("setType()");
305 }

References abortWithError.

◆ setWidth()

void TTAMachine::NullRegisterFile::setWidth ( int  width)
virtual

Aborts the program with error message.

Exceptions
OutOfRangeNever thrown.

Reimplemented from TTAMachine::BaseRegisterFile.

Definition at line 180 of file NullRegisterFile.cc.

180  {
181  abortWithError("setWidth()");
182 }

References abortWithError.

◆ type()

RegisterFile::Type TTAMachine::NullRegisterFile::type ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 214 of file NullRegisterFile.cc.

214  {
215  abortWithError("type()");
216  return RegisterFile::NORMAL;
217 }

References abortWithError, and TTAMachine::RegisterFile::NORMAL.

◆ unsetMachine()

void TTAMachine::NullRegisterFile::unsetMachine ( )
virtual

Aborts the program with error message.

Reimplemented from TTAMachine::RegisterFile.

Definition at line 135 of file NullRegisterFile.cc.

135  {
136  abortWithError("unsetMachine()");
137 }

References abortWithError.

◆ width()

int TTAMachine::NullRegisterFile::width ( ) const
virtual

Aborts the program with error message.

Returns
Never returns.

Reimplemented from TTAMachine::BaseRegisterFile.

Definition at line 158 of file NullRegisterFile.cc.

158  {
159  abortWithError("width()");
160  return 0;
161 }

References abortWithError.

Member Data Documentation

◆ instance_

NullRegisterFile TTAMachine::NullRegisterFile::instance_
staticprivate

The only instance.

Definition at line 88 of file NullRegisterFile.hh.

Referenced by instance().


The documentation for this class was generated from the following files:
abortWithError
#define abortWithError(message)
Definition: Application.hh:72
TTAMachine::NullRegisterFile::instance_
static NullRegisterFile instance_
The only instance.
Definition: NullRegisterFile.hh:88
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
TTAMachine::RegisterFile::NORMAL
@ NORMAL
Used for general register allocation.
Definition: RegisterFile.hh:51