Go to the documentation of this file.
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)
83 zeroRegister_(zeroRegister) {
105 zeroRegister_(
false) {
204 if (
machine()->registerFileNavigator().hasItem(
name)) {
205 string procName =
"RegisterFile::setName";
229 std::string procName =
"RegisterFile::setMaxReads";
230 throw OutOfRange(__FILE__, __LINE__, procName);
249 std::string procName =
"RegisterFile::setMaxWrites";
250 throw OutOfRange(__FILE__, __LINE__, procName);
269 bool changed =
false;
434 const string procName =
"RegisterFile::loadState";
450 const string procName =
"RegisterFile::loadStateWithoutReferences";
466 const string errorMsg =
"Unknown register file type in "
467 "ObjectState instance.";
469 __FILE__, __LINE__, procName, errorMsg);
501 for (
int busIndex = 0; busIndex < navi.
count(); busIndex++) {
502 Bus* bus = navi.
item(busIndex);
506 while (guardIndex < bus->guardCount()) {
510 if (regGuard != NULL && regGuard->
registerFile() ==
this &&
576 for (
int busIndex = 0; busIndex < navi.
count(); busIndex++) {
577 Bus* bus = navi.
item(busIndex);
581 while (guardIndex < bus->guardCount()) {
585 if (regGuard != NULL && regGuard->
registerFile() ==
this) {
Port * firstReadPort() const
virtual void setMaxWrites(int maxWrites)
bool hasAttribute(const std::string &name) const
virtual void setName(const std::string &name)
virtual Socket * inputSocket() const
virtual TCEString name() const
std::string stringAttribute(const std::string &name) const
virtual bool isReserved() const
virtual bool isRegistered() const
@ RESERVED
Used for custom, user controlled register allocation.
int registerIndex() const
static const std::string OSKEY_GUARD_LATENCY
ObjectState attribute key for the guard latency.
Type type_
Type of the register file.
static const std::string OSKEY_TYPE
ObjectState attribute key for register file type.
virtual void loadState(const ObjectState *state)
virtual void unsetMachine()
virtual void setType(RegisterFile::Type type)
static const std::string OSVALUE_RESERVED
ObjectState attribute value for reserved register file type.
void setName(const std::string &name)
virtual RegisterFile * copy() const
virtual int maxWrites() const
void loadStateWithoutReferences(const ObjectState *state)
virtual int numberOfRegisters() const
void setGlobalGuardLatency(int latency)
virtual void loadState(const ObjectState *state)
bool updateMaxReadsAndWrites() const
virtual ObjectState * saveState() const
#define assert(condition)
virtual void setGuardLatency(int latency)
Port * firstWritePort() const
@ VOLATILE
Used for user-controlled I/O communication.
virtual ControlUnit * controlUnit() const
virtual int maxReads() const
virtual bool isNormal() const
static const std::string OSKEY_MAX_READS
ObjectState attribute key for maximum simultaneous readers.
virtual void setMaxReads(int maxReads)
static const std::string OSKEY_ZERO_REGISTER
ObjectState attribute key for zero register flag.
virtual void removeRegisterFile(RegisterFile &unit)
static const std::string OSNAME_REGISTER_FILE
ObjectState name for RegisterFile.
virtual bool isArchitectureEqual(const RegisterFile &rf) const
virtual bool isOutput() const
Guard * guard(int index) const
virtual int portCount() const
std::string errorMessage() const
virtual void setNumberOfRegisters(int registers)
virtual RFPort * port(const std::string &name) const
virtual ObjectState * saveState() const
void deleteGuards(int registers) const
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)
virtual bool isUsedAsGuard() const
find Finds info of the inner loops in the false
virtual Machine * machine() const
virtual void setZeroRegister(const bool &value)
bool boolAttribute(const std::string &name) const
virtual BusNavigator busNavigator() const
virtual Socket * outputSocket() const
@ NORMAL
Used for general register allocation.
virtual bool isInput() const
int intAttribute(const std::string &name) const
static const std::string OSVALUE_NORMAL
ObjectState attribute value for normal register file type.
ComponentType * item(int index) const
Type
Type of the register file indicates how the RF is used.
virtual int guardLatency() const
int maxReads_
Max number of ports that can read a register all in the same cycle.
int globalGuardLatency() const
static const std::string OSVALUE_VOLATILE
ObjectState attribute value for volatile register file type.
virtual bool isVolatile() const
virtual int width() const
const RegisterFile * registerFile() const
virtual RegisterFile::Type type() const
virtual void unsetMachine()
static const std::string OSKEY_MAX_WRITES
ObjectState attribute key for maximum simultaneous writers.
int maxWrites_
Max number of ports that can read a register all in the same cycle.
virtual void setNumberOfRegisters(int registers)
void setAttribute(const std::string &name, const std::string &value)
virtual bool zeroRegister() const
virtual void setName(const std::string &name)
int guardLatency_
The guard latency of the register file.