OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TTAMachine::BaseRegisterFile Class Reference

#include <BaseRegisterFile.hh>

Inheritance diagram for TTAMachine::BaseRegisterFile:
Inheritance graph
Collaboration diagram for TTAMachine::BaseRegisterFile:
Collaboration graph

Public Member Functions

virtual ~BaseRegisterFile ()
 
virtual int numberOfRegisters () const
 
virtual int width () const
 
virtual int size () const
 
virtual void setNumberOfRegisters (int registers)
 
virtual void setWidth (int width)
 
virtual RFPortport (const std::string &name) const
 
virtual RFPortport (int index) const
 
virtual ObjectStatesaveState () const
 
virtual void loadState (const ObjectState *state)
 
- 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)
 
virtual void unsetMachine ()
 
- Public Member Functions inherited from TTAMachine::Component
virtual ~Component ()
 
virtual TCEString name () const
 
virtual void setName (const std::string &name)
 
virtual Machinemachine () const
 
virtual void ensureRegistration (const Component &component) const
 
virtual bool isRegistered () const
 
- Public Member Functions inherited from Serializable
virtual ~Serializable ()
 

Static Public Attributes

static const std::string OSNAME_BASE_REGISTER_FILE = "baseregfile"
 ObjectState name for BaseRegisterFile.
 
static const std::string OSKEY_SIZE = "size"
 ObjectState attribute key for the number of registers.
 
static const std::string OSKEY_WIDTH = "width"
 ObjectState attribute key for bit width of the registers.
 
- Static Public Attributes inherited from TTAMachine::Unit
static const std::string OSNAME_UNIT = "unit"
 ObjectState name for Unit.
 
- Static Public Attributes inherited from TTAMachine::Component
static const std::string OSNAME_COMPONENT = "component"
 ObjectState name for component.
 
static const std::string OSKEY_NAME = "name"
 ObjectState attribute key for the name of the component.
 

Protected Member Functions

 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 ()
 

Private Member Functions

void loadStateWithoutReferences (const ObjectState *state)
 

Private Attributes

int size_
 Number of registers in the register file.
 
int width_
 Bit width of the registers in the register file.
 

Detailed Description

An abstract base class for register files as ImmediateUnit and RegisterFile.

Definition at line 48 of file BaseRegisterFile.hh.

Constructor & Destructor Documentation

◆ ~BaseRegisterFile()

TTAMachine::BaseRegisterFile::~BaseRegisterFile ( )
virtual

Destructor.

Definition at line 84 of file BaseRegisterFile.cc.

84 {
85}

◆ BaseRegisterFile() [1/2]

TTAMachine::BaseRegisterFile::BaseRegisterFile ( const std::string &  name,
int  size,
int  width 
)
protected

Constructor.

Parameters
nameName of the register file.
sizeNumber of registers in the register file.
widthBit width of the registers in the register file.
Exceptions
OutOfRangeIf the given size or width is out of range.
InvalidNameIf the given name is not a valid component name.

Definition at line 60 of file BaseRegisterFile.cc.

64}
virtual void setNumberOfRegisters(int registers)
virtual int size() const
virtual int width() const
int width_
Bit width of the registers in the register file.
virtual void setWidth(int width)
int size_
Number of registers in the register file.
virtual TCEString name() const
Unit(const std::string &name)
Definition Unit.cc:59

References setNumberOfRegisters(), setWidth(), size(), and width().

Here is the call graph for this function:

◆ BaseRegisterFile() [2/2]

TTAMachine::BaseRegisterFile::BaseRegisterFile ( const ObjectState state)
protected

Constructor.

Loads the state of the object from the given ObjectState instance. Does not load references to other components.

Parameters
stateThe ObjectState instance from which the state is loaded.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Definition at line 76 of file BaseRegisterFile.cc.

77 : Unit(state), size_(0), width_(0) {
79}
void loadStateWithoutReferences(const ObjectState *state)

References loadStateWithoutReferences().

Here is the call graph for this function:

Member Function Documentation

◆ loadState()

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

Loads its the from the given ObjectState instance.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Reimplemented from TTAMachine::Unit.

Reimplemented in TTAMachine::ImmediateUnit, TTAMachine::NullRegisterFile, TTAMachine::RegisterFile, and UnboundedRegisterFile.

Definition at line 176 of file BaseRegisterFile.cc.

176 {
178 Unit::loadState(state);
179}
virtual void loadState(const ObjectState *state)
Definition Unit.cc:309

References TTAMachine::Unit::loadState(), and loadStateWithoutReferences().

Referenced by TTAMachine::RegisterFile::loadState().

Here is the call graph for this function:

◆ loadStateWithoutReferences()

void TTAMachine::BaseRegisterFile::loadStateWithoutReferences ( const ObjectState state)
private

Loads its state from the given ObjectState instance without references to other components.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Definition at line 190 of file BaseRegisterFile.cc.

190 {
191 try {
194 } catch (...) {
195 string procName = "BaseRegisterFile::loadStateWithoutReferences";
196 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
197 }
198}
int intAttribute(const std::string &name) const
static const std::string OSKEY_SIZE
ObjectState attribute key for the number of registers.
static const std::string OSKEY_WIDTH
ObjectState attribute key for bit width of the registers.

References ObjectState::intAttribute(), OSKEY_SIZE, OSKEY_WIDTH, setNumberOfRegisters(), and setWidth().

Referenced by BaseRegisterFile(), and loadState().

Here is the call graph for this function:

◆ numberOfRegisters()

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

Reimplemented in TTAMachine::NullRegisterFile, and UnboundedRegisterFile.

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), CodeCompressorPlugin::addBitsForDstRegisterField(), ProgrammabilityValidator::addConnectionToProgram(), BEMGenerator::addLongImmDstRegisterFields(), MachineStateBuilder::buildMachineState(), IUBroker::buildResources(), BEMValidator::checkLImmDstRegisterFields(), IUFactory::createEditPart(), RFFactory::createEditPart(), llvm::LLVMTCEBuilder::emitLongjmp(), llvm::LLVMTCEBuilder::emitSetjmp(), InfoProcCommand::execute(), InfoStatsCommand::execute(), findBooleanGuard(), SimulatorFrontend::findBooleanRegister(), findBooleanRegisterFile(), ProgrammabilityValidator::findConnections(), SimulatorFrontend::finishSimulation(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), ProDeIUEditPolicy::getCommand(), ProDeRFEditPolicy::getCommand(), ComponentImplementationSelector::iuImplementations(), TTAMachine::RegisterGuard::loadState(), BEMValidator::needsSocketCodeTable(), BEMGenerator::needsSocketCodeTable(), RFGuardDialog::onOK(), AddWatchDialog::onRFChoice(), RFGuardDialog::onRFChoice(), ProgrammabilityValidator::printConnection(), MachineResourceManager::registerFileIndexReference(), CompiledSimController::registerFileValue(), SimulationController::registerFileValue(), TTAMachine::RegisterGuard::RegisterGuard(), BEMGenerator::requiredIndexWidth(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), ComponentImplementationSelector::rfImplementations(), DefaultDecoderGenerator::rfOpcodeWidth(), TTAProgram::TerminalRegister::setIndex(), TTAMachine::RegisterFile::setNumberOfRegisters(), IUDialog::TransferDataToWindow(), RFGuardDialog::TransferDataToWindow(), RFDialog::updateWidgets(), and DefaultDecoderGenerator::writeInstructionTemplateProcedures().

◆ port() [1/2]

RFPort * TTAMachine::BaseRegisterFile::port ( const std::string &  name) const
virtual

Returns the requested port.

Parameters
nameName of the port.
Returns
The requested port.
Exceptions
InstanceNotFoundIf a port is not found by the given name.

Reimplemented from TTAMachine::Unit.

Definition at line 129 of file BaseRegisterFile.cc.

129 {
131 RFPort* rfPort = static_cast<RFPort*>(port);
132 return rfPort;
133}
virtual RFPort * port(const std::string &name) const
virtual Port * port(const std::string &name) const
Definition Unit.cc:116
friend class Port
Definition Unit.hh:99

References TTAMachine::Component::name(), port(), and TTAMachine::Unit::port().

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), InputPSocketBroker::allAvailableResources(), OutputPSocketBroker::allAvailableResources(), IUBroker::allAvailableResources(), TDGen::analyzeMachineRegisters(), TDGen::analyzeRegisters(), IUBroker::assign(), MachineTester::canConnect(), FullyConnectedCheck::check(), FullyConnectedCheck::check(), RFPortCheck::check(), DefaultDecoderGenerator::completeDecoderBlock(), ProGe::RV32MicroCodeGenerator::connectRF(), RegisterCopyAdder::countAndAddConnectionRegisterCopiesToRR(), IUFactory::createEditPart(), RFFactory::createEditPart(), ADFCombiner::createPortsAndSockets(), TTAProgram::TPEFProgramFactory::createTerminal(), llvm::LLVMTCEBuilder::createTerminalRegister(), TTAProgram::CodeGenerator::createTerminalRegister(), llvm::LLVMTCEBuilder::emitSPInitialization(), VLIWConnectIC::explore(), ProgrammabilityValidator::findConnections(), MachineConnectivityCheck::findPossibleSourcePorts(), DataDependenceGraphBuilder::findStaticRegisters(), TTAMachine::RegisterFile::firstReadPort(), TTAMachine::RegisterFile::firstWritePort(), FullyConnectedCheck::fix(), MachineConnectivityCheck::fromRfConnected(), MachineConnectivityCheck::immBits(), OutputPSocketBroker::isAnyResourceAvailable(), MachineConnectivityCheck::isConnected(), MachineConnectivityCheck::isConnected(), MachineAnalysis::MachineAnalysis(), BlockImplementationDialog::onHDBSelection(), port(), port(), MachineResourceManager::registerFileIndexReference(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), ComponentImplementationSelector::rfImplementations(), MachineResourceManager::rFPortOrFUIndexReference(), IUDialog::selectedPort(), RFDialog::selectedPort(), IUBroker::setupResourceLinks(), MachineConnectivityCheck::toRfConnected(), TTAMachine::RegisterFile::updateMaxReadsAndWrites(), IUDialog::updatePortList(), RFDialog::updatePortList(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeRFCntrlSignals(), DefaultDecoderGenerator::writeRFSRAMDecodingProcess(), DefaultDecoderGenerator::writeRulesForDestinationControlSignals(), and DefaultDecoderGenerator::writeRulesForSourceControlSignals().

Here is the call graph for this function:

◆ port() [2/2]

RFPort * TTAMachine::BaseRegisterFile::port ( int  index) const
virtual

Returns a port by the given index.

The index must be greater or equal to 0 and smaller than the number of ports in the unit.

Parameters
indexIndex.
Returns
The port by the given index.
Exceptions
OutOfRangeIf the given index is out of range.

Reimplemented from TTAMachine::Unit.

Definition at line 146 of file BaseRegisterFile.cc.

146 {
147 Port* port = Unit::port(index);
148 RFPort* rfPort = dynamic_cast<RFPort*>(port);
149 assert(rfPort != NULL);
150 return rfPort;
151}
#define assert(condition)

References assert, port(), and TTAMachine::Unit::port().

Here is the call graph for this function:

◆ saveState()

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

Saves the state of the object into an ObjectState tree.

Returns
The newly created ObjectState tree.

Reimplemented from TTAMachine::Unit.

Reimplemented in TTAMachine::ImmediateUnit, TTAMachine::NullRegisterFile, and TTAMachine::RegisterFile.

Definition at line 159 of file BaseRegisterFile.cc.

159 {
160 ObjectState* state = Unit::saveState();
164 return state;
165}
void setName(const std::string &name)
void setAttribute(const std::string &name, const std::string &value)
static const std::string OSNAME_BASE_REGISTER_FILE
ObjectState name for BaseRegisterFile.
virtual ObjectState * saveState() const
Definition Unit.cc:285

References OSKEY_SIZE, OSKEY_WIDTH, OSNAME_BASE_REGISTER_FILE, TTAMachine::Unit::saveState(), ObjectState::setAttribute(), ObjectState::setName(), size_, and width_.

Referenced by TTAMachine::RegisterFile::saveState().

Here is the call graph for this function:

◆ setNumberOfRegisters()

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

Sets the number of registers in the register file.

Parameters
registersThe new amount of registers.
Exceptions
OutOfRangeIf the given number of registers is less or equal to zero.

Reimplemented in TTAMachine::NullRegisterFile, TTAMachine::RegisterFile, and UnboundedRegisterFile.

Definition at line 96 of file BaseRegisterFile.cc.

96 {
97 if (registers <= 0) {
98 string procName = "BaseRegisterFile::setNumberOfRegisters";
99 throw OutOfRange(__FILE__, __LINE__, procName);
100 }
101
102 size_ = registers;
103}

References size_.

Referenced by BaseRegisterFile(), loadStateWithoutReferences(), and TTAMachine::RegisterFile::setNumberOfRegisters().

◆ setWidth()

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

Sets the bit width of the registers.

Parameters
widthThe new bit width.
Exceptions
OutOfRangeIf the given width is less or equal to zero.

Reimplemented in TTAMachine::NullRegisterFile, and UnboundedRegisterFile.

Definition at line 112 of file BaseRegisterFile.cc.

112 {
113 if (width <= 0) {
114 string procName = "BaseRegisterFile::setWidth";
115 throw OutOfRange(__FILE__, __LINE__, procName);
116 }
117
118 width_ = width;
119}

References width(), and width_.

Referenced by BaseRegisterFile(), TTAMachine::ImmediateUnit::ImmediateUnit(), loadStateWithoutReferences(), IUDialog::onOK(), and RFDialog::onOK().

Here is the call graph for this function:

◆ size()

virtual int TTAMachine::BaseRegisterFile::size ( ) const
virtual

◆ width()

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

Reimplemented in TTAMachine::NullRegisterFile.

Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), TDGen::analyzeMachineRegisters(), ResourceConstraintAnalyzer::analyzeRegisterAntideps(), TDGen::analyzeRegisters(), BaseRegisterFile(), MachineStateBuilder::buildMachineState(), IUBroker::buildResources(), RegisterQuantityCheck::canFixIntRegs(), MachineConnectivityCheck::canWriteAllImmediates(), ProgrammabilityValidator::checkBooleanRegister(), ProGeTools::checkForSelectableIU(), Automagic::checkForSelectableIU(), ProGeTools::checkForSelectableRF(), Automagic::checkForSelectableRF(), DefaultDecoderGenerator::completeDecoderBlock(), ADFCombiner::connectRegisterFiles(), RegisterQuantityCheck::countIntRegisters(), IUFactory::createEditPart(), RFFactory::createEditPart(), VLIWConnectIC::explore(), findBooleanGuard(), SimulatorFrontend::findBooleanRegister(), findBooleanRegisterFile(), RegisterRenamer::findConnectedRFs(), RegisterRenamer::findFreeRegisters(), ProgrammabilityValidator::findGlobalConnectionRegister(), RegisterRenamer::findPartiallyUsedRegistersAfterCycle(), RegisterRenamer::findPartiallyUsedRegistersBeforeCycle(), MachineConnectivityCheck::findPossibleSourcePorts(), ProGe::RV32MicroCodeGenerator::findRF(), RegisterCopyAdder::findTempRegisters(), RegisterQuantityCheck::fixIntRegs(), MachineConnectivityCheck::fromRfConnected(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), ProDeIUEditPolicy::getCommand(), ProDeRFEditPolicy::getCommand(), MachineConnectivityCheck::hasConditionalMoves(), TTAMachine::ImmediateUnit::ImmediateUnit(), TTAMachine::RegisterFile::isArchitectureEqual(), MachineConnectivityCheck::isConnectedToDifferentlyConnectedRFs(), ComponentImplementationSelector::iuImplementations(), TTAProgram::CodeGenerator::loadTerminal(), MachineInfo::numberOfRegisters(), BlockImplementationDialog::onHDBSelection(), BFScheduleBU::operator()(), MachineResourceManager::registerFileIndexReference(), llvm::LLVMTCEIRBuilder::registerFileName(), RegisterRenamer::renameDestinationRegister(), RegisterRenamer::renameSourceRegister(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), HDB::RFArchitecture::RFArchitecture(), ComponentImplementationSelector::rfImplementations(), setWidth(), TTAProgram::CodeGenerator::storeTerminal(), MachineInfo::supportsBoolRegisterGuardedJumps(), MachineConnectivityCheck::toRfConnected(), IUDialog::TransferDataToWindow(), PreOptimizer::tryToOptimizeAddressReg(), RFDialog::updateWidgets(), TTAMachine::RFPort::width(), DefaultDecoderGenerator::writeInstructionTemplateProcedures(), and DefaultDecoderGenerator::writeRFCntrlSignals().

Member Data Documentation

◆ OSKEY_SIZE

const string TTAMachine::BaseRegisterFile::OSKEY_SIZE = "size"
static

ObjectState attribute key for the number of registers.

Definition at line 68 of file BaseRegisterFile.hh.

Referenced by ADFSerializer::immediateUnitToMachine(), loadStateWithoutReferences(), ADFSerializer::registerFileToMachine(), and saveState().

◆ OSKEY_WIDTH

const string TTAMachine::BaseRegisterFile::OSKEY_WIDTH = "width"
static

ObjectState attribute key for bit width of the registers.

Definition at line 70 of file BaseRegisterFile.hh.

Referenced by ADFSerializer::immediateUnitToMachine(), loadStateWithoutReferences(), ADFSerializer::registerFileToMachine(), and saveState().

◆ OSNAME_BASE_REGISTER_FILE

const string TTAMachine::BaseRegisterFile::OSNAME_BASE_REGISTER_FILE = "baseregfile"
static

ObjectState name for BaseRegisterFile.

Definition at line 66 of file BaseRegisterFile.hh.

Referenced by saveState().

◆ size_

int TTAMachine::BaseRegisterFile::size_
private

Number of registers in the register file.

Definition at line 80 of file BaseRegisterFile.hh.

Referenced by saveState(), and setNumberOfRegisters().

◆ width_

int TTAMachine::BaseRegisterFile::width_
private

Bit width of the registers in the register file.

Definition at line 82 of file BaseRegisterFile.hh.

Referenced by saveState(), and setWidth().


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