OpenASIP
2.0
|
#include <Bus.hh>
Public Member Functions | |
Bus (const std::string &name, int width, int immWidth, Machine::Extension extensionMode) | |
Bus (const ObjectState *state) | |
virtual | ~Bus () |
virtual Bus * | copy () const |
virtual void | copyGuardsTo (Bus &other) const |
operator Segment & () | |
virtual int | position () const |
int | width () const |
int | immediateWidth () const |
bool | signExtends () const |
bool | zeroExtends () const |
virtual void | setName (const std::string &name) |
virtual void | setWidth (int width) |
virtual void | setImmediateWidth (int width) |
virtual void | setZeroExtends () |
virtual void | setSignExtends () |
virtual void | setExtensionMode (const Machine::Extension extension) |
virtual void | addSegment (Segment &segment) |
virtual void | removeSegment (Segment &segment) |
virtual bool | hasSegment (const std::string &name) const |
virtual Segment * | segment (int index) const |
virtual Segment * | segment (const std::string &name) const |
virtual int | segmentCount () const |
virtual bool | isConnectedTo (const Socket &socket) const |
bool | hasGuard (const Guard &guard) const |
void | addGuard (Guard &guard) |
virtual void | removeGuard (Guard &guard) |
int | guardCount () const |
Guard * | guard (int index) const |
virtual bool | hasNextBus () const |
virtual bool | hasPreviousBus () const |
virtual Bus * | nextBus () const |
virtual Bus * | previousBus () const |
virtual bool | canRead (const Bus &bus) const |
virtual bool | canWrite (const Bus &bus) const |
virtual bool | canReadWrite (const Bus &bus) const |
virtual void | setSourceBridge (Bridge &bridge) |
virtual void | setDestinationBridge (Bridge &bridge) |
virtual void | clearSourceBridge (Bridge &bridge) |
virtual void | clearDestinationBridge (Bridge &bridge) |
virtual void | setMachine (Machine &mach) |
virtual void | unsetMachine () |
virtual ObjectState * | saveState () const |
virtual void | loadState (const ObjectState *state) |
virtual bool | isArchitectureEqual (const Bus &bus) 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_BUS = "bus" |
ObjectState name for Bus ObjectState. More... | |
static const std::string | OSKEY_WIDTH = "width" |
ObjectState attribute key for bus width. More... | |
static const std::string | OSKEY_IMMWIDTH = "immwidth" |
ObjectState attribute key for immediate width. More... | |
static const std::string | OSKEY_EXTENSION = "extension" |
ObjectState attribute key for extension mode. More... | |
static const std::string | OSVALUE_SIGN = "sign" |
ObjectState attribute value for sign extension. More... | |
static const std::string | OSVALUE_ZERO = "zero" |
ObjectState attribute key for zero extension. 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... | |
Private Types | |
typedef std::vector< Guard * > | GuardTable |
Vector of Guard pointers. More... | |
typedef std::vector< Segment * > | SegmentTable |
Vector of Segment pointers. More... | |
typedef std::vector< Bridge * > | BridgeTable |
Private Member Functions | |
Bus & | operator= (const Bus &) |
Assingment forbidden. More... | |
void | loadStateWithoutReferences (const ObjectState *state) |
void | deleteAllSegments () |
void | deleteAllGuards () |
Bridge * | previousBridge () const |
Bridge * | nextBridge () const |
Bridge * | previousBridge (const BridgeTable &bridges) const |
Bridge * | nextBridge (const BridgeTable &bridges) const |
void | adjustSegmentChain (const ObjectState *busState) |
Private Attributes | |
int | width_ |
Bit width of the bus. More... | |
int | immWidth_ |
Bit width of the inline immediate word. More... | |
Machine::Extension | extensionMode_ |
Extension mode applied to the inline immediate word. More... | |
GuardTable | guards_ |
Contains all guards of the bus. More... | |
SegmentTable | segments_ |
Contains all the segments of the bus. More... | |
BridgeTable | sourceBridges_ |
Contains the source bridges (max 2). More... | |
BridgeTable | destinationBridges_ |
Contains the destination bridges (max 2). More... | |
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 () |
|
private |
|
private |
|
private |
TTAMachine::Bus::Bus | ( | const std::string & | name, |
int | width, | ||
int | immWidth, | ||
Machine::Extension | extensionMode | ||
) |
Constructor.
name | Name of the bus. |
width | Bit width of the bus. |
immWidth | Bit width of the inline immediate word. |
extensionMode | Extension mode applied to the inline immediate word when it is narrower than the bus on which it is transported. |
OutOfRange | If the given width or immediate width is invalid. |
InvalidName | If the given name is not a valid component name. |
Definition at line 74 of file Bus.cc.
References width().
Referenced by copy().
TTAMachine::Bus::Bus | ( | const ObjectState * | state | ) |
Constructor.
Loads the state of the bus from the given ObjectState instance. Does not load connections to sockets.
state | Root node of the ObjectState tree from which the state is loaded. |
ObjectStateLoadingException | If the given ObjectState instance is invalid. |
Definition at line 98 of file Bus.cc.
References deleteAllGuards(), deleteAllSegments(), and loadStateWithoutReferences().
|
virtual |
Destructor.
Before destruction detaches all sockets from the bus.
Definition at line 113 of file Bus.cc.
References deleteAllGuards(), deleteAllSegments(), and unsetMachine().
void TTAMachine::Bus::addGuard | ( | Guard & | guard | ) |
Adds guard to the bus.
guard | Pointer to the Guard object to be added. |
ComponentAlreadyExists | If there is an equal guard already. |
Definition at line 410 of file Bus.cc.
References __func__, guard(), guards_, and hasGuard().
Referenced by TTAMachine::PortGuard::PortGuard(), TTAMachine::RegisterGuard::RegisterGuard(), and TTAMachine::UnconditionalGuard::UnconditionalGuard().
|
virtual |
Adds the given segment to this bus.
This method should be called by Segment constructor only.
segment | Segment to be added. |
ComponentAlreadyExists | If a segment with the same name as the given segment is already existing in this bus. |
Definition at line 737 of file Bus.cc.
References assert, hasSegment(), TTAMachine::Segment::name(), TTAMachine::Segment::parentBus(), segment(), and segments_.
Referenced by TTAMachine::Segment::Segment().
|
private |
Adjusts the order of segments according to the order represented by the given ObjectState tree.
busState | ObjectState tree representing the state of this bus. |
ObjectStateLoadingException | If the segment chain is erroneus in the given ObjectState tree. |
Definition at line 1027 of file Bus.cc.
References assert, ObjectState::child(), ObjectState::childCount(), Exception::errorMessage(), ObjectState::hasAttribute(), ObjectState::hasChild(), TTAMachine::Segment::moveBefore(), TTAMachine::Segment::name(), ObjectState::name(), TTAMachine::Component::name(), TTAMachine::Segment::OSKEY_DESTINATION, TTAMachine::Segment::OSKEY_NAME, TTAMachine::Segment::OSNAME_SEGMENT, segment(), segmentCount(), ObjectState::stringAttribute(), Texts::TextGenerator::text(), MOMTextGenerator::TXT_NO_LAST_SEGMENT, and MOMTextGenerator::TXT_NO_SOURCE_SEGMENT.
Referenced by loadStateWithoutReferences().
|
virtual |
Checks if the bus can read from the given bus.
That is, checks if the given bus is source bus of this bus.
bus | The bus. |
Definition at line 537 of file Bus.cc.
References sourceBridges_.
Referenced by canReadWrite(), BEMValidator::needsSourceField(), and TTAMachine::Bridge::setSourceAndDestination().
|
virtual |
Check if the bus can both read from and write to the given bus.
That is, checks if the given bus is joined by a bidirectional bridge to this bus.
bus | The bus. |
Definition at line 580 of file Bus.cc.
References canRead(), and canWrite().
|
virtual |
Checks if the bus can write to the given bus.
That is, checks if the given bus is destination bus of this bus.
bus | The bus. |
Definition at line 558 of file Bus.cc.
References destinationBridges_.
Referenced by MachineTester::canBridge(), canReadWrite(), and TTAMachine::Bridge::setSourceAndDestination().
|
virtual |
Removes a destination bridge from the bus.
This method can be called from Bridge destructor only. Do not call this method.
bridge | The destination bridge to remove. |
Definition at line 652 of file Bus.cc.
References assert, destinationBridges_, ContainerTools::removeValueIfExists(), and TTAMachine::Bridge::sourceBus().
Referenced by TTAMachine::Bridge::unsetMachine().
|
virtual |
Removes a source bridge from the bus.
This method can be called from Bridge destructor only. Do not call this method.
bridge | The source bridge to remove. |
Definition at line 632 of file Bus.cc.
References assert, TTAMachine::Bridge::destinationBus(), ContainerTools::removeValueIfExists(), and sourceBridges_.
Referenced by TTAMachine::Bridge::unsetMachine().
|
virtual |
Copies the bus.
Definition at line 1145 of file Bus.cc.
References Bus(), and saveState().
Referenced by MachineResourceModifier::addBusesByAmount().
|
virtual |
Definition at line 1155 of file Bus.cc.
References TTAMachine::Guard::copyTo(), guard(), guardCount(), and hasGuard().
Referenced by ADFCombiner::addAllGuardsToConnectionBuses(), and MachineResourceModifier::addBusesByAmount().
|
private |
|
private |
Guard * TTAMachine::Bus::guard | ( | int | index | ) | const |
Returns the guard by the given index.
The index must be between 0 and the return value of numberOfGuards() - 1.
index | Index. |
OutOfRange | If the given index is out of range. |
Definition at line 456 of file Bus.cc.
References guards_.
Referenced by BEMGenerator::addEncodings(), addGuard(), BusBroker::allAvailableResources(), TDGen::analyzeRegisters(), BusBroker::assign(), MachineStateBuilder::buildMachineState(), BusBroker::canTransportImmediate(), ProgrammabilityValidator::checkBooleanRegister(), BEMValidator::checkGuardField(), TTAMachine::FUPort::cleanupGuards(), TTAMachine::FunctionUnit::cleanupGuards(), CompiledSimCodeGenerator::CompiledSimCodeGenerator(), DefaultDecoderGenerator::completeDecoderBlock(), ADFCombiner::copyGuards(), copyGuardsTo(), llvm::LLVMTCEBuilder::createGuard(), TTAProgram::CodeGenerator::createInverseGuard(), ProgramDependenceGraph::createJump(), TTAMachine::RegisterFile::deleteGuards(), PasteComponentCmd::Do(), findBooleanGuard(), TTAProgram::TPEFProgramFactory::findGuard(), DefaultDecoderGenerator::findGuard(), RegisterQuantityCheck::findGuardRegisters(), RegisterRenamer::findGuardRegisters(), ProgrammabilityValidator::findRegisterGuard(), RegisterCopyAdder::findTempRegisters(), MachineConnectivityCheck::hasBothGuards(), MachineConnectivityCheck::hasConditionalMoves(), hasGuard(), BusBroker::hasGuard(), TTAMachine::ControlUnit::hasLocalGuardLatencyOfZero(), BEMGenerator::hasUnconditionalGuard(), isArchitectureEqual(), BusBroker::isAvailable(), TTAMachine::RegisterFile::isUsedAsGuard(), MachineInfo::longestGuardLatency(), BFLateBypassGuard::operator()(), MachineResourceManager::registerFileIndexReference(), removeGuard(), RegisterRenamer::renameLiveRange(), HDB::RFArchitecture::RFArchitecture(), MachineResourceManager::rFPortOrFUIndexReference(), saveState(), BFRenameLiveRange::setGuard(), and DefaultDecoderGenerator::writeSquashSignalGenerationProcess().
int TTAMachine::Bus::guardCount | ( | ) | const |
Returns the number of guards in the bus.
Definition at line 441 of file Bus.cc.
References guards_.
Referenced by BEMGenerator::addEncodings(), BEMGenerator::addSubfields(), BusBroker::allAvailableResources(), TDGen::analyzeRegisters(), BusBroker::assign(), MachineStateBuilder::buildMachineState(), BusBroker::canTransportImmediate(), ProgrammabilityValidator::checkBooleanRegister(), BEMValidator::checkGuardField(), CompiledSimCodeGenerator::CompiledSimCodeGenerator(), DefaultDecoderGenerator::completeDecoderBlock(), ADFCombiner::copyGuards(), copyGuardsTo(), llvm::LLVMTCEBuilder::createGuard(), TTAProgram::CodeGenerator::createInverseGuard(), ProgramDependenceGraph::createJump(), PasteComponentCmd::Do(), findBooleanGuard(), TTAProgram::TPEFProgramFactory::findGuard(), DefaultDecoderGenerator::findGuard(), RegisterQuantityCheck::findGuardRegisters(), RegisterRenamer::findGuardRegisters(), ProgrammabilityValidator::findRegisterGuard(), RegisterCopyAdder::findTempRegisters(), MachineConnectivityCheck::hasBothGuards(), MachineConnectivityCheck::hasConditionalMoves(), BusBroker::hasGuard(), TTAMachine::ControlUnit::hasLocalGuardLatencyOfZero(), BEMGenerator::hasUnconditionalGuard(), isArchitectureEqual(), BusBroker::isAvailable(), MachineInfo::longestGuardLatency(), MachineAnalysis::MachineAnalysis(), BFLateBypassGuard::operator()(), MachineResourceManager::registerFileIndexReference(), RegisterRenamer::renameLiveRange(), HDB::RFArchitecture::RFArchitecture(), MachineResourceManager::rFPortOrFUIndexReference(), saveState(), BFRenameLiveRange::setGuard(), and DefaultDecoderGenerator::writeSquashSignalGenerationProcess().
bool TTAMachine::Bus::hasGuard | ( | const Guard & | guard | ) | const |
Checks whether the bus has the given guard.
Definition at line 393 of file Bus.cc.
References guard(), and guards_.
Referenced by addGuard(), MachineConnectivityCheck::canTransportImmediate(), ADFCombiner::connectRegisterFiles(), and copyGuardsTo().
|
virtual |
Checks if the bus has next bus.
Next does not mean destination bus in that case but the next bus from location point of view.
Definition at line 488 of file Bus.cc.
References nextBridge().
Referenced by TTAMachine::Bridge::adjustChainDirection(), MachineTester::areInSameChain(), MachineTester::canBridge(), MachineEditPartFactory::getBusChains(), BEMValidator::needsSourceField(), and TTAMachine::Bridge::setFirstOfChain().
|
virtual |
Checks if the bus has previous bus.
Previous does not mean source in that case but the previous bus from location point of view.
Definition at line 473 of file Bus.cc.
References previousBridge().
Referenced by MachineTester::areInSameChain(), MachineTester::canBridge(), MachineEditPartFactory::getBusChains(), BEMValidator::needsSourceField(), and TTAMachine::Bridge::setFirstOfChain().
|
virtual |
Returns true if the bus has a segment with the given name.
name | Name of the segment. |
Definition at line 284 of file Bus.cc.
References TTAMachine::Component::name(), and segments_.
Referenced by addSegment(), ADFCombiner::createBus(), and TTAMachine::Segment::loadStateWithoutReferences().
int TTAMachine::Bus::immediateWidth | ( | ) | const |
Returns the bit width of the inline immediate word.
Definition at line 160 of file Bus.cc.
References immWidth_.
Referenced by BEMGenerator::addEncodings(), DefaultICGenerator::addICToNetlist(), MachineInfo::canEncodeImmediateInteger(), MachineConnectivityCheck::canTransportImmediate(), MachineConnectivityCheck::canWriteAllImmediates(), BEMValidator::checkSourceField(), DefaultDecoderGenerator::completeDecoderBlock(), TTAProgram::ProgramWriter::createCodeSection(), DefaultICGenerator::createSignalsForIC(), TTAProgram::TPEFProgramFactory::createTerminal(), ProGe::RV32MicroCodeGenerator::findConnectedBusses(), DefaultICGenerator::generateSocketsAndMuxes(), ProDeBusEditPolicy::getCommand(), isArchitectureEqual(), CompiledSimSymbolGenerator::moveOperandSymbol(), BEMValidator::needsSourceField(), SimProgramBuilder::processMove(), BusBroker::setupResourceLinks(), DefaultICGenerator::simmPortWidth(), DefaultDecoderGenerator::simmPortWidth(), DefaultDecoderGenerator::writeBusControlRulesOfSImmSocketOfBus(), DefaultDecoderGenerator::writeControlRegisterMappings(), DefaultICGenerator::writeInterconnectionNetwork(), DefaultDecoderGenerator::writeRulesForSourceControlSignals(), and DefaultDecoderGenerator::writeSocketCntrlSignals().
|
virtual |
Checks is this bus architecture equal with the given bus.
Architecture equality means that buses have same widths, immediate widths, extension modes, number of segments and same guards. Bridges are not checked.
bus | Bus to compare with. |
Definition at line 1111 of file Bus.cc.
References guard(), guardCount(), immediateWidth(), TTAMachine::Guard::isEqual(), segmentCount(), signExtends(), and width().
Referenced by MachineResourceModifier::analyzeBuses().
|
virtual |
Returns true if the bus is connected to the given socket, otherwise false.
socket | Socket. |
Definition at line 303 of file Bus.cc.
References segments_.
Referenced by DefaultICDecoderEstimator::busParameters().
|
virtual |
Loads the state of the object from the given ObjectState instance.
state | The ObjectState instance. |
ObjectStateLoadingException | If the name of this bus becomes the same as an existing bus in the same machine or if generating references to other components did not succeed. |
Reimplemented from TTAMachine::Component.
Definition at line 816 of file Bus.cc.
References ObjectState::child(), ObjectState::childCount(), deleteAllGuards(), deleteAllSegments(), Exception::errorMessage(), TTAMachine::Segment::loadState(), loadStateWithoutReferences(), ObjectState::name(), TTAMachine::Segment::OSKEY_NAME, TTAMachine::PortGuard::OSNAME_PORT_GUARD, TTAMachine::RegisterGuard::OSNAME_REGISTER_GUARD, TTAMachine::Segment::OSNAME_SEGMENT, TTAMachine::UnconditionalGuard::OSNAME_UNCONDITIONAL_GUARD, segment(), and ObjectState::stringAttribute().
Referenced by TTAMachine::Machine::loadState().
|
private |
Loads the state of the object from the given ObjectState tree without references to other components/subcomponents.
state | Root node of the ObjectState tree. |
ObjectStateLoadingException | If a bus by the same name is already registered to the same machine or if the given ObjectState tree is invalid. |
Definition at line 863 of file Bus.cc.
References adjustSegmentChain(), ObjectState::child(), ObjectState::childCount(), Exception::errorMessage(), ObjectState::intAttribute(), TTAMachine::Component::loadState(), ObjectState::name(), TTAMachine::Component::name(), OSKEY_EXTENSION, OSKEY_IMMWIDTH, TTAMachine::Segment::OSKEY_NAME, OSKEY_WIDTH, OSNAME_BUS, TTAMachine::Segment::OSNAME_SEGMENT, OSVALUE_SIGN, OSVALUE_ZERO, setImmediateWidth(), setSignExtends(), setWidth(), setZeroExtends(), ObjectState::stringAttribute(), Texts::TextGenerator::text(), and MOMTextGenerator::TXT_SEGMENT_WITH_SAME_NAME.
Referenced by Bus(), and loadState().
|
private |
Returns a bridge that joins this bus and the next bus of this bus.
If there is two such bridges, returns one of them. If there is no such a bridge, returns NULL.
Definition at line 965 of file Bus.cc.
References destinationBridges_, and sourceBridges_.
Referenced by hasNextBus(), and nextBus().
|
private |
Returns a bridge that joins this bus and the next bus of this bus.
Returns NULL if such a bridge does not exist.
bridge | The bridge table to look for the bridge. |
Definition at line 1005 of file Bus.cc.
References TTAMachine::Bridge::previousBus().
|
virtual |
Returns the next bus from the location point of view.
InstanceNotFound | If the bus is the last in the chain. |
Definition at line 501 of file Bus.cc.
References nextBridge(), and TTAMachine::Bridge::nextBus().
Referenced by TTAMachine::Bridge::adjustChainDirection(), MachineTester::areInSameChain(), MachineTester::canBridge(), MachineEditPartFactory::findConnectedBridges(), MachineEditPartFactory::getBusChains(), and BEMValidator::needsSourceField().
|
inline |
|
virtual |
Returns the position of the bus in move slot order.
NotAvailable | If the bus is not registered to a machine. |
Definition at line 127 of file Bus.cc.
References __func__, assert, TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Component::isRegistered(), TTAMachine::Machine::Navigator< ComponentType >::item(), and TTAMachine::Component::machine().
Referenced by BusFactory::createEditPart().
|
private |
Returns a bridge that joins this bus and the previous bus of this bus.
If there is two such bridges, returns one of them. If there is no such a bridge, returns NULL.
Definition at line 947 of file Bus.cc.
References destinationBridges_, and sourceBridges_.
Referenced by hasPreviousBus(), and previousBus().
|
private |
Returns a bridge that joins this bus and the previous bus of this bus.
Returns NULL if such a bridge does not exist.
bridge | The bridge table to look for the bridge. |
Definition at line 983 of file Bus.cc.
References TTAMachine::Bridge::nextBus().
|
virtual |
Returns the previous bus from the location point of view.
InstanceNotFound | If the bus is the first in the chain. |
Definition at line 518 of file Bus.cc.
References previousBridge(), and TTAMachine::Bridge::previousBus().
Referenced by MachineTester::areInSameChain(), MachineTester::canBridge(), MachineEditPartFactory::getBusChains(), BEMValidator::needsSourceField(), and TTAMachine::Bridge::setFirstOfChain().
|
virtual |
Removes the given guard from the bus.
This method should be called by Guard destructor only.
guard | Guard to be removed. |
Definition at line 428 of file Bus.cc.
References assert, guard(), guards_, TTAMachine::Guard::parentBus(), and ContainerTools::removeValueIfExists().
Referenced by TTAMachine::Guard::~Guard().
|
virtual |
Removes the given segment from the bus.
This method should be called by Segment destructor only.
segment | Segment to be removed. |
Definition at line 757 of file Bus.cc.
References assert, TTAMachine::Segment::parentBus(), ContainerTools::removeValueIfExists(), segment(), and segments_.
Referenced by TTAMachine::Segment::~Segment().
|
virtual |
Saves the contents to an ObjectState tree.
Reimplemented from TTAMachine::Component.
Definition at line 773 of file Bus.cc.
References ObjectState::addChild(), extensionMode_, guard(), guardCount(), immWidth_, OSKEY_EXTENSION, OSKEY_IMMWIDTH, OSKEY_WIDTH, OSNAME_BUS, OSVALUE_SIGN, OSVALUE_ZERO, TTAMachine::Guard::saveState(), TTAMachine::Segment::saveState(), TTAMachine::Component::saveState(), segment(), segmentCount(), ObjectState::setAttribute(), ObjectState::setName(), TTAMachine::Machine::SIGN, width_, and TTAMachine::Machine::ZERO.
Referenced by copy().
|
virtual |
Returns the segment which has the given name.
name | Name of the segment. |
InstanceNotFound | If the bus does not contain a segment by the given name. |
Definition at line 365 of file Bus.cc.
References TTAMachine::Component::name(), and segments_.
|
virtual |
Returns the bus segment at a given index.
The index must be greater or equal to 0 and less than the number of segments. The segments are returned in the correct order. Thus, index 0 returns the first segment in the segment chain, index 1 returns its destination segment and so on.
index | Index. |
OutOfRange | If the given index is out of range. |
Definition at line 329 of file Bus.cc.
References TTAMachine::Segment::destinationSegment(), TTAMachine::Segment::hasSourceSegment(), segmentCount(), and segments_.
Referenced by ADFCombiner::addBuses(), SimpleICOptimizer::addConnections(), addSegment(), adjustSegmentChain(), FullyConnectedCheck::attachSocketToAllBusses(), BusBroker::buildResources(), DefaultDecoderGenerator::busCntrlSignalPinOfSocket(), BEMValidator::checkDestinationField(), BEMValidator::checkSourceField(), BusFactory::createEditPart(), ADFCombiner::createPortsAndSockets(), BlocksTranslator::Deinitialize(), TTAMachine::Socket::detachBus(), InfoBussesCommand::execute(), VLIWConnectIC::explore(), CostEstimator::Estimator::findAllICPaths(), DefaultICGenerator::inputSockets(), DefaultICGenerator::isBusConnected(), TTAMachine::Socket::isConnectedTo(), ProgrammabilityValidator::listConnections(), TTAMachine::Socket::loadState(), loadState(), CostEstimator::Estimator::longestPath(), BEMValidator::needsSourceField(), operator Segment &(), DefaultICGenerator::outputSockets(), removeSegment(), saveState(), TTAMachine::Segment::Segment(), TTAMachine::Segment::setName(), BusBroker::setupResourceLinks(), BEMGenerator::socket(), FullyConnectedCheck::socketAttachedToAllBusses(), BEMGenerator::socketCount(), ConnectionSweeper::sweepBypasses(), ConnectionSweeper::sweepRFs(), SocketDialog::updateConnected(), DefaultDecoderGenerator::writeControlRulesOfFUInputPort(), and DefaultDecoderGenerator::writeControlRulesOfRFWritePort().
|
virtual |
Returns the number of segments in this bus.
Definition at line 385 of file Bus.cc.
References segments_.
Referenced by ADFCombiner::addBuses(), SimpleICOptimizer::addConnections(), adjustSegmentChain(), FullyConnectedCheck::attachSocketToAllBusses(), BusBroker::buildResources(), BEMValidator::checkDestinationField(), BEMValidator::checkSourceField(), BusFactory::createEditPart(), TTAMachine::Socket::detachBus(), InfoBussesCommand::execute(), CostEstimator::Estimator::findAllICPaths(), DefaultICGenerator::inputSockets(), isArchitectureEqual(), DefaultICGenerator::isBusConnected(), TTAMachine::Socket::isConnectedTo(), ProgrammabilityValidator::listConnections(), BEMValidator::needsSourceField(), DefaultICGenerator::outputSockets(), saveState(), TTAMachine::Segment::Segment(), segment(), TTAMachine::Segment::setName(), BusBroker::setupResourceLinks(), BEMGenerator::socket(), FullyConnectedCheck::socketAttachedToAllBusses(), BEMGenerator::socketCount(), SocketDialog::updateConnected(), and DefaultICGenerator::verifyCompatibility().
|
virtual |
Adds a destination bridge for the bus.
This method can be called from methods of Bridge only. Do not call this method.
bridge | The destination bridge to add. |
Definition at line 613 of file Bus.cc.
References assert, destinationBridges_, and TTAMachine::Bridge::sourceBus().
Referenced by TTAMachine::Bridge::setSourceAndDestination().
|
virtual |
|
virtual |
Sets the number of bits of inline immediates.
width | The bit width of inline immediates. |
OutOfRange | If the given width is negative or greater than the bit width of the bus. |
Definition at line 241 of file Bus.cc.
References immWidth_, and width().
Referenced by VLIWConnectIC::explore(), and loadStateWithoutReferences().
|
virtual |
Registers the bus to a machine.
mach | Machine to which the bus is going to be registered. |
ComponentAlreadyExists | If the given machine already has another bus by the same name. |
Implements TTAMachine::Component.
Definition at line 671 of file Bus.cc.
References TTAMachine::Machine::addBus(), and TTAMachine::Component::internalSetMachine().
Referenced by AddBusCmd::Do().
|
virtual |
Sets the name of the bus.
name | Name of the bus. |
ComponentAlreadyExists | If a bus with the given name is already in the same machine. |
InvalidName | If the given name is not a valid component name. |
Reimplemented from TTAMachine::Component.
Definition at line 196 of file Bus.cc.
References TTAMachine::Component::machine(), TTAMachine::Component::name(), and TTAMachine::Component::setName().
Referenced by ADFCombiner::addBuses(), and MachineResourceModifier::addBusesByAmount().
|
virtual |
Sets the sign extension mode.
Definition at line 262 of file Bus.cc.
References extensionMode_, and TTAMachine::Machine::SIGN.
Referenced by loadStateWithoutReferences().
|
virtual |
Adds a source bridge for the bus.
This method can be called from methods of Bridge only. Do not call this method.
bridge | The source bridge to add. |
Definition at line 594 of file Bus.cc.
References assert, TTAMachine::Bridge::destinationBus(), and sourceBridges_.
Referenced by TTAMachine::Bridge::setSourceAndDestination().
|
virtual |
Sets the bit width of the bus.
width | The new bit width of the bus. |
OutOfRange | If the given width is less or equal to zero or if there is an instruction template that has greater bit width for this slot. |
Definition at line 223 of file Bus.cc.
References width(), and width_.
Referenced by loadStateWithoutReferences().
|
virtual |
Sets the zero extension mode.
Definition at line 253 of file Bus.cc.
References extensionMode_, and TTAMachine::Machine::ZERO.
Referenced by loadStateWithoutReferences().
bool TTAMachine::Bus::signExtends | ( | ) | const |
Returns true if the bus uses sign extension.
Definition at line 171 of file Bus.cc.
References extensionMode_, and TTAMachine::Machine::SIGN.
Referenced by MachineInfo::canEncodeImmediateInteger(), MachineConnectivityCheck::canTransportImmediate(), TTAProgram::ProgramWriter::createCodeSection(), POMDisassembler::createMove(), ProDeBusEditPolicy::getCommand(), isArchitectureEqual(), CompiledSimSymbolGenerator::moveOperandSymbol(), SimProgramBuilder::processMove(), BusBroker::setupResourceLinks(), DefaultICGenerator::simmPortWidth(), DefaultDecoderGenerator::simmPortWidth(), DefaultDecoderGenerator::writeBusControlRulesOfSImmSocketOfBus(), DefaultICGenerator::writeInterconnectionNetwork(), and DefaultDecoderGenerator::writeSimmDataSignal().
|
virtual |
Removes registration of the bus from its current machine.
Detaches all the sockets attached to the bus and deletes all the guards and modifies instruction templates to not use this bus.
Implements TTAMachine::Component.
Definition at line 683 of file Bus.cc.
References TTAMachine::Machine::bridgeNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Machine::instructionTemplateNavigator(), TTAMachine::Component::internalUnsetMachine(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), TTAMachine::Component::name(), TTAMachine::Machine::removeBus(), TTAMachine::InstructionTemplate::removeSlot(), and segments_.
Referenced by ~Bus().
int TTAMachine::Bus::width | ( | ) | const |
Returns the bit width of the bus.
Definition at line 149 of file Bus.cc.
References width_.
Referenced by ImmediateGenerator::addSplitInsTemplate(), MachineStateBuilder::buildMachineState(), BusBroker::buildResources(), Bus(), MachineInfo::canEncodeImmediateInteger(), ProGe::RV32MicroCodeGenerator::constructBInstructions(), ProGe::RV32MicroCodeGenerator::constructIInstructions(), ProGe::RV32MicroCodeGenerator::constructSInstructions(), ProGe::RV32MicroCodeGenerator::constructUJInstructions(), SegmentFactory::createEditPart(), DefaultICGenerator::createSignalsForIC(), MachineResourceManager::findBusWidth(), ProgrammabilityValidator::findGlobalConnectionRegister(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), ProDeBusEditPolicy::getCommand(), isArchitectureEqual(), SimProgramBuilder::processMove(), setImmediateWidth(), setWidth(), DefaultICGenerator::simmPortWidth(), DefaultDecoderGenerator::simmPortWidth(), DefaultICDecoderEstimator::socketParameters(), PostpassOperandSharer::tryRemoveOperandWrite(), DefaultICGenerator::writeBusDumpCode(), and DefaultICGenerator::writeInterconnectionNetwork().
bool TTAMachine::Bus::zeroExtends | ( | ) | const |
Returns true if the bus uses zero extension.
Definition at line 182 of file Bus.cc.
References extensionMode_, and TTAMachine::Machine::ZERO.
Referenced by CompiledSimSymbolGenerator::moveOperandSymbol(), DefaultICGenerator::simmPortWidth(), DefaultDecoderGenerator::simmPortWidth(), and DefaultICGenerator::writeInterconnectionNetwork().
|
private |
Contains the destination bridges (max 2).
Definition at line 162 of file Bus.hh.
Referenced by canWrite(), clearDestinationBridge(), nextBridge(), previousBridge(), and setDestinationBridge().
|
private |
Extension mode applied to the inline immediate word.
Definition at line 152 of file Bus.hh.
Referenced by saveState(), setExtensionMode(), setSignExtends(), setZeroExtends(), signExtends(), and zeroExtends().
|
private |
Contains all guards of the bus.
Definition at line 155 of file Bus.hh.
Referenced by addGuard(), deleteAllGuards(), guard(), guardCount(), hasGuard(), and removeGuard().
|
private |
Bit width of the inline immediate word.
Definition at line 150 of file Bus.hh.
Referenced by immediateWidth(), saveState(), and setImmediateWidth().
|
static |
ObjectState attribute key for extension mode.
Definition at line 122 of file Bus.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for immediate width.
Definition at line 120 of file Bus.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for bus width.
Definition at line 118 of file Bus.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState name for Bus ObjectState.
Definition at line 116 of file Bus.hh.
Referenced by TTAMachine::Machine::loadState(), loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute value for sign extension.
Definition at line 124 of file Bus.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
static |
ObjectState attribute key for zero extension.
Definition at line 126 of file Bus.hh.
Referenced by loadStateWithoutReferences(), and saveState().
|
private |
Contains all the segments of the bus.
Definition at line 157 of file Bus.hh.
Referenced by addSegment(), deleteAllSegments(), hasSegment(), isConnectedTo(), removeSegment(), segment(), segmentCount(), and unsetMachine().
|
private |
Contains the source bridges (max 2).
Definition at line 160 of file Bus.hh.
Referenced by canRead(), clearSourceBridge(), nextBridge(), previousBridge(), and setSourceBridge().
|
private |
Bit width of the bus.
Definition at line 148 of file Bus.hh.
Referenced by saveState(), setWidth(), and width().