OpenASIP  2.0
RegisterFile.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file RegisterFile.cc
26  *
27  * Implementation of RegisterFile class.
28  *
29  * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30  * @note reviewed 17 Jun 2004 by jn, pj, jm, ll
31  * @note rating: red
32  */
33 
34 #include "RegisterFile.hh"
35 #include "Machine.hh"
36 #include "Port.hh"
37 #include "Guard.hh"
38 #include "ControlUnit.hh"
39 #include "MOMTextGenerator.hh"
40 #include "Application.hh"
41 #include "ObjectState.hh"
42 
43 using std::string;
44 using boost::format;
45 
46 namespace TTAMachine {
47 
48 // initialization of static data members
49 const string RegisterFile::OSNAME_REGISTER_FILE = "reg_file";
50 const string RegisterFile::OSKEY_TYPE = "type";
51 const string RegisterFile::OSVALUE_NORMAL = "normal";
52 const string RegisterFile::OSVALUE_RESERVED = "reserved";
53 const string RegisterFile::OSVALUE_VOLATILE = "volatile";
54 const string RegisterFile::OSKEY_MAX_READS = "max_r";
55 const string RegisterFile::OSKEY_MAX_WRITES = "max_w";
56 const string RegisterFile::OSKEY_GUARD_LATENCY = "g_latency";
57 const string RegisterFile::OSKEY_ZERO_REGISTER = "zero_register";
58 
59 /**
60  * Constructor.
61  *
62  * @param name Name of the register file.
63  * @param size Number of registers in the register file.
64  * @param width Bit width of the registers in the register file.
65  * @param maxReads Maximum simultaneous reads of a register.
66  * @param maxWrites Maximum simultaneous writes of a register.
67  * @param maxRw Maximum simultaneous reads of a register in the same cycle
68  * the register is written.
69  * @param type Type of the register file, see RegisterFile::Type.
70  * @exception OutOfRange If some of the given parameters has an illegal
71  * value.
72  * @exception InvalidName If the given name is not a valid component name.
73  */
75  const std::string& name, unsigned int size, unsigned int width,
76  unsigned int maxReads, unsigned int maxWrites, unsigned int guardLatency,
77  Type type, bool zeroRegister)
78  : BaseRegisterFile(name, size, width),
79  maxReads_(0),
80  maxWrites_(0),
81  guardLatency_(0),
82  type_(type),
83  zeroRegister_(zeroRegister) {
87 }
88 
89 /**
90  * Constructor.
91  *
92  * Loads the state of the register file from the given ObjectState instance.
93  * Does not load references to other components.
94  *
95  * @param state The ObjectState from which the name is taken.
96  * @exception ObjectStateLoadingException If the given ObjectState tree is
97  * invalid.
98  */
100  : BaseRegisterFile(state),
101  maxReads_(0),
102  maxWrites_(0),
103  guardLatency_(0),
104  type_(NORMAL),
105  zeroRegister_(false) {
107 }
108 
109 /**
110  * Destructor.
111  */
113  unsetMachine();
114 }
115 
116 
117 /**
118  * Returns the number of ports that can read a register all in same cycle.
119  *
120  * @return The number of ports that can read a register all in same cycle.
121  */
122 int
125  return maxReads_;
126 }
127 
128 
129 /**
130  * Returns the number of ports that can write a register all in same cycle.
131  *
132  * @return The number of ports that can write a register all in same cycle.
133  */
134 int
137  return maxWrites_;
138 }
139 
140 
141 /**
142  * Returns the type of the register file.
143  *
144  * @return Type of the register file.
145  */
148  return type_;
149 }
150 
151 
152 /**
153  * Returns true if the type of the register file is normal, otherwise false.
154  *
155  * @return True if the type of the register file is normal, otherwise false.
156  */
157 bool
159  return (type_ == NORMAL);
160 }
161 
162 
163 /**
164  * Returns true if the type of the register file is volatile,
165  * otherwise false.
166  *
167  * @return True if the type of the register file is volatile,
168  * otherwise false.
169  */
170 bool
172  return (type_ == VOLATILE);
173 }
174 
175 
176 /**
177  * Returns true if the type of the register file is reserved,
178  * otherwise false.
179  *
180  * @return True if the type of the register file is reserved,
181  * otherwise false.
182  */
183 bool
185  return (type_ == RESERVED);
186 }
187 
188 
189 /**
190  * Sets the name of the register file.
191  *
192  * @param name Name of the register file.
193  * @exception ComponentAlreadyExists If a register file with the given name
194  * is already in the same machine.
195  * @exception InvalidName If the given name is not a valid component name.
196  */
197 void
198 RegisterFile::setName(const std::string& name) {
199  if (name == this->name()) {
200  return;
201  }
202 
203  if (machine() != NULL) {
204  if (machine()->registerFileNavigator().hasItem(name)) {
205  string procName = "RegisterFile::setName";
206  throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
207  } else {
209  }
210  } else {
212  }
213 }
214 
215 /**
216  * Sets the maximum number of ports that can read a register all in the same
217  * cycle. Note that this function is only needed if all of the ports are
218  * unconnected, otherwise this value is computed automatically.
219  *
220  * The given value must be at least zero.
221  *
222  * @param reads Maximum number of ports.
223  * @exception OutOfRange If the given number of maximum reads is out of
224  * range.
225  */
226 void
228  if (reads < 0) {
229  std::string procName = "RegisterFile::setMaxReads";
230  throw OutOfRange(__FILE__, __LINE__, procName);
231  }
232  maxReads_ = reads;
233 }
234 
235 /**
236  * Sets the maximum number of ports that can write a register all in the same
237  * cycle. Note that this function is only needed if all of the ports are
238  * unconnected, otherwise this value is computed automatically.
239  *
240  * The given value must be at least zero.
241  *
242  * @param writes Maximum number of ports.
243  * @exception OutOfRange If the given number of maximum writes is out of
244  * range.
245  */
246 void
248  if (maxWrites < 0) {
249  std::string procName = "RegisterFile::setMaxWrites";
250  throw OutOfRange(__FILE__, __LINE__, procName);
251  }
253 }
254 
255 /**
256  * Updates RFs max reads/writes according in/output ports.
257  *
258  * Port that is not assigned to a socket is considered to be a dead port,
259  * thus not counted towards the maximum number of reads or writes.
260  *
261  * @return True if max reads/writes changed
262  * @exception OutOfRange If setMaxReads/setMaxWrites throws outOfRange
263  * exception.
264  */
265 bool
267  int reads = 0;
268  int writes = 0;
269  bool changed = false;
270 
271  for (int p = 0; p < portCount(); ++p) {
272  if (!port(p)->isOutput() && !port(p)->isInput()) {
273 
274  // do not count unconnected ports
275  //++reads;
276  //++writes;
277 
278  } else {
279  if (port(p)->isOutput()) {
280  changed = true;
281  ++reads;
282  }
283  if (port(p)->isInput()) {
284  changed = true;
285  ++writes;
286  }
287  }
288  }
289 
290  if (changed)
291  {
292  maxReads_ = reads;
293  maxWrites_ = writes;
294  }
295  return changed;
296 }
297 
298 /**
299  * Sets the type of the register file.
300  *
301  * @param type Type of the register file.
302  */
303 void
305  type_ = type;
306 }
307 
308 
309 /**
310  * Sets the number of registers in the register file.
311  *
312  * If the number of registers decreases, deletes the register guards that
313  * were referencing to the registers that are removed.
314  *
315  * @param registers The new amount of registers.
316  * @exception OutOfRange If the given number of registers is less or equal
317  * to zero.
318  */
319 void
321  if (registers < numberOfRegisters()) {
322  deleteGuards(registers);
323  }
325 }
326 
327 /**
328  * Returns the guard latency.
329  *
330  * @return The guard latency.
331  */
332 int
334  return guardLatency_;
335 }
336 
337 
338 /**
339  * Sets the guard latency.
340  *
341  * @param latency The new guard latency.
342  * @exception OutOfRange If the given value is negative or if local + global
343  * guard latency would be zero.
344  */
345 void
347  if (latency < 0) {
348  throw OutOfRange(__FILE__, __LINE__, __func__);
349  }
350 
351  // check that local guard latency + global guard latency > 0
352  if (latency == 0 && isRegistered()) {
353  ControlUnit* gcu = machine()->controlUnit();
354  if (gcu != NULL) {
355  int oldLatency = guardLatency();
356  guardLatency_ = latency;
357  try {
358  // this throws OutOfRange if the local guard latency cannot
359  // be zero
361  } catch (const OutOfRange& exception) {
362  guardLatency_ = oldLatency;
363  throw exception;
364  }
365  }
366  }
367 
368  guardLatency_ = latency;
369 }
370 
371 /**
372  * Removes the register file from machine.
373  */
374 void
376  Machine* mach = machine();
377  if (mach == NULL) {
378  return;
379  }
380  deleteGuards(0);
382  mach->removeRegisterFile(*this);
383 }
384 
385 
386 /**
387  * Saves the contents to an ObjectState tree.
388  *
389  * @return The newly created ObjectState tree.
390  */
393 
395  regFile->setName(OSNAME_REGISTER_FILE);
396 
397  // set type
398  switch(type_) {
399  case NORMAL: regFile->setAttribute(OSKEY_TYPE, OSVALUE_NORMAL); break;
401  break;
403  break;
404  default: assert(false);
405  }
406 
407  // set max reads
409 
410  // set max writes
412 
413  // set guard latency
415 
416  // set zero register
417  if (zeroRegister_) {
419  }
420 
421  return regFile;
422 }
423 
424 
425 /**
426  * Loads its state from the given ObjectState instance.
427  *
428  * @param state The ObjectState instance.
429  * @exception ObjectStateLoadingException If the given ObjectState instance
430  * is invalid.
431  */
432 void
434  const string procName = "RegisterFile::loadState";
437  MOMTextGenerator textGenerator;
438 }
439 
440 /**
441  * Loads the state of the register file without references to other
442  * components.
443  *
444  * @param state The ObjectState instance from which the state is loaded.
445  * @exception ObjectStateLoadingException If the given ObjectState instance
446  * is invalid.
447  */
448 void
450  const string procName = "RegisterFile::loadStateWithoutReferences";
451 
452  if (! (state->name() == OSNAME_REGISTER_FILE ||
454  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
455  }
456 
457  try {
458  string type = state->stringAttribute(OSKEY_TYPE);
459  if (type == OSVALUE_NORMAL) {
460  setType(NORMAL);
461  } else if (type == OSVALUE_RESERVED) {
462  setType(RESERVED);
463  } else if (type == OSVALUE_VOLATILE) {
464  setType(VOLATILE);
465  } else {
466  const string errorMsg = "Unknown register file type in "
467  "ObjectState instance.";
469  __FILE__, __LINE__, procName, errorMsg);
470  }
471 
475  if (state->hasAttribute(OSKEY_ZERO_REGISTER)) {
477  }
478 
479  } catch (const Exception& e) {
481  __FILE__, __LINE__, procName, e.errorMessage());
482  }
483 }
484 
485 /**
486  * Deletes the guards that refer to registers would not exist if there were
487  * the given number of registers in this register file.
488  *
489  * @param registers The number of registers.
490  */
491 void
492 RegisterFile::deleteGuards(int registers) const {
493 
494  Machine* mach = machine();
495  if (mach == NULL) {
496  return;
497  }
498 
499  // for each bus
500  Machine::BusNavigator navi = mach->busNavigator();
501  for (int busIndex = 0; busIndex < navi.count(); busIndex++) {
502  Bus* bus = navi.item(busIndex);
503  int guardIndex = 0;
504 
505  // delete register guards that refer to non-existing registers
506  while (guardIndex < bus->guardCount()) {
507  Guard* guard = bus->guard(guardIndex);
508  RegisterGuard* regGuard =
509  dynamic_cast<RegisterGuard*>(guard);
510  if (regGuard != NULL && regGuard->registerFile() == this &&
511  regGuard->registerIndex() >= registers) {
512 
513  // guard is removed from bus automatically
514  delete regGuard;
515  } else {
516  guardIndex++;
517  }
518  }
519  }
520 }
521 
522 /**
523  * Checks is this register file architecture equal with the given register file.
524  *
525  * Architecture equality means that register files have same values, names and
526  * port names may differ.
527  *
528  * @param rf Register file to compare with.
529  * @return True if the register files are architecture equal.
530  */
531 bool
533 
534  if (size() != rf.size()) {
535  return false;
536  }
537  if (width() != rf.width()) {
538  return false;
539  }
540  if (maxReads_ != rf.maxReads()) {
541  return false;
542  }
543  if (maxWrites_ != rf.maxWrites()) {
544  return false;
545  }
546  if (type_ != rf.type()) {
547  return false;
548  }
549  if (guardLatency_ != rf.guardLatency()) {
550  return false;
551  }
552  if (portCount() != rf.portCount()) {
553  return false;
554  }
555  // ports have same width that the register file, so port widths are not
556  // needed to check
557 
558  return true;
559 }
560 
561 /**
562  * Returns true if the register file is used as a guard.
563  *
564  * @return True if the register file is used as a guard.
565  */
566 bool
568 
569  Machine* mach = machine();
570  if (mach == NULL) {
571  return false;
572  }
573 
574  // for each bus
575  Machine::BusNavigator navi = mach->busNavigator();
576  for (int busIndex = 0; busIndex < navi.count(); busIndex++) {
577  Bus* bus = navi.item(busIndex);
578  int guardIndex = 0;
579 
580  // check if there are register guards that refer to this register file
581  while (guardIndex < bus->guardCount()) {
582  Guard* guard = bus->guard(guardIndex);
583  RegisterGuard* regGuard =
584  dynamic_cast<RegisterGuard*>(guard);
585  if (regGuard != NULL && regGuard->registerFile() == this) {
586  return true;
587  } else {
588  guardIndex++;
589  }
590  }
591  }
592  return false;
593 }
594 
595 /**
596  * Creates and returns a copy of the register file.
597  *
598  * @return Copy of register file.
599  */
602 
603  return new RegisterFile(saveState());
604 }
605 
606 Port*
608  for (int i = 0; i < portCount(); i++) {
609  Port* p = port(i);
610  if (p->outputSocket() != NULL) {
611  return p;
612  }
613  }
614  return NULL;
615 }
616 
617 Port*
619  for (int i = 0; i < portCount(); i++) {
620  Port* p = port(i);
621  if (p->inputSocket() != NULL) {
622  return p;
623  }
624  }
625  return NULL;
626 }
627 
628 bool
630  return zeroRegister_;
631 }
632 
633 void
634 RegisterFile::setZeroRegister(const bool& value) {
635  zeroRegister_ = value;
636 }
637 }
TTAMachine::RegisterFile::firstReadPort
Port * firstReadPort() const
Definition: RegisterFile.cc:607
TTAMachine::Guard
Definition: Guard.hh:55
TTAMachine::RegisterFile::setMaxWrites
virtual void setMaxWrites(int maxWrites)
Definition: RegisterFile.cc:247
ObjectState::hasAttribute
bool hasAttribute(const std::string &name) const
Definition: ObjectState.cc:205
TTAMachine::Component::setName
virtual void setName(const std::string &name)
Definition: MachinePart.cc:142
TTAMachine::Port::inputSocket
virtual Socket * inputSocket() const
Definition: Port.cc:261
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
TTAMachine::RegisterFile::isReserved
virtual bool isReserved() const
Definition: RegisterFile.cc:184
TTAMachine::Component::isRegistered
virtual bool isRegistered() const
Definition: MachinePart.cc:177
TTAMachine::RegisterFile::RESERVED
@ RESERVED
Used for custom, user controlled register allocation.
Definition: RegisterFile.hh:52
TTAMachine::RegisterGuard::registerIndex
int registerIndex() const
ObjectStateLoadingException
Definition: Exception.hh:551
TTAMachine::RegisterFile::OSKEY_GUARD_LATENCY
static const std::string OSKEY_GUARD_LATENCY
ObjectState attribute key for the guard latency.
Definition: RegisterFile.hh:108
OutOfRange
Definition: Exception.hh:320
TTAMachine::Bus
Definition: Bus.hh:53
TTAMachine::RegisterFile::type_
Type type_
Type of the register file.
Definition: RegisterFile.hh:136
TTAMachine::RegisterFile::OSKEY_TYPE
static const std::string OSKEY_TYPE
ObjectState attribute key for register file type.
Definition: RegisterFile.hh:96
TTAMachine::BaseRegisterFile::loadState
virtual void loadState(const ObjectState *state)
Definition: BaseRegisterFile.cc:176
TTAMachine::RegisterFile::unsetMachine
virtual void unsetMachine()
Definition: RegisterFile.cc:375
ObjectState
Definition: ObjectState.hh:59
TTAMachine::RegisterFile::setType
virtual void setType(RegisterFile::Type type)
Definition: RegisterFile.cc:304
TTAMachine::RegisterFile::OSVALUE_RESERVED
static const std::string OSVALUE_RESERVED
ObjectState attribute value for reserved register file type.
Definition: RegisterFile.hh:100
TTAMachine::Machine::Navigator::count
int count() const
ObjectState::setName
void setName(const std::string &name)
TTAMachine::RegisterFile::copy
virtual RegisterFile * copy() const
Definition: RegisterFile.cc:601
TTAMachine::RegisterFile::maxWrites
virtual int maxWrites() const
Definition: RegisterFile.cc:135
TTAMachine::RegisterFile::loadStateWithoutReferences
void loadStateWithoutReferences(const ObjectState *state)
Definition: RegisterFile.cc:449
TTAMachine::BaseRegisterFile::numberOfRegisters
virtual int numberOfRegisters() const
TTAMachine::ControlUnit::setGlobalGuardLatency
void setGlobalGuardLatency(int latency)
Definition: ControlUnit.cc:159
TTAMachine::RegisterFile::loadState
virtual void loadState(const ObjectState *state)
Definition: RegisterFile.cc:433
TTAMachine::RegisterFile::updateMaxReadsAndWrites
bool updateMaxReadsAndWrites() const
Definition: RegisterFile.cc:266
TTAMachine::RegisterFile::saveState
virtual ObjectState * saveState() const
Definition: RegisterFile.cc:392
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::RegisterFile::setGuardLatency
virtual void setGuardLatency(int latency)
Definition: RegisterFile.cc:346
Port.hh
TTAMachine::BaseRegisterFile
Definition: BaseRegisterFile.hh:48
TTAMachine::RegisterFile::firstWritePort
Port * firstWritePort() const
Definition: RegisterFile.cc:618
TTAMachine::RegisterFile::VOLATILE
@ VOLATILE
Used for user-controlled I/O communication.
Definition: RegisterFile.hh:53
TTAMachine::Machine::controlUnit
virtual ControlUnit * controlUnit() const
Definition: Machine.cc:345
TTAMachine::RegisterFile::maxReads
virtual int maxReads() const
Definition: RegisterFile.cc:123
TTAMachine::RegisterFile::isNormal
virtual bool isNormal() const
Definition: RegisterFile.cc:158
TTAMachine::RegisterFile::OSKEY_MAX_READS
static const std::string OSKEY_MAX_READS
ObjectState attribute key for maximum simultaneous readers.
Definition: RegisterFile.hh:104
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
TTAMachine::RegisterGuard
Definition: Guard.hh:137
TTAMachine::RegisterFile::setMaxReads
virtual void setMaxReads(int maxReads)
Definition: RegisterFile.cc:227
TTAMachine::Port
Definition: Port.hh:54
Application.hh
__func__
#define __func__
Definition: Application.hh:67
ObjectState.hh
TTAMachine::RegisterFile::OSKEY_ZERO_REGISTER
static const std::string OSKEY_ZERO_REGISTER
ObjectState attribute key for zero register flag.
Definition: RegisterFile.hh:110
TTAMachine::ImmediateUnit::OSNAME_IMMEDIATE_UNIT
static const std::string OSNAME_IMMEDIATE_UNIT
ObjectState name for ImmediateUnit.
Definition: ImmediateUnit.hh:75
Guard.hh
TTAMachine::RegisterFile::~RegisterFile
virtual ~RegisterFile()
Definition: RegisterFile.cc:112
TTAMachine::Machine::removeRegisterFile
virtual void removeRegisterFile(RegisterFile &unit)
Definition: Machine.cc:554
NORMAL
@ NORMAL
Definition: tceopgen.cc:45
Machine.hh
TTAMachine::RegisterFile::OSNAME_REGISTER_FILE
static const std::string OSNAME_REGISTER_FILE
ObjectState name for RegisterFile.
Definition: RegisterFile.hh:94
Exception
Definition: Exception.hh:54
TTAMachine::RegisterFile::isArchitectureEqual
virtual bool isArchitectureEqual(const RegisterFile &rf) const
Definition: RegisterFile.cc:532
ObjectState::name
std::string name() const
TTAMachine::Port::isOutput
virtual bool isOutput() const
Definition: Port.cc:308
TTAMachine::RegisterFile::zeroRegister_
bool zeroRegister_
Definition: RegisterFile.hh:138
TTAMachine::Bus::guard
Guard * guard(int index) const
Definition: Bus.cc:456
TTAMachine::Unit::portCount
virtual int portCount() const
Definition: Unit.cc:135
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
TTAMachine::BaseRegisterFile::setNumberOfRegisters
virtual void setNumberOfRegisters(int registers)
Definition: BaseRegisterFile.cc:96
TTAMachine::BaseRegisterFile::port
virtual RFPort * port(const std::string &name) const
Definition: BaseRegisterFile.cc:129
TTAMachine::BaseRegisterFile::saveState
virtual ObjectState * saveState() const
Definition: BaseRegisterFile.cc:159
TTAMachine::RegisterFile::deleteGuards
void deleteGuards(int registers) const
Definition: RegisterFile.cc:492
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::isUsedAsGuard
virtual bool isUsedAsGuard() const
Definition: RegisterFile.cc:567
false
find Finds info of the inner loops in the false
Definition: InnerLoopFinder.cc:81
TTAMachine::Component::machine
virtual Machine * machine() const
RegisterFile.hh
MOMTextGenerator
Definition: MOMTextGenerator.hh:40
TTAMachine::RegisterFile::setZeroRegister
virtual void setZeroRegister(const bool &value)
Definition: RegisterFile.cc:634
ObjectState::boolAttribute
bool boolAttribute(const std::string &name) const
Definition: ObjectState.cc:338
ControlUnit.hh
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
TTAMachine::Port::outputSocket
virtual Socket * outputSocket() const
Definition: Port.cc:281
TTAMachine::RegisterFile::NORMAL
@ NORMAL
Used for general register allocation.
Definition: RegisterFile.hh:51
ComponentAlreadyExists
Definition: Exception.hh:510
TTAMachine::Port::isInput
virtual bool isInput() const
Definition: Port.cc:298
MOMTextGenerator.hh
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
TTAMachine::RegisterFile::OSVALUE_NORMAL
static const std::string OSVALUE_NORMAL
ObjectState attribute value for normal register file type.
Definition: RegisterFile.hh:98
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
TTAMachine::RegisterFile::Type
Type
Type of the register file indicates how the RF is used.
Definition: RegisterFile.hh:50
TTAMachine::RegisterFile::guardLatency
virtual int guardLatency() const
Definition: RegisterFile.cc:333
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAMachine::RegisterFile::maxReads_
int maxReads_
Max number of ports that can read a register all in the same cycle.
Definition: RegisterFile.hh:129
TTAMachine
Definition: Assembler.hh:48
TTAMachine::ControlUnit::globalGuardLatency
int globalGuardLatency() const
TTAMachine::BaseRegisterFile::size
virtual int size() const
TTAMachine::RegisterFile::OSVALUE_VOLATILE
static const std::string OSVALUE_VOLATILE
ObjectState attribute value for volatile register file type.
Definition: RegisterFile.hh:102
TTAMachine::RegisterFile::isVolatile
virtual bool isVolatile() const
Definition: RegisterFile.cc:171
TTAMachine::BaseRegisterFile::width
virtual int width() const
TTAMachine::RegisterGuard::registerFile
const RegisterFile * registerFile() const
TTAMachine::RegisterFile::type
virtual RegisterFile::Type type() const
Definition: RegisterFile.cc:147
TTAMachine::Unit::unsetMachine
virtual void unsetMachine()
Definition: Unit.cc:262
TTAMachine::RegisterFile::OSKEY_MAX_WRITES
static const std::string OSKEY_MAX_WRITES
ObjectState attribute key for maximum simultaneous writers.
Definition: RegisterFile.hh:106
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::RegisterFile::maxWrites_
int maxWrites_
Max number of ports that can read a register all in the same cycle.
Definition: RegisterFile.hh:131
TTAMachine::RegisterFile::setNumberOfRegisters
virtual void setNumberOfRegisters(int registers)
Definition: RegisterFile.cc:320
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
TTAMachine::RegisterFile::zeroRegister
virtual bool zeroRegister() const
Definition: RegisterFile.cc:629
TTAMachine::RegisterFile::setName
virtual void setName(const std::string &name)
Definition: RegisterFile.cc:198
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::RegisterFile::guardLatency_
int guardLatency_
The guard latency of the register file.
Definition: RegisterFile.hh:133