OpenASIP
2.0
|
#include <BaseRegisterFile.hh>
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 RFPort * | port (const std::string &name) const |
virtual RFPort * | port (int index) const |
virtual ObjectState * | saveState () 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 Machine * | machine () 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. 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 | |
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. More... | |
int | width_ |
Bit width of the registers in the register file. More... | |
An abstract base class for register files as ImmediateUnit and RegisterFile.
Definition at line 48 of file BaseRegisterFile.hh.
|
virtual |
|
protected |
Constructor.
name | Name of the register file. |
size | Number of registers in the register file. |
width | Bit width of the registers in the register file. |
OutOfRange | If the given size or width is out of range. |
InvalidName | If the given name is not a valid component name. |
Definition at line 60 of file BaseRegisterFile.cc.
References setNumberOfRegisters(), setWidth(), size(), and width().
|
protected |
Constructor.
Loads the state of the object from the given ObjectState instance. Does not load references to other components.
state | The ObjectState instance from which the state is loaded. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 76 of file BaseRegisterFile.cc.
References loadStateWithoutReferences().
|
virtual |
Loads its the from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Reimplemented from TTAMachine::Unit.
Reimplemented in TTAMachine::RegisterFile, TTAMachine::NullRegisterFile, TTAMachine::ImmediateUnit, and UnboundedRegisterFile.
Definition at line 176 of file BaseRegisterFile.cc.
References TTAMachine::Unit::loadState(), and loadStateWithoutReferences().
Referenced by TTAMachine::RegisterFile::loadState().
|
private |
Loads its state from the given ObjectState instance without references to other components.
state | The ObjectState instance. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 190 of file BaseRegisterFile.cc.
References ObjectState::intAttribute(), OSKEY_SIZE, OSKEY_WIDTH, setNumberOfRegisters(), and setWidth().
Referenced by BaseRegisterFile(), and loadState().
|
virtual |
Reimplemented in TTAMachine::NullRegisterFile, and UnboundedRegisterFile.
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), CodeCompressorPlugin::addBitsForDstRegisterField(), ProgrammabilityValidator::addConnectionToProgram(), BEMGenerator::addLongImmDstRegisterFields(), MachineStateBuilder::buildMachineState(), IUBroker::buildResources(), BEMValidator::checkLImmDstRegisterFields(), RFFactory::createEditPart(), IUFactory::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(), AddWatchDialog::onRFChoice(), RFGuardDialog::onRFChoice(), ProgrammabilityValidator::printConnection(), MachineResourceManager::registerFileIndexReference(), SimulationController::registerFileValue(), CompiledSimController::registerFileValue(), TTAMachine::RegisterGuard::RegisterGuard(), BEMGenerator::requiredIndexWidth(), HDB::RFArchitecture::RFArchitecture(), ComponentImplementationSelector::rfImplementations(), DefaultDecoderGenerator::rfOpcodeWidth(), TTAProgram::TerminalRegister::setIndex(), TTAMachine::RegisterFile::setNumberOfRegisters(), and DefaultDecoderGenerator::writeInstructionTemplateProcedures().
|
virtual |
Returns the requested port.
name | Name of the port. |
InstanceNotFound | If a port is not found by the given name. |
Reimplemented from TTAMachine::Unit.
Definition at line 129 of file BaseRegisterFile.cc.
References TTAMachine::Component::name(), and TTAMachine::Unit::port().
Referenced by ProGe::NetlistGenerator::addBaseRFToNetlist(), RegisterCopyAdder::addConnectionRegisterCopies(), RegisterCopyAdder::addConnectionRegisterCopiesImmediate(), InputPSocketBroker::allAvailableResources(), OutputPSocketBroker::allAvailableResources(), IUBroker::allAvailableResources(), TDGen::analyzeMachineRegisters(), TDGen::analyzeRegisters(), IUBroker::assign(), MachineTester::canConnect(), RFPortCheck::check(), FullyConnectedCheck::check(), DefaultDecoderGenerator::completeDecoderBlock(), ProGe::RV32MicroCodeGenerator::connectRF(), RegisterCopyAdder::countAndAddConnectionRegisterCopiesToRR(), IUFactory::createEditPart(), RFFactory::createEditPart(), ADFCombiner::createPortsAndSockets(), TTAProgram::TPEFProgramFactory::createTerminal(), TTAProgram::CodeGenerator::createTerminalRegister(), llvm::LLVMTCEBuilder::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(), MachineAnalysis::MachineAnalysis(), BlockImplementationDialog::onHDBSelection(), port(), MachineResourceManager::registerFileIndexReference(), HDB::RFArchitecture::RFArchitecture(), ComponentImplementationSelector::rfImplementations(), MachineResourceManager::rFPortOrFUIndexReference(), IUBroker::setupResourceLinks(), MachineConnectivityCheck::toRfConnected(), TTAMachine::RegisterFile::updateMaxReadsAndWrites(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultDecoderGenerator::writeRFCntrlSignals(), DefaultDecoderGenerator::writeRFSRAMDecodingProcess(), DefaultDecoderGenerator::writeRulesForDestinationControlSignals(), and DefaultDecoderGenerator::writeRulesForSourceControlSignals().
|
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.
index | Index. |
OutOfRange | If the given index is out of range. |
Reimplemented from TTAMachine::Unit.
Definition at line 146 of file BaseRegisterFile.cc.
References assert, TTAMachine::Unit::port(), and port().
|
virtual |
Saves the state of the object into an ObjectState tree.
Reimplemented from TTAMachine::Unit.
Reimplemented in TTAMachine::RegisterFile, TTAMachine::NullRegisterFile, and TTAMachine::ImmediateUnit.
Definition at line 159 of file BaseRegisterFile.cc.
References OSKEY_SIZE, OSKEY_WIDTH, OSNAME_BASE_REGISTER_FILE, TTAMachine::Unit::saveState(), ObjectState::setAttribute(), ObjectState::setName(), size_, and width_.
Referenced by TTAMachine::RegisterFile::saveState().
|
virtual |
Sets the number of registers in the register file.
registers | The new amount of registers. |
OutOfRange | If the given number of registers is less or equal to zero. |
Reimplemented in TTAMachine::RegisterFile, TTAMachine::NullRegisterFile, and UnboundedRegisterFile.
Definition at line 96 of file BaseRegisterFile.cc.
References size_.
Referenced by BaseRegisterFile(), loadStateWithoutReferences(), and TTAMachine::RegisterFile::setNumberOfRegisters().
|
virtual |
Sets the bit width of the registers.
width | The new bit width. |
OutOfRange | If the given width is less or equal to zero. |
Reimplemented in TTAMachine::NullRegisterFile, and UnboundedRegisterFile.
Definition at line 112 of file BaseRegisterFile.cc.
References width(), and width_.
Referenced by BaseRegisterFile(), TTAMachine::ImmediateUnit::ImmediateUnit(), and loadStateWithoutReferences().
|
virtual |
Referenced by TDGen::analyzeMachineRegisters(), TDGen::analyzeRegisters(), BaseRegisterFile(), ProGeTools::checkForSelectableIU(), Automagic::checkForSelectableIU(), ProGeTools::checkForSelectableRF(), Automagic::checkForSelectableRF(), SimulatorFrontend::compareState(), RegisterQuantityCheck::countIntRegisters(), ProGe::RV32MicroCodeGenerator::findRF(), RegisterCopyAdder::findTempRegisters(), RegisterQuantityCheck::fixIntRegs(), TTAMachine::ImmediateUnit::ImmediateUnit(), RegisterRenamer::initialize(), TTAMachine::RegisterFile::isArchitectureEqual(), MachineInfo::numberOfRegisters(), BlockImplementationDialog::onHDBSelection(), RegisterRenamer::registersOfRFs(), BFRegCopyAfter::splitMove(), and BFRegCopyBefore::splitMove().
|
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(), Automagic::checkForSelectableIU(), ProGeTools::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(), ComponentImplementationSelector::rfImplementations(), setWidth(), TTAProgram::CodeGenerator::storeTerminal(), MachineInfo::supportsBoolRegisterGuardedJumps(), MachineConnectivityCheck::toRfConnected(), PreOptimizer::tryToOptimizeAddressReg(), TTAMachine::RFPort::width(), DefaultDecoderGenerator::writeInstructionTemplateProcedures(), and DefaultDecoderGenerator::writeRFCntrlSignals().
|
static |
ObjectState attribute key for the number of registers.
Definition at line 68 of file BaseRegisterFile.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for bit width of the registers.
Definition at line 70 of file BaseRegisterFile.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState name for BaseRegisterFile.
Definition at line 66 of file BaseRegisterFile.hh.
Referenced by saveState().
|
private |
Number of registers in the register file.
Definition at line 80 of file BaseRegisterFile.hh.
Referenced by saveState(), and setNumberOfRegisters().
|
private |
Bit width of the registers in the register file.
Definition at line 82 of file BaseRegisterFile.hh.
Referenced by saveState(), and setWidth().