|
OpenASIP 2.2
|
#include <AddressSpace.hh>


Public Member Functions | |
| AddressSpace (const std::string &name, int width, ULongWord minAddress, ULongWord maxAddress, Machine &owner) | |
| AddressSpace (const ObjectState *state, Machine &owner) | |
| virtual | ~AddressSpace () |
| virtual int | width () const |
| virtual ULongWord | start () const |
| virtual ULongWord | end () const |
| virtual void | setName (const std::string &name) |
| virtual void | setWidth (int width) |
| virtual void | setAddressBounds (ULongWord start, ULongWord end) |
| virtual void | addNumericalId (unsigned id) |
| virtual bool | hasNumericalId (unsigned id) const |
| std::set< unsigned > | numericalIds () const |
| bool | setNumericalIds (const std::set< unsigned > &ids) |
| virtual void | setShared (bool shared) |
| virtual bool | isShared () const |
| virtual void | setMachine (Machine &mach) |
| virtual void | unsetMachine () |
| virtual ObjectState * | saveState () const |
| virtual void | loadState (const ObjectState *state) |
| bool | operator== (const AddressSpace &other) const |
| bool | operator!= (const AddressSpace &other) const |
Public Member Functions inherited from TTAMachine::Component | |
| virtual | ~Component () |
| virtual TCEString | name () const |
| 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_ADDRESS_SPACE = "adress_space" |
| ObjectState name for AddressSpace. | |
| static const std::string | OSKEY_WIDTH = "width" |
| ObjectState attribute key for the bit width. | |
| static const std::string | OSKEY_MIN_ADDRESS = "min_a" |
| ObjectState attribute key for minimum address. | |
| static const std::string | OSKEY_MAX_ADDRESS = "max_a" |
| ObjectState attribute key for maximum address. | |
| static const std::string | OSKEY_SHARED_MEMORY = "shared-memory" |
| static const std::string | OSKEY_NUMERICAL_ID = "numerical-id" |
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. | |
Private Types | |
| typedef std::set< unsigned > | IDSet |
Private Attributes | |
| int | width_ |
| Bit width of the minimum addressable word. | |
| ULongWord | minAddress_ |
| Lowest address in the address space. | |
| ULongWord | maxAddress_ |
| Highest address in the address space. | |
| IDSet | numericalIds_ |
| The numerical ids mapped to this address space. | |
| bool | shared_ |
| True in case this address space maps to a memory that is shared across all the cores in the multicore. | |
Additional Inherited Members | |
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 () |
Represents an address space in the machine.
Definition at line 51 of file AddressSpace.hh.
|
private |
Definition at line 95 of file AddressSpace.hh.
| TTAMachine::AddressSpace::AddressSpace | ( | const std::string & | name, |
| int | width, | ||
| ULongWord | minAddress, | ||
| ULongWord | maxAddress, | ||
| Machine & | owner | ||
| ) |
Constructor.
| name | Name of the address space. |
| width | Bit width of the minimum addressable word. |
| minAddress | Lowest address in the address space. |
| maxAddress | Highest address in the address space. |
| owner | The machine which owns the address space. |
| ComponentAlreadyExists | If another address space by the same name is already registered to the machine. |
| OutOfRange | If the some of the given parameters is out of range. |
| InvalidName | If the given name is not valid for a component. |
Definition at line 74 of file AddressSpace.cc.
References maxAddress_, minAddress_, setMachine(), width(), and width_.

| TTAMachine::AddressSpace::AddressSpace | ( | const ObjectState * | state, |
| Machine & | owner | ||
| ) |
Constructor.
Loads its state from the given ObjectState instance.
| state | The ObjectState from which the name is taken. |
| owner | The machine which owns the address space. |
| ObjectStateLoadingException | If the machine already has an address space by the same name as the coming name of this or if the ObjectState instance is invalid. |
Definition at line 103 of file AddressSpace.cc.
References __func__, TTAMachine::Machine::addressSpaceNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), hasNumericalId(), TTAMachine::Machine::Navigator< ComponentType >::item(), loadState(), TTAMachine::Component::name(), numericalIds_, setMachine(), and Texts::TextGenerator::text().

|
virtual |
Destructor.
Definition at line 144 of file AddressSpace.cc.
References unsetMachine().

|
virtual |
Adds a numerical address space id that should be mapped to this address space.
Numerical IDs are referred to from programs, i.e., by means of the attribute((address_space(N)). Single ADF address space can map multiple program address spaces.
Definition at line 378 of file AddressSpace.cc.
References numericalIds_.
Referenced by loadState().
|
virtual |
Returns the highest memory address of the address space.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 177 of file AddressSpace.cc.
References maxAddress_.
Referenced by ProGe::ProcessorWrapperBlock::addInstructionMemory(), ProGe::NetlistGenerator::calculateAddressWidth(), MachineValidator::checkIMemAddrWidth(), TTAProgram::ProgramWriter::createBinary(), TTAProgram::TPEFProgramFactory::createDataMemories(), OpsetDialog::createOperation(), VectorLSGenerator::createVectorLSU(), PlatformIntegrator::dmemInfo(), llvm::LLVMTCEBuilder::emitSPInitialization(), InfoProcCommand::execute(), CodeSectionCreator::finalize(), ITemplateBroker::findITemplates(), ProGeTestBenchGenerator::generate(), ProGe::ProcessorGenerator::iMemAddressWidth(), SimulatorFrontend::initializeDataMemories(), SimulatorFrontend::initializeMemorySystem(), ProGe::NetlistGenerator::instructionMemoryAddressWidth(), ProximMemoryWindow::loadMemory(), AddWatchDialog::onASChoice(), printLatexAddressSpaceDescription(), ProGe::ProGeUI::readImemParameters(), PlatformIntegrator::readLsuParameters(), MachineConnectivityCheck::requiredImmediateWidth(), setAddressBounds(), AddressSpaceDialog::TransferDataToWindow(), and AddressSpacesDialog::updateASList().
|
virtual |
Definition at line 383 of file AddressSpace.cc.
References AssocTools::containsKey(), and numericalIds_.
Referenced by llvm::LLVMTCEBuilder::addCandidateLSUAnnotations(), AddressSpace(), llvm::LLVMTCEBuilder::addressSpaceById(), llvm::LLVMTCEBuilder::emitOperationMacro(), AlmaIFIntegrator::findMemories(), and MachineInfo::maxMemoryAlignment().

|
inlinevirtual |
Definition at line 72 of file AddressSpace.hh.
References shared_.
Referenced by SimulatorFrontend::initializeDataMemories(), SimulatorFrontend::initializeMemorySystem(), ProGe::ProGeUI::readImemParameters(), and MemorySystem::shareMemoriesWith().
|
virtual |
Loads its state from the given ObjectState instance.
| state | The ObjectState instance. |
| ObjectStateLoadingException | If the given ObjectState instance  is invalid or if the machine already has an address space by the same name as the coming name of this address space. |
Reimplemented from TTAMachine::Component.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 334 of file AddressSpace.cc.
References addNumericalId(), ObjectState::boolAttribute(), ObjectState::child(), ObjectState::childCount(), Exception::errorMessage(), ObjectState::hasAttribute(), ObjectState::intAttribute(), ObjectState::intValue(), TTAMachine::Component::loadState(), ObjectState::name(), OSKEY_MAX_ADDRESS, OSKEY_MIN_ADDRESS, OSKEY_NUMERICAL_ID, OSKEY_SHARED_MEMORY, OSKEY_WIDTH, OSNAME_ADDRESS_SPACE, setAddressBounds(), setShared(), setWidth(), and ObjectState::uLongAttribute().
Referenced by AddressSpace().

| std::set< unsigned > TTAMachine::AddressSpace::numericalIds | ( | ) | const |
Returns ids that are assigned to this address space.
Definition at line 393 of file AddressSpace.cc.
References numericalIds_.
Referenced by AddressSpaceDialog::isFreeId(), printLatexAddressSpaceDescription(), setNumericalIds(), and AddressSpaceDialog::TransferDataToWindow().
| bool TTAMachine::AddressSpace::operator!= | ( | const AddressSpace & | other | ) | const |
Definition at line 441 of file AddressSpace.cc.
References operator==().

| bool TTAMachine::AddressSpace::operator== | ( | const AddressSpace & | other | ) | const |
Definition at line 432 of file AddressSpace.cc.
References maxAddress_, minAddress_, numericalIds_, shared_, and width_.
Referenced by operator!=().
|
virtual |
Saves the contents to an ObjectState object.
Reimplemented from TTAMachine::Component.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 295 of file AddressSpace.cc.
References maxAddress_, minAddress_, TTAMachine::Component::name(), numericalIds_, OSKEY_MAX_ADDRESS, OSKEY_MIN_ADDRESS, TTAMachine::Component::OSKEY_NAME, OSKEY_NUMERICAL_ID, OSKEY_SHARED_MEMORY, OSKEY_WIDTH, OSNAME_ADDRESS_SPACE, ObjectState::setAttribute(), ObjectState::setValue(), shared_, and width_.
Referenced by ADFCombiner::addAddressSpaces().

Sets the memory address bounds of the address space.
| start | The lowest memory address. |
| end | The highest memory address. |
| OutOfRange | If the given start and end addresses are illegal. |
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 232 of file AddressSpace.cc.
References end(), maxAddress_, minAddress_, and start().
Referenced by loadState(), and AddressSpaceDialog::onOK().

|
virtual |
Registers the address space to a machine. Do not use this method.
| mach | Machine to which the address space is going to be registered. |
| ComponentAlreadyExists | If there is another address space by the same name in the given machine. |
Implements TTAMachine::Component.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 250 of file AddressSpace.cc.
References TTAMachine::Machine::addAddressSpace(), assert, TTAMachine::Component::internalSetMachine(), and TTAMachine::Component::isRegistered().
Referenced by AddressSpace(), and AddressSpace().

|
virtual |
Sets the name of the address space.
| name | Name of the address space. |
| ComponentAlreadyExists | If an address space with the given name is already in the same machine. |
| InvalidName | If the given name is not valid for a component. |
Reimplemented from TTAMachine::Component.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 191 of file AddressSpace.cc.
References TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::Component::setName().
Referenced by AddressSpaceDialog::onOK().

| bool TTAMachine::AddressSpace::setNumericalIds | ( | const std::set< unsigned > & | ids | ) |
Sets the ids for the address space.
| ids | Contains new ids for the address space. |
Definition at line 404 of file AddressSpace.cc.
References TTAMachine::Machine::addressSpaceNavigator(), assert, AssocTools::containsKey(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), numericalIds(), and numericalIds_.
Referenced by AddressSpaceDialog::onOK().

|
inlinevirtual |
Definition at line 71 of file AddressSpace.hh.
References shared_.
Referenced by loadState().
|
virtual |
Sets the bit width of the minimum addressable word.
| width | The bit width of the minimum addressable word. |
| OutOfRange | If the given width is illegal (<=0). |
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 215 of file AddressSpace.cc.
References width(), and width_.
Referenced by loadState(), AddressSpaceDialog::onOK(), and CodeCompressorPlugin::setImemWidth().

|
virtual |
Returns the lowest memory address of the address space.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 166 of file AddressSpace.cc.
References minAddress_.
Referenced by ProGe::NetlistGenerator::calculateAddressWidth(), TTAProgram::ProgramWriter::createBinary(), llvm::LLVMTCEBuilder::dataEnd(), InfoProcCommand::execute(), SimulatorFrontend::initializeDataMemories(), SimulatorFrontend::initializeMemorySystem(), ProximMemoryWindow::loadMemory(), AddWatchDialog::onASChoice(), printLatexAddressSpaceDescription(), setAddressBounds(), CodeCompressorPlugin::setMachine(), AddressSpaceDialog::TransferDataToWindow(), and AddressSpacesDialog::updateASList().
|
virtual |
Removes registration of the address space from its current machine. The address space is deleted too because it cannot be unregistered.
Implements TTAMachine::Component.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 261 of file AddressSpace.cc.
References TTAMachine::FunctionUnit::addressSpace(), assert, TTAMachine::Machine::controlUnit(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::deleteAddressSpace(), TTAMachine::Machine::functionUnitNavigator(), TTAMachine::Component::internalUnsetMachine(), TTAMachine::Component::isRegistered(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), and TTAMachine::FunctionUnit::setAddressSpace().
Referenced by ~AddressSpace().

|
virtual |
Returns the bit width of the minimum addressable word.
Reimplemented in TTAMachine::NullAddressSpace.
Definition at line 155 of file AddressSpace.cc.
References width_.
Referenced by AddressSpace(), BEMValidator::checkImemMauWidth(), TTAProgram::ProgramWriter::createASpaceElement(), TTAProgram::TPEFProgramFactory::createDataMemories(), TTAProgram::DataDefinition::DataDefinition(), TTAProgram::DataDefinition::DataDefinition(), InfoProcCommand::execute(), MemDumpCommand::execute(), MachineResourceManager::findDataAddressSpace(), ProgramImageGenerator::generateDataImage(), CompiledSimCodeGenerator::generateLoadTrigger(), ProgramImageGenerator::generateProgramImage(), ProGe::ProcessorGenerator::iMemWidth(), SimulatorFrontend::initializeMemorySystem(), ProGe::NetlistGenerator::instructionMemoryWidth(), ProximMemoryWindow::loadMemory(), TTAProgram::DataDefinition::MAU(), printLatexAddressSpaceDescription(), PlatformIntegrator::readLsuParameters(), CodeCompressorPlugin::setMachine(), setWidth(), AddressSpaceDialog::TransferDataToWindow(), and AddressSpacesDialog::updateASList().
|
private |
Highest address in the address space.
Definition at line 101 of file AddressSpace.hh.
Referenced by AddressSpace(), end(), operator==(), saveState(), and setAddressBounds().
|
private |
Lowest address in the address space.
Definition at line 99 of file AddressSpace.hh.
Referenced by AddressSpace(), operator==(), saveState(), setAddressBounds(), and start().
|
private |
The numerical ids mapped to this address space.
Definition at line 103 of file AddressSpace.hh.
Referenced by addNumericalId(), AddressSpace(), hasNumericalId(), numericalIds(), operator==(), saveState(), and setNumericalIds().
|
static |
ObjectState attribute key for maximum address.
Definition at line 90 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::addressSpaceToMDF(), loadState(), and saveState().
|
static |
ObjectState attribute key for minimum address.
Definition at line 88 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::addressSpaceToMDF(), loadState(), and saveState().
|
static |
Definition at line 92 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::addressSpaceToMDF(), loadState(), and saveState().
|
static |
Definition at line 91 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::addressSpaceToMDF(), loadState(), and saveState().
|
static |
ObjectState attribute key for the bit width.
Definition at line 86 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::addressSpaceToMDF(), loadState(), and saveState().
|
static |
ObjectState name for AddressSpace.
Definition at line 84 of file AddressSpace.hh.
Referenced by ADFSerializer::addressSpaceToMachine(), ADFSerializer::convertToMDFFormat(), loadState(), TTAMachine::Machine::loadState(), and saveState().
|
private |
True in case this address space maps to a memory that is shared across all the cores in the multicore.
Definition at line 106 of file AddressSpace.hh.
Referenced by isShared(), operator==(), saveState(), and setShared().
|
private |
Bit width of the minimum addressable word.
Definition at line 97 of file AddressSpace.hh.
Referenced by AddressSpace(), operator==(), saveState(), setWidth(), and width().