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

#include <ControlUnit.hh>

Inheritance diagram for TTAMachine::ControlUnit:
Inheritance graph
Collaboration diagram for TTAMachine::ControlUnit:
Collaboration graph

Public Member Functions

 ControlUnit (const std::string &name, int delaySlots, int globalGuardLatency)
 
 ControlUnit (const ObjectState *state)
 
virtual ~ControlUnit ()
 
virtual ControlUnitcopy () const
 
virtual void setMachine (Machine &mach)
 
virtual void unsetMachine ()
 
int delaySlots () const
 
void setDelaySlots (int delaySlots)
 
int globalGuardLatency () const
 
void setGlobalGuardLatency (int latency)
 
int specialRegisterPortCount () const
 
bool hasSpecialRegisterPort (const std::string &name) const
 
SpecialRegisterPortspecialRegisterPort (int index) const
 
SpecialRegisterPortspecialRegisterPort (const std::string &name) const
 
void setReturnAddressPort (const SpecialRegisterPort &port)
 
void unsetReturnAddressPort ()
 
bool hasReturnAddressPort () const
 
SpecialRegisterPortreturnAddressPort () const
 
virtual ObjectStatesaveState () const
 
virtual void loadState (const ObjectState *state)
 
- Public Member Functions inherited from TTAMachine::FunctionUnit
 FunctionUnit (const std::string &name)
 
 FunctionUnit (const ObjectState *state)
 
virtual ~FunctionUnit ()
 
virtual void setName (const std::string &name)
 
virtual BaseFUPortport (const std::string &name) const
 
virtual BaseFUPortport (int index) const
 
virtual int operationPortCount () const
 
virtual bool hasOperationPort (const std::string &name) const
 
virtual FUPortoperationPort (const std::string &name) const
 
virtual FUPortoperationPort (int index) const
 
virtual BaseFUPorttriggerPort () const
 
virtual void addOperation (HWOperation &operation)
 
virtual void deleteOperation (HWOperation &operation)
 
virtual bool hasOperation (const std::string &name) const
 
virtual bool hasOperationLowercase (const std::string &name) const
 
virtual HWOperationoperation (const std::string &name) const
 
virtual HWOperationoperationLowercase (const std::string &name) const
 
virtual HWOperationoperation (int index) const
 
virtual int operationCount () const
 
virtual void operationNames (TCETools::CIStringSet &opNames) const
 
virtual int maxLatency () const
 
virtual void addPipelineElement (PipelineElement &element)
 
virtual void deletePipelineElement (PipelineElement &element)
 
virtual int pipelineElementCount () const
 
virtual PipelineElementpipelineElement (int index) const
 
virtual bool hasPipelineElement (const std::string &name) const
 
virtual PipelineElementpipelineElement (const std::string &name) const
 
virtual AddressSpaceaddressSpace () const
 
virtual void setAddressSpace (AddressSpace *as)
 
virtual bool hasAddressSpace () const
 
virtual void cleanup (const std::string &resource)
 
virtual bool isArchitectureEqual (const FunctionUnit *fu, const bool checkPortWidths=true) const
 
bool needsConflictDetection () const
 
virtual int orderNumber () const
 
virtual void setOrderNumber (int)
 
- 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
 
- Public Member Functions inherited from TTAMachine::Component
virtual ~Component ()
 
virtual TCEString name () const
 
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_CONTROL_UNIT = "control_unit"
 ObjectState name for ControlUnit.
 
static const std::string OSKEY_DELAY_SLOTS = "d_slots"
 ObjectState attribute key for the number of delay slots.
 
static const std::string OSKEY_GUARD_LATENCY = "g_latency"
 ObjectState attribute key for the global guard latency.
 
static const std::string OSKEY_RA_PORT = "ra_port"
 ObjectState attribute key for the name of the return address port.
 
- Static Public Attributes inherited from TTAMachine::FunctionUnit
static const std::string OSNAME_FU = "fu"
 ObjectState name for function unit.
 
static const std::string OSKEY_AS = "as"
 ObjectState attribute key for name of the address space.
 
static const std::string OSKEY_ORDER_NUMBER = "order_no"
 ObjectState attribute key for FU order number name.
 
- 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

virtual void removePort (Port &port)
 
- Protected Member Functions inherited from TTAMachine::FunctionUnit
void unsetMachineDerived ()
 
- Protected Member Functions inherited from TTAMachine::Unit
 Unit (const std::string &name)
 
 Unit (const ObjectState *state)
 
- 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)
 

Static Private Member Functions

static bool hasLocalGuardLatencyOfZero (const Machine &machine)
 

Private Attributes

int delaySlots_
 Number of delay instruction slots on the transport pipeline.
 
int globalGuardLatency_
 The global guard latency.
 
SpecialRegisterPortraPort_
 The return address port.
 

Detailed Description

Represents the global control unit in the machine.

Definition at line 50 of file ControlUnit.hh.

Constructor & Destructor Documentation

◆ ControlUnit() [1/2]

TTAMachine::ControlUnit::ControlUnit ( const std::string &  name,
int  delaySlots,
int  globalGuardLatency 
)

Constructor.

Parameters
nameName of the control unit.
delaySlotsNumber of delay instruction slots of the transport pipeline.
globalGuardLatencyThe global guard latency.
Exceptions
OutOfRangeIf some of the given values is out of valid range.
InvalidNameIf the given name is not a valid component name.

Definition at line 61 of file ControlUnit.cc.

66 raPort_(NULL) {
69}
virtual TCEString name() const
void setGlobalGuardLatency(int latency)
int globalGuardLatency_
The global guard latency.
void setDelaySlots(int delaySlots)
int globalGuardLatency() const
int delaySlots_
Number of delay instruction slots on the transport pipeline.
SpecialRegisterPort * raPort_
The return address port.
FunctionUnit(const std::string &name)

References delaySlots(), globalGuardLatency(), setDelaySlots(), and setGlobalGuardLatency().

Here is the call graph for this function:

◆ ControlUnit() [2/2]

TTAMachine::ControlUnit::ControlUnit ( const ObjectState state)

Constructor.

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

Parameters
stateThe ObjectState instance from which the name is taken.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance is invalid.

Definition at line 81 of file ControlUnit.cc.

82 : FunctionUnit(state),
83 delaySlots_(0),
85 raPort_(NULL) {
87}
void loadStateWithoutReferences(const ObjectState *state)

References loadStateWithoutReferences().

Here is the call graph for this function:

◆ ~ControlUnit()

TTAMachine::ControlUnit::~ControlUnit ( )
virtual

Destructor.

Definition at line 92 of file ControlUnit.cc.

92 {
94}
virtual void unsetMachine()

References unsetMachine().

Here is the call graph for this function:

Member Function Documentation

◆ copy()

ControlUnit * TTAMachine::ControlUnit::copy ( ) const
virtual

Copies the instance.

Current FunctionUnit state is copied to a new FunctionUnit object.

Returns
Copy of the instance.

Reimplemented from TTAMachine::FunctionUnit.

Definition at line 105 of file ControlUnit.cc.

105 {
106
107 return new ControlUnit(saveState());
108}
virtual ObjectState * saveState() const
ControlUnit(const std::string &name, int delaySlots, int globalGuardLatency)

References saveState().

Referenced by ADFCombiner::addFunctionUnits().

Here is the call graph for this function:

◆ delaySlots()

int TTAMachine::ControlUnit::delaySlots ( ) const

◆ globalGuardLatency()

int TTAMachine::ControlUnit::globalGuardLatency ( ) const

◆ hasLocalGuardLatencyOfZero()

bool TTAMachine::ControlUnit::hasLocalGuardLatencyOfZero ( const Machine machine)
staticprivate

Tells whether the given machine has a guard that reads a register with local guard latency of zero.

Parameters
machineThe machine.
Returns
True if the machine has the guard, otherwise false.

Definition at line 411 of file ControlUnit.cc.

411 {
413 for (int i = 0; i < busNav.count(); i++) {
414 Bus* bus = busNav.item(i);
415 for (int i = 0; i < bus->guardCount(); i++) {
416 Guard* guard = bus->guard(i);
417 RegisterGuard* regGuard =
418 dynamic_cast<RegisterGuard*>(guard);
419 if (regGuard != NULL) {
420 const RegisterFile* rf = regGuard->registerFile();
421 if (rf->guardLatency() == 0) {
422 return true;
423 }
424 }
425 }
426 }
427 return false;
428}
virtual Machine * machine() const
ComponentType * item(int index) const
Navigator< Bus > BusNavigator
Navigator type for BusNavigator.
Definition Machine.hh:213
virtual BusNavigator busNavigator() const
Definition Machine.cc:356

References TTAMachine::Machine::busNavigator(), TTAMachine::Machine::Navigator< ComponentType >::count(), TTAMachine::Bus::guard(), TTAMachine::Bus::guardCount(), TTAMachine::RegisterFile::guardLatency(), TTAMachine::Machine::Navigator< ComponentType >::item(), TTAMachine::Component::machine(), and TTAMachine::RegisterGuard::registerFile().

Referenced by setGlobalGuardLatency(), and setMachine().

Here is the call graph for this function:

◆ hasReturnAddressPort()

bool TTAMachine::ControlUnit::hasReturnAddressPort ( ) const

◆ hasSpecialRegisterPort()

bool TTAMachine::ControlUnit::hasSpecialRegisterPort ( const std::string &  name) const

Tells whether the control unit has a special register port of the given name.

Returns
True if the control unit has the port, otherwise false.

Definition at line 197 of file ControlUnit.cc.

197 {
198 return hasPort(name) && !hasOperationPort(name);
199}
virtual bool hasOperationPort(const std::string &name) const
virtual bool hasPort(const std::string &name) const
Definition Unit.cc:96

References TTAMachine::FunctionUnit::hasOperationPort(), TTAMachine::Unit::hasPort(), and TTAMachine::Component::name().

Referenced by GCUDialog::onEditPort(), and GCUDialog::updatePortList().

Here is the call graph for this function:

◆ loadState()

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

Loads its state from the given ObjectState instance.

Parameters
stateThe ObjectState instance.
Exceptions
ObjectStateLoadingExceptionIf the given ObjectState instance invalid or if connections to other machine parts cannot be made.

Reimplemented from TTAMachine::FunctionUnit.

Definition at line 351 of file ControlUnit.cc.

351 {
354}
virtual void loadState(const ObjectState *state)

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

Referenced by TTAMachine::Machine::loadState(), GCUDialog::onAddOperation(), and GCUDialog::onEditOperation().

Here is the call graph for this function:

◆ loadStateWithoutReferences()

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

Loads the state of the control unit without references to other components.

Parameters
stateThe ObjectState instance from which the state is loaded.
Exceptions
ObjectStateLoadingExceptionIf an error occurs while loading the state.

Definition at line 380 of file ControlUnit.cc.

380 {
381 const string procName = "ControlUnit::loadStateWithoutReferences";
382
383 if (state->name() != OSNAME_CONTROL_UNIT) {
384 throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
385 }
386
387 try {
390 if (state->hasAttribute(OSKEY_RA_PORT)) {
391 string portName = state->stringAttribute(OSKEY_RA_PORT);
393 } else {
395 }
396
397 } catch (Exception& e) {
398 throw ObjectStateLoadingException(__FILE__, __LINE__, procName,
399 e.errorMessage());
400 }
401}
std::string errorMessage() const
Definition Exception.cc:123
bool hasAttribute(const std::string &name) const
std::string stringAttribute(const std::string &name) const
int intAttribute(const std::string &name) const
std::string name() const
SpecialRegisterPort * specialRegisterPort(int index) const
static const std::string OSNAME_CONTROL_UNIT
ObjectState name for ControlUnit.
static const std::string OSKEY_DELAY_SLOTS
ObjectState attribute key for the number of delay slots.
void setReturnAddressPort(const SpecialRegisterPort &port)
static const std::string OSKEY_GUARD_LATENCY
ObjectState attribute key for the global guard latency.
static const std::string OSKEY_RA_PORT
ObjectState attribute key for the name of the return address port.

References Exception::errorMessage(), ObjectState::hasAttribute(), ObjectState::intAttribute(), ObjectState::name(), OSKEY_DELAY_SLOTS, OSKEY_GUARD_LATENCY, OSKEY_RA_PORT, OSNAME_CONTROL_UNIT, setDelaySlots(), setGlobalGuardLatency(), setReturnAddressPort(), specialRegisterPort(), ObjectState::stringAttribute(), and unsetReturnAddressPort().

Referenced by ControlUnit(), and loadState().

Here is the call graph for this function:

◆ removePort()

void TTAMachine::ControlUnit::removePort ( Port port)
protectedvirtual

Removes the given port from the control unit and unsets the binding of return address port if necessary.

Parameters
portThe port to be removed.

Reimplemented from TTAMachine::Unit.

Definition at line 363 of file ControlUnit.cc.

363 {
364 if (&port == raPort_) {
366 }
368}
virtual BaseFUPort * port(const std::string &name) const
virtual void removePort(Port &port)
Definition Unit.cc:235

References TTAMachine::FunctionUnit::port(), raPort_, TTAMachine::Unit::removePort(), and unsetReturnAddressPort().

Here is the call graph for this function:

◆ returnAddressPort()

SpecialRegisterPort * TTAMachine::ControlUnit::returnAddressPort ( ) const

Returns the return address port.

Returns
The return address port.
Exceptions
InstanceNotFoundIf there is no return address port.

Definition at line 307 of file ControlUnit.cc.

307 {
308 if (raPort_ != NULL) {
309 return raPort_;
310 } else {
311 const string procName = "ControlUnit::returnAddressPort";
312 throw InstanceNotFound(__FILE__, __LINE__, procName);
313 }
314}

References raPort_.

Referenced by RegisterCopyAdder::addConnectionRegisterCopies(), ProGe::NetlistGenerator::addGCUToNetlist(), DefaultICGenerator::addICToNetlist(), ProGe::RV32MicroCodeGenerator::addIPorts(), ProGe::RV32MicroCodeGenerator::addUJPorts(), InputFUBroker::assign(), OutputFUBroker::assign(), MachineStateBuilder::buildMachineState(), MachineConnectivityCheck::busConnectedToDestination(), MachineValidator::checkIMemAddrWidth(), MachineValidator::checkRAPortHasSameWidthAsPCPort(), DefaultDecoderGenerator::completeDecoderBlock(), TTAProgram::CodeGenerator::createTerminalFUPort(), TTAProgram::TPEFProgramFactory::findPort(), MachineConnectivityCheck::findPossibleDestinationPorts(), MachineConnectivityCheck::findPossibleSourcePorts(), TTAProgram::TPEFResourceUpdater::functionUnitPort(), CopyingDelaySlotFiller::getMove(), CallsToJumps::handleControlFlowGraph(), ProGe::ProcessorGenerator::iMemAddressWidth(), MachineConnectivityCheck::raConnected(), ProGe::ProGeUI::readImemParameters(), CompiledSimSymbolGenerator::returnAddressSymbol(), saveState(), SimulatorFrontend::state(), GCUDialog::updateRAPortChoice(), and DefaultDecoderGenerator::writeControlRegisterMappings().

◆ saveState()

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

Saves the contents to an ObjectState tree.

Returns
The newly created ObjectState tree.

Reimplemented from TTAMachine::FunctionUnit.

Definition at line 322 of file ControlUnit.cc.

322 {
323
326
327 // set delay slots
329
330 // set global guard latency
332
333 // set return address port
334 if (hasReturnAddressPort()) {
336 }
337
338 return cUnit;
339}
void setName(const std::string &name)
void setAttribute(const std::string &name, const std::string &value)
SpecialRegisterPort * returnAddressPort() const
bool hasReturnAddressPort() const
virtual ObjectState * saveState() const

References delaySlots_, globalGuardLatency_, hasReturnAddressPort(), TTAMachine::Component::name(), OSKEY_DELAY_SLOTS, OSKEY_GUARD_LATENCY, OSKEY_RA_PORT, OSNAME_CONTROL_UNIT, returnAddressPort(), TTAMachine::FunctionUnit::saveState(), ObjectState::setAttribute(), and ObjectState::setName().

Referenced by copy(), GCUDialog::onAddOperation(), GCUDialog::onEditOperation(), and TTAMachine::Machine::saveState().

Here is the call graph for this function:

◆ setDelaySlots()

void TTAMachine::ControlUnit::setDelaySlots ( int  delaySlots)

Definition at line 145 of file ControlUnit.cc.

145 {
146 if (delaySlots < 0) {
147 throw OutOfRange(__FILE__, __LINE__, __func__);
148 }
150}
#define __func__

References __func__, delaySlots(), and delaySlots_.

Referenced by ControlUnit(), loadStateWithoutReferences(), and GCUDialog::onOK().

Here is the call graph for this function:

◆ setGlobalGuardLatency()

void TTAMachine::ControlUnit::setGlobalGuardLatency ( int  latency)

Sets the global guard latency.

Parameters
latencyThe new latency.
Exceptions
OutOfRangeIf the given latency is negative.

Definition at line 159 of file ControlUnit.cc.

159 {
160 if (latency < 0) {
161 throw OutOfRange(__FILE__, __LINE__, __func__);
162 }
163
164 // if latency is zero, there must not be a guard term that reads a
165 // registr of a register file with local guard latency of zero
166 if (latency == 0 && isRegistered()) {
168 MOMTextGenerator textGen;
169 boost::format text = textGen.text(
171 throw OutOfRange(
172 __FILE__, __LINE__, __func__, text.str());
173 }
174 }
175
176 globalGuardLatency_ = latency;
177}
virtual bool isRegistered() const
static bool hasLocalGuardLatencyOfZero(const Machine &machine)
virtual boost::format text(int textId)

References __func__, globalGuardLatency_, hasLocalGuardLatencyOfZero(), TTAMachine::Component::isRegistered(), TTAMachine::Component::machine(), Texts::TextGenerator::text(), and MOMTextGenerator::TXT_INVALID_GUARD_LATENCY.

Referenced by ControlUnit(), loadStateWithoutReferences(), GCUDialog::onOK(), TTAMachine::RegisterFile::setGuardLatency(), and setMachine().

Here is the call graph for this function:

◆ setMachine()

void TTAMachine::ControlUnit::setMachine ( Machine mach)
virtual

Attaches the control unit to machine.

Parameters
machThe machine.
Exceptions
ComponentAlreadyExistsIf the given machine already has a global control unit.

Reimplemented from TTAMachine::Unit.

Definition at line 119 of file ControlUnit.cc.

119 {
120 // if global guard latency is zero, there cannot be a register guard
121 // that reads a register of local guard latency zero
124 }
125
126 internalSetMachine(mach);
127 mach.setGlobalControl(*this);
128}
void internalSetMachine(Machine &machine)

References globalGuardLatency(), hasLocalGuardLatencyOfZero(), TTAMachine::Component::internalSetMachine(), TTAMachine::Machine::setGlobalControl(), and setGlobalGuardLatency().

Referenced by AddGCUCmd::Do(), PasteComponentCmd::Do(), and TTAMachine::Machine::setGlobalControl().

Here is the call graph for this function:

◆ setReturnAddressPort()

void TTAMachine::ControlUnit::setReturnAddressPort ( const SpecialRegisterPort port)

Binds the given port to return address port.

If there is another port bound to return address port already, unbinds it.

Parameters
portThe port to be bound.
Exceptions
IllegalRegistrationIf the given port is not a port of this control unit.

Definition at line 271 of file ControlUnit.cc.

271 {
272 if (port.parentUnit() != this) {
273 const string procName = "ControlUnit::setReturnAddressPort";
274 throw IllegalRegistration(__FILE__, __LINE__, procName);
275 }
276
277 raPort_ = const_cast<SpecialRegisterPort*>(&port);
278}
FunctionUnit * parentUnit() const
Definition BaseFUPort.cc:96

References TTAMachine::BaseFUPort::parentUnit(), TTAMachine::FunctionUnit::port(), and raPort_.

Referenced by BlocksGCU::BlocksGCU(), UniversalMachine::construct(), AddGCUCmd::Do(), CostEstimator::ICDecoderEstimatorPlugin::generateControlUnit(), loadStateWithoutReferences(), and GCUDialog::onRAPortChoice().

Here is the call graph for this function:

◆ specialRegisterPort() [1/2]

SpecialRegisterPort * TTAMachine::ControlUnit::specialRegisterPort ( const std::string &  name) const

Returns a special register port by the given name.

Parameters
nameName of the port.
Returns
A special register port.
Exceptions
InstanceNotFoundIf a special register port does not exist by the given name.

Definition at line 245 of file ControlUnit.cc.

245 {
246 const string procName = "ControlUnit::specialRegisterPort";
247
248 if (!hasPort(name)) {
249 throw InstanceNotFound(
250 __FILE__, __LINE__, procName, "Port not found: " + name);
251 }
252
253 Port* port = this->port(name);
254 SpecialRegisterPort* srPort = dynamic_cast<SpecialRegisterPort*>(port);
255 if (srPort == NULL) {
256 throw InstanceNotFound(__FILE__, __LINE__, procName);
257 }
258 return srPort;
259}

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

Here is the call graph for this function:

◆ specialRegisterPort() [2/2]

SpecialRegisterPort * TTAMachine::ControlUnit::specialRegisterPort ( int  index) const

Returns a special register port by the given index.

Parameters
indexThe index.
Returns
A special register port.
Exceptions
OutOfRangeIf the given index is less than 0 or greater or equal to the number of special register ports.

Definition at line 211 of file ControlUnit.cc.

211 {
212 const string procName = "ControlUnit::specialRegisterPort";
213
214 if (index < 0) {
215 throw OutOfRange(__FILE__, __LINE__, procName);
216 }
217
218 int portCount = this->portCount();
219 int srPortCount(-1);
220
221 for (int i = 0; i < portCount; i++) {
222 BaseFUPort* port = this->port(i);
223 SpecialRegisterPort* srPort =
224 dynamic_cast<SpecialRegisterPort*>(port);
225 if (srPort != NULL) {
226 srPortCount++;
227 if (srPortCount == index) {
228 return srPort;
229 }
230 }
231 }
232
233 throw OutOfRange(__FILE__, __LINE__, procName);
234}
virtual int portCount() const
Definition Unit.cc:135

References TTAMachine::FunctionUnit::port(), and TTAMachine::Unit::portCount().

Referenced by FullyConnectedCheck::check(), FullyConnectedCheck::connectControlUnit(), GCUFactory::createEditPart(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), loadStateWithoutReferences(), GCUDialog::onEditPort(), GCUDialog::onRAPortChoice(), and GCUDialog::updateRAPortChoice().

Here is the call graph for this function:

◆ specialRegisterPortCount()

int TTAMachine::ControlUnit::specialRegisterPortCount ( ) const

Returns the number of special register ports in the control unit.

Returns
The number of special register ports.

Definition at line 185 of file ControlUnit.cc.

185 {
186 return portCount() - operationPortCount();
187}
virtual int operationPortCount() const

References TTAMachine::FunctionUnit::operationPortCount(), and TTAMachine::Unit::portCount().

Referenced by FullyConnectedCheck::check(), FullyConnectedCheck::connectControlUnit(), GCUFactory::createEditPart(), CompiledSimCodeGenerator::generateHeaderAndMainCode(), and GCUDialog::updateRAPortChoice().

Here is the call graph for this function:

◆ unsetMachine()

void TTAMachine::ControlUnit::unsetMachine ( )
virtual

Detaches the control unit from machine.

Reimplemented from TTAMachine::FunctionUnit.

Definition at line 134 of file ControlUnit.cc.

134 {
135 if (!isRegistered()) {
136 return;
137 } else {
138 Machine* mach = machine();
140 mach->unsetGlobalControl();
141 }
142}

References TTAMachine::Component::isRegistered(), TTAMachine::Component::machine(), TTAMachine::Machine::unsetGlobalControl(), and TTAMachine::FunctionUnit::unsetMachineDerived().

Referenced by TTAMachine::Machine::unsetGlobalControl(), and ~ControlUnit().

Here is the call graph for this function:

◆ unsetReturnAddressPort()

void TTAMachine::ControlUnit::unsetReturnAddressPort ( )

Unbinds the return address port if one exists.

Definition at line 284 of file ControlUnit.cc.

284 {
285 raPort_ = NULL;
286}

References raPort_.

Referenced by loadStateWithoutReferences(), GCUDialog::onRAPortChoice(), and removePort().

Member Data Documentation

◆ delaySlots_

int TTAMachine::ControlUnit::delaySlots_
private

Number of delay instruction slots on the transport pipeline.

Definition at line 98 of file ControlUnit.hh.

Referenced by saveState(), and setDelaySlots().

◆ globalGuardLatency_

int TTAMachine::ControlUnit::globalGuardLatency_
private

The global guard latency.

Definition at line 101 of file ControlUnit.hh.

Referenced by saveState(), and setGlobalGuardLatency().

◆ OSKEY_DELAY_SLOTS

const string TTAMachine::ControlUnit::OSKEY_DELAY_SLOTS = "d_slots"
static

ObjectState attribute key for the number of delay slots.

Definition at line 84 of file ControlUnit.hh.

Referenced by ADFSerializer::controlUnitToMachine(), ADFSerializer::controlUnitToMDF(), loadStateWithoutReferences(), and saveState().

◆ OSKEY_GUARD_LATENCY

const string TTAMachine::ControlUnit::OSKEY_GUARD_LATENCY = "g_latency"
static

ObjectState attribute key for the global guard latency.

Definition at line 86 of file ControlUnit.hh.

Referenced by ADFSerializer::controlUnitToMachine(), ADFSerializer::controlUnitToMDF(), loadStateWithoutReferences(), and saveState().

◆ OSKEY_RA_PORT

const string TTAMachine::ControlUnit::OSKEY_RA_PORT = "ra_port"
static

ObjectState attribute key for the name of the return address port.

Definition at line 88 of file ControlUnit.hh.

Referenced by ADFSerializer::controlUnitToMachine(), ADFSerializer::controlUnitToMDF(), loadStateWithoutReferences(), and saveState().

◆ OSNAME_CONTROL_UNIT

const string TTAMachine::ControlUnit::OSNAME_CONTROL_UNIT = "control_unit"
static

◆ raPort_

SpecialRegisterPort* TTAMachine::ControlUnit::raPort_
private

The return address port.

Definition at line 103 of file ControlUnit.hh.

Referenced by hasReturnAddressPort(), removePort(), returnAddressPort(), setReturnAddressPort(), and unsetReturnAddressPort().


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