OpenASIP  2.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
MachineTester Class Reference

#include <MachineTester.hh>

Inheritance diagram for MachineTester:
Inheritance graph
Collaboration diagram for MachineTester:
Collaboration graph

Public Member Functions

 MachineTester (const TTAMachine::Machine &machine)
 
virtual ~MachineTester ()
 
virtual bool canConnect (const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
 
virtual bool canConnect (const TTAMachine::Socket &socket, const TTAMachine::Port &port)
 
virtual bool canBridge (const TTAMachine::Bus &source, const TTAMachine::Bus &destination)
 
virtual bool canSetDirection (const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
 
bool connectionExists () const
 
bool illegalRegistration () const
 
bool loop () const
 
TTAMachine::BusbranchedBus () const
 
bool wrongSocketDirection () const
 
bool maxConnections () const
 
bool unknownSocketDirection () const
 
bool noConnections () const
 
TTAMachine::PortsameDirSocketConnection (TTAMachine::Socket::Direction direction) const
 
TTAMachine::PortforbiddenSocketDirection (TTAMachine::Socket::Direction direction) const
 
bool registerFilePortAlreadyConnected () const
 

Static Public Member Functions

static bool isValidComponentName (const std::string &name)
 

Private Member Functions

 MachineTester (const MachineTester &tester)
 
MachineTesteroperator= (const MachineTester &tester)
 
void clearState ()
 
bool legalPortConnections (const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
 

Static Private Member Functions

static bool areInSameChain (const TTAMachine::Bus &bus1, const TTAMachine::Bus &bus2)
 

Private Attributes

const TTAMachine::Machinemachine_
 The machine on which the tests are carried out. More...
 
bool connectionExists_
 Indicates if the reason for the last test failure is that the tested connection already exists. More...
 
bool rfPortAlreadyConnected_
 Indicates if the reason for failure is that a port of register file is already connected to a particular socket. More...
 
bool illegalRegistration_
 Indicates if the reason for last test failure was illegal registration. More...
 
bool loop_
 Indicates if the reason for failure when trying to bridge two busses is that a loop in the bus chain would be created. More...
 
const TTAMachine::BusbranchedBus_
 If the reason for failure when trying to bridge two busses is that a branch in the bus chain would be created, this is the branched bus. More...
 
bool wrongSocketDirection_
 Indicates if the reason for failure when trying to connect a socket to a port was that the direction of the socket is incompatible with the direction of other sockets connected to the port. More...
 
bool maxConnections_
 Indicates if the reason for failure when trying to connect a socket to a port was that this connection would exceed the maximum number of connections allowed for a port. More...
 
bool unknownDir_
 Indicates if tried to set the socket direction to Socket::UNKNOWN. More...
 
bool noConnections_
 Indicates if the reason for failure when tried to set socket direction was that the socket has no segment connections. More...
 
TTAMachine::PortsameDirInputSocketConn_
 If the reason for failure when tried to set socket direction to input was that the socket is connected to a port that already has an input socket connected, this is the port. More...
 
TTAMachine::PortsameDirOutputSocketConn_
 If the reason for failure when tried to set socket direction to output was that the socket is connected to a port that already has an output socket connected, this is the port. More...
 
TTAMachine::PortforbiddenInputSocketDir_
 If the reason for failure when tried to set socket direction to input was the socket is connected to a unit that cannot be connected to an input socket, this is the port of the unit. More...
 

Detailed Description

MachineTester is a class that implements all the API needed for diagnostics of machine model.

Definition at line 46 of file MachineTester.hh.

Constructor & Destructor Documentation

◆ MachineTester() [1/2]

MachineTester::MachineTester ( const TTAMachine::Machine machine)

Constructor.

Parameters
machineThe machine on which the tests are done.

Definition at line 57 of file MachineTester.cc.

57  :
58  machine_(&machine) {
59 
60  clearState();
61 }

References clearState().

Here is the call graph for this function:

◆ ~MachineTester()

MachineTester::~MachineTester ( )
virtual

Destructor.

Definition at line 67 of file MachineTester.cc.

67  {
68 }

◆ MachineTester() [2/2]

MachineTester::MachineTester ( const MachineTester tester)
private

Member Function Documentation

◆ areInSameChain()

bool MachineTester::areInSameChain ( const TTAMachine::Bus bus1,
const TTAMachine::Bus bus2 
)
staticprivate

Checks if the given buses are in the same bus chain.

Parameters
bus1The first bus.
bus2The second bus.
Returns
True if they are in the same chain, otherwise false.

Definition at line 521 of file MachineTester.cc.

521  {
522 
523  if (&bus1 == &bus2) {
524  return true;
525  }
526 
527  const Bus* bus = &bus1;
528  while (bus->hasPreviousBus()) {
529  bus = bus->previousBus();
530  if (bus == &bus2) {
531  return true;
532  }
533  }
534 
535  bus = &bus1;
536  while (bus->hasNextBus()) {
537  bus = bus->nextBus();
538  if (bus == &bus2) {
539  return true;
540  }
541  }
542 
543  return false;
544 }

References TTAMachine::Bus::hasNextBus(), TTAMachine::Bus::hasPreviousBus(), TTAMachine::Bus::nextBus(), and TTAMachine::Bus::previousBus().

Referenced by canBridge().

Here is the call graph for this function:

◆ branchedBus()

Bus * MachineTester::branchedBus ( ) const

If the reason for failure when tried to join two buses by a bridge was a branched bus chain, returns the bus that was going to be branched. Otherwise returns NULL.

Returns
The branched bus.

Definition at line 380 of file MachineTester.cc.

380  {
381  if (branchedBus_ == NULL) {
382  return NULL;
383  } else {
384  return const_cast<Bus*>(branchedBus_);
385  }
386 }

References branchedBus_.

Referenced by MachineTestReporter::bridgingError().

◆ canBridge()

bool MachineTester::canBridge ( const TTAMachine::Bus source,
const TTAMachine::Bus destination 
)
virtual

Checks if the given source and destination buses can be joined by a new bridge.

If the test has negative outcome, the reason for it can be queried using the following functions: illegalRegistration, loop, connectionExists, branchedBus.

Parameters
sourceThe source bus of the bridge.
destinationThe destination bus of the bridge.
Returns
True if the can be created, otherwise false.

Reimplemented in DummyMachineTester.

Definition at line 203 of file MachineTester.cc.

203  {
204 
205  clearState();
206 
207  // check registration of the buses
208  if (source.machine() != machine_ || destination.machine() != machine_) {
209  illegalRegistration_ = true;
210  return false;
211  }
212 
213  if (&source == &destination) {
214  return false;
215  }
216 
217  // check if there already exists an equal bridge
218  if (source.canWrite(destination)) {
219  connectionExists_ = true;
220  return false;
221  } else if (destination.canWrite(source)) {
222  // if an opposite bridge already exists between the buses, the new
223  // bridge can be created
224  return true;
225  }
226 
227  // check if a loop would be created
228 
229  // Buses cannot be joined by a new bridge if they are already in the same
230  // chain and are not adjacent. If they are adjacent then it is possible
231  // to join them in order the create a bidirection bridge.
232  if (areInSameChain(source, destination)) {
233  bool adjacent = false;
234  if (source.hasNextBus()) {
235  if (source.nextBus() == &destination) {
236  adjacent = true;
237  }
238  }
239  if (source.hasPreviousBus()) {
240  if (source.previousBus() == &destination) {
241  adjacent = true;
242  }
243  }
244  if (!adjacent) {
245  loop_ = true;
246  return false;
247  }
248  }
249 
250  // check that a branch will not be created
251  if (source.hasNextBus() && source.hasPreviousBus()) {
252  if (source.nextBus() != &destination &&
253  source.previousBus() != &destination) {
254  branchedBus_ = &source;
255  return false;
256  }
257  }
258  if (destination.hasNextBus() && destination.hasPreviousBus()) {
259  if (destination.nextBus() != &source &&
260  destination.previousBus() != &source) {
261  branchedBus_ = &destination;
262  return false;
263  }
264  }
265 
266  return true;
267 }

References areInSameChain(), branchedBus_, TTAMachine::Bus::canWrite(), clearState(), connectionExists_, TTAMachine::Bus::hasNextBus(), TTAMachine::Bus::hasPreviousBus(), illegalRegistration_, loop_, TTAMachine::Component::machine(), machine_, TTAMachine::Bus::nextBus(), and TTAMachine::Bus::previousBus().

Referenced by TTAMachine::Bridge::Bridge(), AddBridgeCmd::Do(), TTAMachine::Bridge::loadState(), BridgeDialog::onInputBus(), BridgeDialog::onOK(), and BridgeDialog::updateBusChoices().

Here is the call graph for this function:

◆ canConnect() [1/2]

bool MachineTester::canConnect ( const TTAMachine::Socket socket,
const TTAMachine::Port port 
)
virtual

Checks if the given socket can be connected to the given port.

If false is returned, the reason for the test failure can be queried using the following functions: illegalRegistration, connectionExists, wrongSocketDirection, maxConnections.

Parameters
socketThe socket.
portThe port.
Returns
True if the connection can be made, otherwise false.

Reimplemented in DummyMachineTester.

Definition at line 127 of file MachineTester.cc.

127  {
128 
129  clearState();
130 
131  // check registration
132  if (socket.machine() != machine_ ||
133  port.parentUnit()->machine() != machine_) {
134  illegalRegistration_ = true;
135  return false;
136  }
137 
138  // check the existing connections of the port
139  Socket* inputSocket = port.inputSocket();
140  Socket* outputSocket = port.outputSocket();
141  Socket* firstUnconnected = port.unconnectedSocket(0);
142  Socket* secondUnconnected = port.unconnectedSocket(1);
143 
144  if (inputSocket == &socket || outputSocket == &socket ||
145  firstUnconnected == &socket || secondUnconnected == &socket) {
146  connectionExists_ = true;
147  return false;
148  }
149 
150  if ((inputSocket != NULL && socket.direction() == Socket::INPUT) ||
151  (outputSocket != NULL && socket.direction() == Socket::OUTPUT)) {
152  wrongSocketDirection_ = true;
153  return false;
154  }
155  if (port.socketCount() == 2) {
156  maxConnections_ = true;
157  return false;
158  }
159 
160  // check the special cases of allowed socket directions
161  Unit* parentUnit = port.parentUnit();
162  if (dynamic_cast<ImmediateUnit*>(parentUnit) != NULL) {
163  assert(port.socketCount() <= 1);
164  if (port.socketCount() == 1) {
165  maxConnections_ = true;
166  return false;
167  }
168  if (socket.direction() == Socket::INPUT) {
169  wrongSocketDirection_ = true;
170  return false;
171  }
172  }
173 
174  // ports of a register file cannot be connected to same socket
175  RegisterFile* parentRf = dynamic_cast<RegisterFile*>(parentUnit);
176  if (parentRf != NULL) {
177  for (int i = 0; i < parentRf->portCount(); i++) {
178  Port* rfPort = parentRf->port(i);
179  if (rfPort->isConnectedTo(socket)) {
181  return false;
182  }
183  }
184  }
185 
186  return true;
187 }

References assert, clearState(), connectionExists_, TTAMachine::Socket::direction(), illegalRegistration_, TTAMachine::Port::inputSocket(), TTAMachine::Port::isConnectedTo(), TTAMachine::Component::machine(), machine_, maxConnections_, TTAMachine::Port::outputSocket(), TTAMachine::Port::parentUnit(), TTAMachine::BaseRegisterFile::port(), TTAMachine::Unit::portCount(), rfPortAlreadyConnected_, TTAMachine::Port::socketCount(), TTAMachine::Port::unconnectedSocket(), and wrongSocketDirection_.

Here is the call graph for this function:

◆ canConnect() [2/2]

bool MachineTester::canConnect ( const TTAMachine::Socket socket,
const TTAMachine::Segment segment 
)
virtual

Tests if the given socket can be connected to the given segment.

After calling this function, the reason for a test failure can be queried. Functions for querying the possible reasons are: connectionExists, illegalRegistration, sameDirSocketConnection, forbiddenSocketDirection.

Note that only the first reason encountered is recorded.

Parameters
socketThe socket.
segmentThe segment.
Returns
True if the connection can be made.

Reimplemented in DummyMachineTester.

Definition at line 86 of file MachineTester.cc.

86  {
87 
88  clearState();
89 
90  if (socket.machine() != machine_) {
91  illegalRegistration_ = true;
92  return false;
93  }
94  if (segment.parentBus()->machine() != machine_) {
95  illegalRegistration_ = true;
96  return false;
97  }
98  if (socket.isConnectedTo(segment)) {
99  connectionExists_ = true;
100  return false;
101  }
102 
103  // check that the direction of the socket can be set if needed
104  if (socket.segmentCount() == 0) {
105  if (!legalPortConnections(socket, Socket::INPUT) &&
106  !legalPortConnections(socket, Socket::OUTPUT)) {
107  return false;
108  }
109  }
110 
111  return true;
112 }

References clearState(), connectionExists_, illegalRegistration_, TTAMachine::Socket::isConnectedTo(), legalPortConnections(), TTAMachine::Component::machine(), machine_, TTAMachine::Segment::parentBus(), and TTAMachine::Socket::segmentCount().

Referenced by TTAMachine::Socket::attachBus(), TTAMachine::Port::attachSocket(), TTAMachine::Segment::attachSocket(), FullyConnectedCheck::attachSocketToAllBusses(), ProDePortEditPolicy::canHandle(), ProDeSegmentEditPolicy::canHandle(), ProDeSocketEditPolicy::canHandle(), RemoveUnconnectedComponents::checkFUPorts(), RemoveUnconnectedComponents::checkRFPorts(), FullyConnectedCheck::connectFUPort(), FullyConnectedCheck::connectIUPort(), FullyConnectedCheck::connectRFPort(), FullyConnectedCheck::connectSpecialRegisterPort(), SocketDialog::onAttach(), FullyConnectedCheck::socketAttachedToAllBusses(), IUPortDialog::updateSocket(), SRPortDialog::updateSockets(), FUPortDialog::updateSockets(), and RFPortDialog::updateSockets().

Here is the call graph for this function:

◆ canSetDirection()

bool MachineTester::canSetDirection ( const TTAMachine::Socket socket,
TTAMachine::Socket::Direction  direction 
)
virtual

Checks if the direction of the given socket can be set to the given value.

Takes into account the ports that are directly connected to the given socket only. The reason for error can be queried for using the following functions: unknownSocketDirection, noConnections, sameDirSocketConnection, forbiddenSocketDirection.

Parameters
socketThe socket.
directionThe new direction of the socket.
Returns
True if the direction can be set, otherwise false.

Reimplemented in DummyMachineTester.

Definition at line 283 of file MachineTester.cc.

285  {
286 
287  clearState();
288 
289  if (direction == Socket::UNKNOWN) {
290  unknownDir_ = true;
291  return false;
292  }
293  if (socket.segmentCount() == 0) {
294  noConnections_ = true;
295  return false;
296  }
297  if (direction == socket.direction()) {
298  return true;
299  }
300 
301  return legalPortConnections(socket, direction);
302 }

References clearState(), TTAMachine::Socket::direction(), legalPortConnections(), noConnections_, TTAMachine::Socket::segmentCount(), UNKNOWN, and unknownDir_.

Referenced by TTAMachine::Socket::attachBus(), and TTAMachine::Socket::setDirection().

Here is the call graph for this function:

◆ clearState()

void MachineTester::clearState ( )
private

Clears the state of the object.

Definition at line 497 of file MachineTester.cc.

497  {
498  connectionExists_ = false;
499  rfPortAlreadyConnected_ = false;
500  illegalRegistration_ = false;
501  loop_ = false;
502  branchedBus_ = NULL;
503  wrongSocketDirection_ = false;
504  maxConnections_ = false;
505  unknownDir_ = false;
506  noConnections_ = false;
510 }

References branchedBus_, connectionExists_, forbiddenInputSocketDir_, illegalRegistration_, loop_, maxConnections_, noConnections_, rfPortAlreadyConnected_, sameDirInputSocketConn_, sameDirOutputSocketConn_, unknownDir_, and wrongSocketDirection_.

Referenced by canBridge(), canConnect(), canSetDirection(), and MachineTester().

◆ connectionExists()

bool MachineTester::connectionExists ( ) const

Returns true if the reason for failure of the previous test was that a connection exists already between the components.

Returns
True if a connection exists, otherwise false.

Definition at line 342 of file MachineTester.cc.

342  {
343  return connectionExists_;
344 }

References connectionExists_.

Referenced by TTAMachine::Port::attachSocket(), MachineTestReporter::bridgingError(), MachineTestReporter::socketPortConnectionError(), and MachineTestReporter::socketSegmentConnectionError().

◆ forbiddenSocketDirection()

Port * MachineTester::forbiddenSocketDirection ( TTAMachine::Socket::Direction  direction) const

If the reason for failure when tried to set socket direction was that the socket was connected to a port of a unit that doesn't allow sockets of such direction to be connected, returns the port. Otherwise returns NULL.

Parameters
directionThe direction that was tried to set.
Returns
The port.

Definition at line 471 of file MachineTester.cc.

471  {
472  if (direction == Socket::INPUT) {
474  } else {
475  return NULL;
476  }
477 }

References forbiddenInputSocketDir_.

Referenced by MachineTestReporter::socketDirectionSettingError(), and MachineTestReporter::socketSegmentConnectionError().

◆ illegalRegistration()

bool MachineTester::illegalRegistration ( ) const

Returns true if the reason for failure of the previous test was illegal registration of components.

Returns
True if the components were not registered to the same machine, otherwise false.

Definition at line 355 of file MachineTester.cc.

355  {
356  return illegalRegistration_;
357 }

References illegalRegistration_.

Referenced by MachineTestReporter::bridgingError(), MachineTestReporter::socketPortConnectionError(), and MachineTestReporter::socketSegmentConnectionError().

◆ isValidComponentName()

bool MachineTester::isValidComponentName ( const std::string &  name)
static

Checks whether the given string is a valid machine component name.

Parameters
nameThe name to check.
Returns
True if the name is valid, otherwise false.

Definition at line 312 of file MachineTester.cc.

312  {
313 
314  if (name.length() == 0) {
315  return false;
316  }
317 
318  for (unsigned int i = 0; i < name.length(); i++) {
319  char character = name[i];
320  if (i == 0) {
321  if (!isalpha(character)) {
322  return false;
323  }
324  } else {
325  if (!isalpha(character) && !isdigit(character) &&
326  character != '_' && character != ':') {
327  return false;
328  }
329  }
330  }
331  return true;
332 }

Referenced by TTAMachine::ExecutionPipeline::checkResourceName(), TTAMachine::Component::Component(), TTAMachine::HWOperation::HWOperation(), TTAMachine::Segment::loadStateWithoutReferences(), TTAMachine::Port::loadStateWithoutReferences(), OperationDialog::onAddResource(), BusDialog::onAddSegment(), ImmediateSlotDialog::onAddSlot(), TemplateListDialog::onAddTemplate(), RFPortDialog::onOK(), IUPortDialog::onOK(), RFDialog::onOK(), SRPortDialog::onOK(), FUPortDialog::onOK(), SocketDialog::onOK(), FUDialog::onOK(), IUDialog::onOK(), BusDialog::onOK(), BridgeDialog::onOK(), AddressSpaceDialog::onOK(), OperationDialog::onOK(), GCUDialog::onOK(), TTAMachine::Port::Port(), TTAMachine::Segment::Segment(), TTAMachine::PipelineElement::setName(), TTAMachine::HWOperation::setName(), TTAMachine::Segment::setName(), TTAMachine::Port::setName(), and TTAMachine::Component::setName().

◆ legalPortConnections()

bool MachineTester::legalPortConnections ( const TTAMachine::Socket socket,
TTAMachine::Socket::Direction  direction 
)
private

Checks if the given socket will have legal connections to ports if its direction is changed to the given value.

Parameters
socketThe socket to test.
directionThe direction to test.
Returns
True if the connections will stay legal, otherwise false.

Definition at line 556 of file MachineTester.cc.

558  {
559 
560  for (int i = 0; i < socket.portCount(); i++) {
561  Port* port = socket.port(i);
562  if (direction == Socket::INPUT && port->inputSocket() != NULL) {
564  return false;
565  } else if (direction == Socket::OUTPUT &&
566  port->outputSocket() != NULL) {
568  return false;
569  }
570  Unit* parent = port->parentUnit();
571  if (dynamic_cast<ImmediateUnit*>(parent) != NULL &&
572  direction == Socket::INPUT) {
574  return false;
575  }
576  }
577 
578  return true;
579 }

References forbiddenInputSocketDir_, TTAMachine::Port::inputSocket(), TTAMachine::Port::outputSocket(), TTAMachine::Port::parentUnit(), TTAMachine::Socket::port(), TTAMachine::Socket::portCount(), sameDirInputSocketConn_, and sameDirOutputSocketConn_.

Referenced by canConnect(), and canSetDirection().

Here is the call graph for this function:

◆ loop()

bool MachineTester::loop ( ) const

If the reason for failure when tried to join two buses by a bridge was loop in bus chain, returns true. Otherwise returns false.

Returns
True, if loop was the reason for failure.

Definition at line 367 of file MachineTester.cc.

367  {
368  return loop_;
369 }

References loop_.

Referenced by MachineTestReporter::bridgingError().

◆ maxConnections()

bool MachineTester::maxConnections ( ) const

Checks if maximum number of connections in port was the reason for failure when tried to attach a port to a socket.

Returns
True, if maximum number of connection was the reason, otherwise false.

Definition at line 410 of file MachineTester.cc.

410  {
411  return maxConnections_;
412 }

References maxConnections_.

Referenced by MachineTestReporter::socketPortConnectionError().

◆ noConnections()

bool MachineTester::noConnections ( ) const

Returns true if the reason for failure when tried to set socket direction was that the socket has no connections to segments.

Returns
True if the socket has no connections to segments, otherwise false.

Definition at line 437 of file MachineTester.cc.

437  {
438  return noConnections_;
439 }

References noConnections_.

Referenced by MachineTestReporter::socketDirectionSettingError().

◆ operator=()

MachineTester& MachineTester::operator= ( const MachineTester tester)
private

◆ registerFilePortAlreadyConnected()

bool MachineTester::registerFilePortAlreadyConnected ( ) const

Tells whether the reason for failure when tried to attach a port to a socket was that the parent unit of the port was register file and a port of the register file was already connected to the socket.

Returns
True if that was the reason, otherwise false.

Definition at line 488 of file MachineTester.cc.

488  {
490 }

References rfPortAlreadyConnected_.

Referenced by MachineTestReporter::socketPortConnectionError().

◆ sameDirSocketConnection()

Port * MachineTester::sameDirSocketConnection ( TTAMachine::Socket::Direction  direction) const

If the reason for failure when tried to set socket direction was that the socket was connected to a port that was connected to another socket that has the same direction, returns that port. Otherwise returns NULL.

Parameters
directionThe direction that was tried to set.
Returns
The port.

Definition at line 451 of file MachineTester.cc.

451  {
452  if (direction == Socket::INPUT) {
454  } else if (direction == Socket::OUTPUT) {
456  } else {
457  return NULL;
458  }
459 }

References sameDirInputSocketConn_, and sameDirOutputSocketConn_.

Referenced by MachineTestReporter::socketDirectionSettingError(), and MachineTestReporter::socketSegmentConnectionError().

◆ unknownSocketDirection()

bool MachineTester::unknownSocketDirection ( ) const

Returns true if the reason for failure when tried to set socket direction was unknown direction. The direction of socket can never be set to unknown.

Returns
True if the reason for failure was unknown socket direction, otherwise false.

Definition at line 424 of file MachineTester.cc.

424  {
425  return unknownDir_;
426 }

References unknownDir_.

Referenced by MachineTestReporter::socketDirectionSettingError().

◆ wrongSocketDirection()

bool MachineTester::wrongSocketDirection ( ) const

Checks if wrong direction of socket was the reason for failure when tried to attach a port to a socket.

Returns
True, if wrong direction of socket was the reason, otherwise false.

Definition at line 397 of file MachineTester.cc.

397  {
398  return wrongSocketDirection_;
399 }

References wrongSocketDirection_.

Referenced by MachineTestReporter::socketPortConnectionError().

Member Data Documentation

◆ branchedBus_

const TTAMachine::Bus* MachineTester::branchedBus_
private

If the reason for failure when trying to bridge two busses is that a branch in the bus chain would be created, this is the branched bus.

Definition at line 109 of file MachineTester.hh.

Referenced by branchedBus(), canBridge(), and clearState().

◆ connectionExists_

bool MachineTester::connectionExists_
private

Indicates if the reason for the last test failure is that the tested connection already exists.

Definition at line 97 of file MachineTester.hh.

Referenced by canBridge(), canConnect(), clearState(), and connectionExists().

◆ forbiddenInputSocketDir_

TTAMachine::Port* MachineTester::forbiddenInputSocketDir_
private

If the reason for failure when tried to set socket direction to input was the socket is connected to a unit that cannot be connected to an input socket, this is the port of the unit.

Definition at line 134 of file MachineTester.hh.

Referenced by clearState(), forbiddenSocketDirection(), and legalPortConnections().

◆ illegalRegistration_

bool MachineTester::illegalRegistration_
private

Indicates if the reason for last test failure was illegal registration.

Definition at line 103 of file MachineTester.hh.

Referenced by canBridge(), canConnect(), clearState(), and illegalRegistration().

◆ loop_

bool MachineTester::loop_
private

Indicates if the reason for failure when trying to bridge two busses is that a loop in the bus chain would be created.

Definition at line 106 of file MachineTester.hh.

Referenced by canBridge(), clearState(), and loop().

◆ machine_

const TTAMachine::Machine* MachineTester::machine_
private

The machine on which the tests are carried out.

Definition at line 94 of file MachineTester.hh.

Referenced by canBridge(), and canConnect().

◆ maxConnections_

bool MachineTester::maxConnections_
private

Indicates if the reason for failure when trying to connect a socket to a port was that this connection would exceed the maximum number of connections allowed for a port.

Definition at line 117 of file MachineTester.hh.

Referenced by canConnect(), clearState(), and maxConnections().

◆ noConnections_

bool MachineTester::noConnections_
private

Indicates if the reason for failure when tried to set socket direction was that the socket has no segment connections.

Definition at line 122 of file MachineTester.hh.

Referenced by canSetDirection(), clearState(), and noConnections().

◆ rfPortAlreadyConnected_

bool MachineTester::rfPortAlreadyConnected_
private

Indicates if the reason for failure is that a port of register file is already connected to a particular socket.

Definition at line 100 of file MachineTester.hh.

Referenced by canConnect(), clearState(), and registerFilePortAlreadyConnected().

◆ sameDirInputSocketConn_

TTAMachine::Port* MachineTester::sameDirInputSocketConn_
private

If the reason for failure when tried to set socket direction to input was that the socket is connected to a port that already has an input socket connected, this is the port.

Definition at line 126 of file MachineTester.hh.

Referenced by clearState(), legalPortConnections(), and sameDirSocketConnection().

◆ sameDirOutputSocketConn_

TTAMachine::Port* MachineTester::sameDirOutputSocketConn_
private

If the reason for failure when tried to set socket direction to output was that the socket is connected to a port that already has an output socket connected, this is the port.

Definition at line 130 of file MachineTester.hh.

Referenced by clearState(), legalPortConnections(), and sameDirSocketConnection().

◆ unknownDir_

bool MachineTester::unknownDir_
private

Indicates if tried to set the socket direction to Socket::UNKNOWN.

Definition at line 119 of file MachineTester.hh.

Referenced by canSetDirection(), clearState(), and unknownSocketDirection().

◆ wrongSocketDirection_

bool MachineTester::wrongSocketDirection_
private

Indicates if the reason for failure when trying to connect a socket to a port was that the direction of the socket is incompatible with the direction of other sockets connected to the port.

Definition at line 113 of file MachineTester.hh.

Referenced by canConnect(), clearState(), and wrongSocketDirection().


The documentation for this class was generated from the following files:
TTAMachine::Port::unconnectedSocket
virtual Socket * unconnectedSocket(int index) const
Definition: Port.cc:323
MachineTester::noConnections_
bool noConnections_
Indicates if the reason for failure when tried to set socket direction was that the socket has no seg...
Definition: MachineTester.hh:122
TTAMachine::Port::inputSocket
virtual Socket * inputSocket() const
Definition: Port.cc:261
TTAMachine::Socket::port
Port * port(int index) const
Definition: Socket.cc:266
TTAMachine::Socket::portCount
int portCount() const
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::Bus
Definition: Bus.hh:53
TTAMachine::Bus::canWrite
virtual bool canWrite(const Bus &bus) const
Definition: Bus.cc:558
MachineTester::machine_
const TTAMachine::Machine * machine_
The machine on which the tests are carried out.
Definition: MachineTester.hh:94
MachineTester::branchedBus_
const TTAMachine::Bus * branchedBus_
If the reason for failure when trying to bridge two busses is that a branch in the bus chain would be...
Definition: MachineTester.hh:109
TTAMachine::Socket::direction
Direction direction() const
TTAMachine::Bus::hasPreviousBus
virtual bool hasPreviousBus() const
Definition: Bus.cc:473
MachineTester::sameDirOutputSocketConn_
TTAMachine::Port * sameDirOutputSocketConn_
If the reason for failure when tried to set socket direction to output was that the socket is connect...
Definition: MachineTester.hh:130
MachineTester::sameDirInputSocketConn_
TTAMachine::Port * sameDirInputSocketConn_
If the reason for failure when tried to set socket direction to input was that the socket is connecte...
Definition: MachineTester.hh:126
TTAMachine::Port::socketCount
virtual int socketCount() const
Definition: Port.cc:375
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::Unit
Definition: Unit.hh:51
TTAMachine::Segment::parentBus
Bus * parentBus() const
TTAMachine::Port
Definition: Port.hh:54
TTAMachine::Socket
Definition: Socket.hh:53
TTAMachine::Socket::isConnectedTo
bool isConnectedTo(const Bus &bus) const
Definition: Socket.cc:331
MachineTester::wrongSocketDirection_
bool wrongSocketDirection_
Indicates if the reason for failure when trying to connect a socket to a port was that the direction ...
Definition: MachineTester.hh:113
TTAMachine::Unit::portCount
virtual int portCount() const
Definition: Unit.cc:135
MachineTester::legalPortConnections
bool legalPortConnections(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
Definition: MachineTester.cc:556
MachineTester::areInSameChain
static bool areInSameChain(const TTAMachine::Bus &bus1, const TTAMachine::Bus &bus2)
Definition: MachineTester.cc:521
MachineTester::clearState
void clearState()
Definition: MachineTester.cc:497
TTAMachine::BaseRegisterFile::port
virtual RFPort * port(const std::string &name) const
Definition: BaseRegisterFile.cc:129
TTAMachine::Bus::hasNextBus
virtual bool hasNextBus() const
Definition: Bus.cc:488
MachineTester::forbiddenInputSocketDir_
TTAMachine::Port * forbiddenInputSocketDir_
If the reason for failure when tried to set socket direction to input was the socket is connected to ...
Definition: MachineTester.hh:134
MachineTester::loop_
bool loop_
Indicates if the reason for failure when trying to bridge two busses is that a loop in the bus chain ...
Definition: MachineTester.hh:106
TTAMachine::Bus::previousBus
virtual Bus * previousBus() const
Definition: Bus.cc:518
TTAMachine::Component::machine
virtual Machine * machine() const
MachineTester::unknownDir_
bool unknownDir_
Indicates if tried to set the socket direction to Socket::UNKNOWN.
Definition: MachineTester.hh:119
UNKNOWN
@ UNKNOWN
Definition: MemoryGenerator.hh:58
TTAMachine::Port::outputSocket
virtual Socket * outputSocket() const
Definition: Port.cc:281
MachineTester::rfPortAlreadyConnected_
bool rfPortAlreadyConnected_
Indicates if the reason for failure is that a port of register file is already connected to a particu...
Definition: MachineTester.hh:100
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
TTAMachine::Port::isConnectedTo
virtual bool isConnectedTo(const Socket &socket) const
Definition: Port.cc:393
TTAMachine::Socket::segmentCount
int segmentCount() const
TTAMachine::Bus::nextBus
virtual Bus * nextBus() const
Definition: Bus.cc:501
MachineTester::illegalRegistration_
bool illegalRegistration_
Indicates if the reason for last test failure was illegal registration.
Definition: MachineTester.hh:103
MachineTester::maxConnections_
bool maxConnections_
Indicates if the reason for failure when trying to connect a socket to a port was that this connectio...
Definition: MachineTester.hh:117
MachineTester::connectionExists_
bool connectionExists_
Indicates if the reason for the last test failure is that the tested connection already exists.
Definition: MachineTester.hh:97
TTAMachine::Port::parentUnit
Unit * parentUnit() const
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50