OpenASIP  2.0
Socket.cc
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file Socket.cc
26  *
27  * Implementation of Socket class.
28  *
29  * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  * @note reviewed 22 Jun 2004 by ao, ml, vpj, ll
32  */
33 
34 #include <set>
35 
36 #include "Socket.hh"
37 #include "Machine.hh"
38 #include "Bus.hh"
39 #include "Segment.hh"
40 #include "Port.hh"
41 #include "Connection.hh"
42 #include "MachineTester.hh"
43 #include "MOMTextGenerator.hh"
44 #include "MachineTestReporter.hh"
45 #include "Application.hh"
46 #include "ContainerTools.hh"
47 #include "AssocTools.hh"
48 #include "ObjectState.hh"
49 
50 using std::string;
51 using std::set;
52 using boost::format;
53 
54 namespace TTAMachine {
55 
56 // initialization of static data members
57 const string Socket::OSNAME_SOCKET = "socket";
58 const string Socket::OSKEY_DIRECTION = "direction";
59 const string Socket::OSVALUE_INPUT = "input";
60 const string Socket::OSVALUE_OUTPUT = "output";
61 const string Socket::OSVALUE_UNKNOWN = "unknown";
62 
63 /**
64  * Constructor.
65  *
66  * @param name Name of the socket.
67  * @exception InvalidName If the given name is not valid for a component.
68  */
69 Socket::Socket(const std::string& name)
70  : Component(name), direction_(UNKNOWN), dataPortWidth_() {}
71 
72 /**
73  * Constructor.
74  *
75  * Loads the state of the socket from the given ObjectState instance but
76  * does not create connections to other components.
77  *
78  * @param state The ObjectState instance.
79  * @exception ObjectStateLoadingException If the given ObjectState instance
80  * is invalid.
81  */
83  : Component(state), direction_(UNKNOWN), dataPortWidth_() {}
84 
85 /**
86  * Destructor.
87  */
89  unsetMachine();
91 }
92 
93 
94 /**
95  * Sets the name of the socket.
96  *
97  * @param name New name of the socket.
98  * @exception ComponentAlreadyExists If a socket with the given name is
99  * already in the same machine.
100  * @exception InvalidName If the given name is not valid for a component.
101  */
102 void
103 Socket::setName(const std::string& name) {
104  if (name == this->name()) {
105  return;
106  }
107 
108  if (machine() != NULL) {
109  if (machine()->socketNavigator().hasItem(name)) {
110  string procName = "Socket::setName";
111  throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
112  } else {
114  }
115  } else {
117  }
118 }
119 
120 /**
121  * Sets the direction of the socket.
122  *
123  * The given direction must be either Socket::INPUT or Socket::OUTPUT.
124  *
125  * @param direction The new direction.
126  * @exception IllegalConnectivity If the direction of the port cannot be
127  * changed.
128  */
129 void
131  const string procName = "Socket::setDirection";
132 
133  if (!isRegistered()) {
134  MOMTextGenerator textGenerator;
135  format text = textGenerator.text(
137  text % name();
138  throw IllegalConnectivity(__FILE__, __LINE__, procName, text.str());
139  }
140 
141  MachineTester& tester = machine()->machineTester();
142  if (tester.canSetDirection(*this, direction)) {
144  } else {
146  *this, direction, tester);
147  throw IllegalConnectivity(__FILE__, __LINE__, procName, errorMsg);
148  }
149 }
150 
151 /**
152  * Attaches a bus to the socket.
153  *
154  * If no bus is currently attached, the direction of the socket is set to
155  * Socket::INPUT or Socket::OUTPUT. When possible, the direction is set to
156  * Socket::INPUT. Otherwise, it is set to Socket::OUTPUT.
157  *
158  * @param bus The segment of a bus being attached.
159  * @exception IllegalRegistration If the bus is not registered to the same
160  * machine as the socket.
161  * @exception IllegalConnectivity If the socket is attached to ports in such
162  * a way that its direction cannot be either
163  * input or output.
164  */
165 void
167  const string procName = "Socket::attachBus";
168 
170  MachineTester& tester = machine()->machineTester();
171  if (!tester.canConnect(*this, bus)) {
173  *this, bus, tester);
174  throw IllegalConnectivity(__FILE__, __LINE__, procName, errorMsg);
175  }
176 
177  if (!bus.isConnectedTo(*this)) {
178  const Connection* conn = new Connection(*this, bus);
179  busses_.push_back(conn);
180  bus.attachSocket(*this);
181  } else {
182  assert(false);
183  }
184 
185  // set the direction
186  if (direction_ == UNKNOWN) {
187  if (tester.canSetDirection(*this, INPUT)) {
189  } else if (tester.canSetDirection(*this, OUTPUT)) {
191  } else {
192  string errorMsg = "Direction of the socket cannot be set.";
194  __FILE__, __LINE__, procName, errorMsg);
196  }
197  }
198 }
199 
200 /**
201  * Detaches the given segment of a bus from the socket.
202  *
203  * If there are no buses connected to the socket after detaching the given
204  * segment, the direction of the socket is set to Socket::UNKNOWN. Note that
205  * detaching a segment may affect to the value of maximum simultaneous
206  * register reads of register files connected to the socket.
207  *
208  * @param bus The segment to be detached.
209  * @exception InstanceNotFound If the given segment is not attached to the
210  * socket.
211  */
212 void
214  if (!isConnectedTo(bus)) {
215  string procName = "Socket::detachBus";
216  throw InstanceNotFound(__FILE__, __LINE__, procName);
217  }
218 
219  const Connection& conn = connection(bus);
220  removeConnection(&conn);
221 
222  if (bus.isConnectedTo(*this)) {
223  bus.detachSocket(*this);
224  delete &conn;
225  }
226 
227  // set socket direction to unknown if it has no connections to buses
228  if (segmentCount() == 0) {
230  }
231 }
232 
233 /**
234  * Detaches all the segments of the given bus from the socket.
235  *
236  * If there are no buses connected to the socket after detaching the given
237  * bus, the direction of the socket is set to Socket::UNKNOWN. Note that
238  * detaching the bus may affect to the value of maximum simultaneous
239  * register reads of register files connected to the socket.
240  *
241  * @param bus Bus to be detached.
242  */
243 void
245  int segments = bus.segmentCount();
246  for (int i = 0; i < segments; i++) {
247  Segment* segment = bus.segment(i);
248  if (isConnectedTo(*segment)) {
249  detachBus(*segment);
250  }
251  }
252 }
253 
254 
255 /**
256  * Returns a port by the given index.
257  *
258  * The given index must be greater or equal to 0 and less than the number
259  * of ports attached to the socket.
260  *
261  * @param index Index.
262  * @return The port found by the given index.
263  * @exception OutOfRange If the given index is out of range.
264  */
265 Port*
266 Socket::port(int index) const {
267  if (index < 0 || index >= portCount()) {
268  string procName = "Socket::port";
269  throw OutOfRange(__FILE__, __LINE__, procName);
270  }
271  return ports_[index];
272 }
273 
274 /**
275  * Detaches all ports from the socket.
276  */
277 void
279  PortTable::iterator iter = ports_.begin();
280  while (iter != ports_.end()) {
281  // removes the socket from ports_
282  (*iter)->detachSocket(*this);
283  iter = ports_.begin();
284  }
285  ports_.clear();
286 }
287 
288 
289 
290 
291 /**
292  * Returns the Connection object which connects this socket and the given
293  * segment.
294  *
295  * This method is not intended for clients. Do not use this method. The
296  * connection must exist before calling this function.
297  *
298  * @param bus The segment of a bus which is attached to this socket.
299  * @return Connection object which joins the socket and the segment.
300  */
301 const Connection&
302 Socket::connection(const Segment& bus) const {
303 
304  ConnectionTable::const_iterator iter = busses_.begin();
305  while (iter != busses_.end()) {
306  if ((*iter)->bus() == &bus) {
307  return **iter;
308  } else {
309  iter++;
310  }
311  }
312 
313  string errorMsg = "The requested Connection object does not exist in "
314  "Socket.";
315  string procName = "Socket::connection";
316  Application::writeToErrorLog(__FILE__, __LINE__, procName, errorMsg);
318 
319  // this return statement is only to avoid warning in Solaris environment
320  return **iter;
321 }
322 
323 
324 /**
325  * Checks whether the socket is connected to the given bus.
326  *
327  * @param bus A bus.
328  * @return True if connected, otherwise false.
329  */
330 bool
331 Socket::isConnectedTo(const Bus& bus) const {
332 
333  int segments = bus.segmentCount();
334  for (int i = 0; i < segments; i++) {
335  if (isConnectedTo(*bus.segment(i))) {
336  return true;
337  }
338  }
339  return false;
340 }
341 
342 
343 /**
344  * Checks whether the socket is connected to the given segment.
345  *
346  * @param bus Segment of a bus.
347  * @return True if connected, otherwise false.
348  */
349 bool
350 Socket::isConnectedTo(const Segment& bus) const {
351 
352  ConnectionTable::const_iterator iter = busses_.begin();
353  while (iter != busses_.end()) {
354  if ((*iter)->bus() == &bus) {
355  return true;
356  } else {
357  iter++;
358  }
359  }
360 
361  return false;
362 }
363 
364 /**
365  * Returns set of buses where the socket is connected to.
366  */
367 std::set<Bus*>
369  set<Bus*> result;
370  for (const Connection* conn : busses_) {
371  result.insert(conn->bus()->parentBus());
372  }
373 
374  return result;
375 }
376 
377 /**
378  * Returns set of buses where the socket is connected to.
379  */
380 const std::set<Bus*>
381 Socket::connectedBuses() const {
382  set<Bus*> result;
383  for (const Connection* conn : busses_) {
384  result.insert(conn->bus()->parentBus());
385  }
386 
387  return result;
388 }
389 
390 /**
391  * By the given index, returns the segment a socket is connected to.
392  *
393  * The given index must be greater or equal to 0 and smaller than the number
394  * of segments attached to the socket.
395  *
396  * @param index The index.
397  * @return Segment by the given index.
398  * @exception OutOfRange If the given index is out of range.
399  */
400 Segment*
401 Socket::segment(int index) const {
402  if (index < 0 || index >= segmentCount()) {
403  string procName = "Socket::segment";
404  throw OutOfRange(__FILE__, __LINE__, procName);
405  }
406  return busses_[index]->bus();
407 }
408 
409 bool
411  return !dataPortWidth_.empty();
412 }
413 
414 const std::string&
416  return dataPortWidth_;
417 }
418 
419 void
420 Socket::setDataPortWidth(const string& width) {
421  dataPortWidth_ = width;
422 }
423 
424 /**
425  * Registers the socket to a machine.
426  *
427  * @param mach Machine to which the socket is to be registered.
428  * @exception ComponentAlreadyExists If there already is another socket by
429  * the same name in the machine.
430  */
431 void
433  internalSetMachine(mach);
434  mach.addSocket(*this);
435 }
436 
437 /**
438  * Removes the socket from the machine it is registered to.
439  *
440  * Detaches all the busses and ports attached to the socket.
441  */
442 void
444 
445  if (machine() == NULL) {
446  return;
447  }
448 
449  Machine* mach = machine();
451 
452  detachAllBuses();
453  detachAllPorts();
454 
455  mach->removeSocket(*this);
456 }
457 
458 
459 /**
460  * Saves the contents of the socket to an ObjectState object.
461  *
462  * @return The newly created ObjectState object.
463  */
466 
468  root->setName(OSNAME_SOCKET);
469 
470  // set direction
471  if (direction_ == INPUT) {
473  } else if (direction_ == OUTPUT) {
475  } else {
477  }
478 
479  // add connections
480  ConnectionTable::const_iterator iter = busses_.begin();
481  while (iter != busses_.end()) {
482  const Connection* conn = *iter;
483  ObjectState* bus = conn->saveState();
484  root->addChild(bus);
485  iter++;
486  }
487 
488  return root;
489 }
490 
491 
492 /**
493  * Loads its state from the given ObjectState instance.
494  *
495  * @param state The ObjectState instance.
496  * @exception ObjectStateLoadingException If the machine already has a socket
497  * by the same name as the new
498  * name of this socket or if the
499  * given ObjectState tree is invalid.
500  */
501 void
503  string procName = "Socket::loadState";
504  MOMTextGenerator textGenerator;
505 
506  if (state->name() != OSNAME_SOCKET) {
507  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
508  }
509 
510  Component::loadState(state);
511 
512  // load connections to busses
513  detachAllBuses();
514 
515  try {
516 
517  for (int childIndex = 0; childIndex < state->childCount();
518  childIndex++) {
519  ObjectState* child = state->child(childIndex);
520 
521  if (child->name() == Connection::OSNAME_CONNECTION) {
522  string busName =
524  string segmentName =
526 
527  if (!isRegistered()) {
528  format text = textGenerator.text(
530  text % name();
532  __FILE__, __LINE__, procName, text.str());
533  }
534 
536  Bus* bus = NULL;
537  Segment* segment = NULL;
538 
539  try {
540  bus = busNav.item(busName);
541  } catch (InstanceNotFound&) {
542  format text = textGenerator.text(
544  text % busName % name();
546  __FILE__, __LINE__, procName, text.str());
547  }
548 
549  try {
550  segment = bus->segment(segmentName);
551  } catch (InstanceNotFound&) {
552  format text = textGenerator.text(
554  text % name() % segmentName % busName;
556  __FILE__, __LINE__, procName, text.str());
557  }
558 
559  attachBus(*segment);
560 
561  } else {
563  __FILE__, __LINE__, procName);
564  }
565  }
566 
567  } catch (const Exception& exception) {
569  __FILE__, __LINE__, procName, exception.errorMessage());
570  }
571 
572  // load direction
573  string direction("");
574  try {
576  if (direction == OSVALUE_INPUT) {
578  } else if (direction == OSVALUE_OUTPUT) {
580  } else if (direction == OSVALUE_UNKNOWN) {
581  if (segmentCount() > 0) {
582  format text = textGenerator.text(
584  TXT_UNKNOWN_SOCKET_DIR_AND_SEGMENT_CONN);
586  __FILE__, __LINE__, procName, text.str());
587  }
589  } else {
590  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
591  }
592 
593  } catch (const Exception& exception) {
595  __FILE__, __LINE__, procName, exception.errorMessage());
596  }
597 }
598 
599 /**
600  * Removes a connection from the connection table.
601  *
602  * @param connection The connection to be removed.
603  */
604 void
607 }
608 
609 
610 /**
611  * Notifies the socket that a port has been attached to it.
612  *
613  * Private helper method used only by friend class Port.
614  *
615  * @param port The port that has been attached to this socket.
616  */
617 void
619  ports_.push_back(&port);
620 }
621 
622 
623 /**
624  * Notifies the socket that a port has been detached from it.
625  *
626  * Private helper method used only by friend class Port.
627  *
628  * @param port The port that has been detached from this socket.
629  */
630 void
631 Socket::detachPort(const Port& port) {
633 }
634 
635 
636 /**
637  * Detaches all the buses from this socket.
638  */
639 void
641  while (busses_.size() > 0) {
642  Segment* bus = busses_[0]->bus();
643  detachBus(*bus);
644  }
645 }
646 }
TTAMachine::Socket::Socket
Socket(const std::string &name)
Definition: Socket.cc:69
MachineTester::canConnect
virtual bool canConnect(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment)
Definition: MachineTester.cc:86
TTAMachine::Component::internalUnsetMachine
void internalUnsetMachine()
TTAMachine::Component::setName
virtual void setName(const std::string &name)
Definition: MachinePart.cc:142
TTAMachine::Socket::ports_
PortTable ports_
Contains all connections to ports.
Definition: Socket.hh:133
TTAMachine::Socket::connection
const Connection & connection(const Segment &bus) const
Definition: Socket.cc:302
TTAMachine::Socket::connectedBuses
std::set< Bus * > connectedBuses()
Definition: Socket.cc:368
TTAMachine::Segment::attachSocket
void attachSocket(Socket &socket)
Definition: Segment.cc:180
TTAMachine::Socket::portCount
int portCount() const
TTAMachine::Socket::port
Port * port(int index) const
Definition: Socket.cc:266
TTAMachine::Socket::attachPort
void attachPort(Port &port)
Definition: Socket.cc:618
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
TTAMachine::Component::isRegistered
virtual bool isRegistered() const
Definition: MachinePart.cc:177
TTAMachine::Socket::OSVALUE_OUTPUT
static const std::string OSVALUE_OUTPUT
ObjectState attribute value for output direction.
Definition: Socket.hh:106
TTAMachine::Socket::OUTPUT
@ OUTPUT
Data goes from port to bus.
Definition: Socket.hh:60
ObjectStateLoadingException
Definition: Exception.hh:551
TTAMachine::Segment
Definition: Segment.hh:54
TTAMachine::Component::ensureRegistration
virtual void ensureRegistration(const Component &component) const
Definition: MachinePart.cc:163
TTAMachine::Socket::~Socket
virtual ~Socket()
Definition: Socket.cc:88
TTAMachine::Socket::direction_
Direction direction_
Direction of the socket.
Definition: Socket.hh:127
Application::writeToErrorLog
static void writeToErrorLog(const std::string fileName, const int lineNumber, const std::string functionName, const std::string message, const int neededVerbosity=0)
Definition: Application.cc:224
Connection.hh
OutOfRange
Definition: Exception.hh:320
TTAMachine::Bus
Definition: Bus.hh:53
TTAMachine::Component::saveState
virtual ObjectState * saveState() const
Definition: MachinePart.cc:189
MachineTestReporter::socketDirectionSettingError
static std::string socketDirectionSettingError(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction, const MachineTester &tester)
Definition: MachineTestReporter.cc:299
TTAMachine::Socket::loadState
virtual void loadState(const ObjectState *state)
Definition: Socket.cc:502
ObjectState
Definition: ObjectState.hh:59
MOMTextGenerator::TXT_SOCKET_REF_LOAD_ERR
@ TXT_SOCKET_REF_LOAD_ERR
Definition: MOMTextGenerator.hh:60
MachineTestReporter::socketSegmentConnectionError
static std::string socketSegmentConnectionError(const TTAMachine::Socket &socket, const TTAMachine::Segment &segment, const MachineTester &tester)
Definition: MachineTestReporter.cc:55
TTAMachine::Socket::segment
Segment * segment(int index) const
Definition: Socket.cc:401
TTAMachine::Socket::Direction
Direction
Definition: Socket.hh:58
MachineTestReporter.hh
Texts::TextGenerator::text
virtual boost::format text(int textId)
Definition: TextGenerator.cc:94
TTAMachine::Socket::direction
Direction direction() const
TTAMachine::Bus::segment
virtual Segment * segment(int index) const
Definition: Bus.cc:329
TTAMachine::Socket::saveState
virtual ObjectState * saveState() const
Definition: Socket.cc:465
ObjectState::setName
void setName(const std::string &name)
TTAMachine::Socket::detachAllPorts
void detachAllPorts()
Definition: Socket.cc:278
Socket.hh
TTAMachine::Component::internalSetMachine
void internalSetMachine(Machine &machine)
TTAMachine::Segment::detachSocket
void detachSocket(Socket &socket)
Definition: Segment.cc:210
assert
#define assert(condition)
Definition: Application.hh:86
MOMTextGenerator::TXT_SET_DIR_SOCKET_NOT_REGISTERED
@ TXT_SET_DIR_SOCKET_NOT_REGISTERED
Definition: MOMTextGenerator.hh:64
Port.hh
Segment.hh
TTAMachine::Socket::dataPortWidth_
std::string dataPortWidth_
Dataport width.
Definition: Socket.hh:129
TTAMachine::Socket::dataPortWidth
const std::string & dataPortWidth() const
Definition: Socket.cc:415
TTAMachine::Socket::detachPort
void detachPort(const Port &port)
Definition: Socket.cc:631
TTAMachine::Socket::attachBus
void attachBus(Segment &bus)
Definition: Socket.cc:166
TTAMachine::Socket::OSVALUE_UNKNOWN
static const std::string OSVALUE_UNKNOWN
ObjectState attribute value for unknown direction.
Definition: Socket.hh:108
ContainerTools::removeValueIfExists
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
TTAMachine::Machine::machineTester
MachineTester & machineTester() const
Definition: Machine.cc:671
TTAMachine::Segment::parentBus
Bus * parentBus() const
TTAMachine::Port
Definition: Port.hh:54
AssocTools::deleteAllItems
static void deleteAllItems(ContainerType &aMap)
TTAMachine::Socket::unsetMachine
virtual void unsetMachine()
Definition: Socket.cc:443
TTAMachine::Component::loadState
virtual void loadState(const ObjectState *state)
Definition: MachinePart.cc:205
Application.hh
ObjectState.hh
TTAMachine::Component
Definition: MachinePart.hh:90
TTAMachine::Socket::setMachine
virtual void setMachine(Machine &mach)
Definition: Socket.cc:432
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
ObjectState::childCount
int childCount() const
Machine.hh
TTAMachine::Socket::setName
virtual void setName(const std::string &name)
Definition: Socket.cc:103
Exception
Definition: Exception.hh:54
TTAMachine::Segment::isConnectedTo
bool isConnectedTo(const Socket &socket) const
Definition: Segment.cc:274
TTAMachine::Socket::removeConnection
void removeConnection(const Connection *connection)
Definition: Socket.cc:605
MOMTextGenerator::TXT_SOCKET_REF_LOAD_ERR_SEGMENT
@ TXT_SOCKET_REF_LOAD_ERR_SEGMENT
Definition: MOMTextGenerator.hh:62
Bus.hh
TTAMachine::Socket::setDirection
void setDirection(Direction direction)
Definition: Socket.cc:130
ObjectState::name
std::string name() const
TTAMachine::Socket::isConnectedTo
bool isConnectedTo(const Bus &bus) const
Definition: Socket.cc:331
TTAMachine::Socket::OSNAME_SOCKET
static const std::string OSNAME_SOCKET
ObjectState name for socket.
Definition: Socket.hh:100
TTAMachine::Socket::detachBus
void detachBus(Segment &bus)
Definition: Socket.cc:213
Exception::errorMessage
std::string errorMessage() const
Definition: Exception.cc:123
TTAMachine::Connection::OSKEY_BUS
static const std::string OSKEY_BUS
ObjectState attribute key for bus name.
Definition: Connection.hh:62
MachineTester.hh
TTAMachine::Socket::OSKEY_DIRECTION
static const std::string OSKEY_DIRECTION
ObjectState attribute key for socket direction.
Definition: Socket.hh:102
TTAMachine::Connection
Definition: Connection.hh:48
TTAMachine::Component::machine
virtual Machine * machine() const
MachineTester::canSetDirection
virtual bool canSetDirection(const TTAMachine::Socket &socket, TTAMachine::Socket::Direction direction)
Definition: MachineTester.cc:283
AssocTools.hh
TTAMachine::Socket::busses_
ConnectionTable busses_
Contains all connections to busses.
Definition: Socket.hh:131
MOMTextGenerator
Definition: MOMTextGenerator.hh:40
TTAMachine::Connection::OSKEY_SEGMENT
static const std::string OSKEY_SEGMENT
ObjectState attribute key for segment name.
Definition: Connection.hh:64
UNKNOWN
@ UNKNOWN
Definition: MemoryGenerator.hh:58
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
TTAMachine::Socket::UNKNOWN
@ UNKNOWN
Unknown direction.
Definition: Socket.hh:61
TTAMachine::Socket::hasDataPortWidth
bool hasDataPortWidth() const
Definition: Socket.cc:410
ComponentAlreadyExists
Definition: Exception.hh:510
MOMTextGenerator.hh
TTAMachine::Machine::removeSocket
virtual void removeSocket(Socket &socket)
Definition: Machine.cc:490
MOMTextGenerator::TXT_SOCKET_REF_LOAD_ERR_BUS
@ TXT_SOCKET_REF_LOAD_ERR_BUS
Definition: MOMTextGenerator.hh:61
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
TTAMachine::Connection::saveState
ObjectState * saveState() const
Definition: Connection.cc:85
IllegalConnectivity
Definition: Exception.hh:473
TTAMachine::Socket::segmentCount
int segmentCount() const
TTAMachine::Socket::OSVALUE_INPUT
static const std::string OSVALUE_INPUT
ObjectState attribute value for input direction.
Definition: Socket.hh:104
TTAMachine
Definition: Assembler.hh:48
Application::abortProgram
static void abortProgram() __attribute__((noreturn))
Definition: Application.cc:266
MachineTester
Definition: MachineTester.hh:46
TTAMachine::Socket::detachAllBuses
void detachAllBuses()
Definition: Socket.cc:640
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::Machine::addSocket
virtual void addSocket(Socket &socket)
Definition: Machine.cc:157
TTAMachine::Bus::segmentCount
virtual int segmentCount() const
Definition: Bus.cc:385
TTAMachine::Connection::OSNAME_CONNECTION
static const std::string OSNAME_CONNECTION
ObjectState name for Connection.
Definition: Connection.hh:58
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
InstanceNotFound
Definition: Exception.hh:304
TTAMachine::Socket::setDataPortWidth
void setDataPortWidth(const std::string &width)
Definition: Socket.cc:420
TTAMachine::Machine
Definition: Machine.hh:73
TTAMachine::Socket::INPUT
@ INPUT
Data goes from bus to port.
Definition: Socket.hh:59
ContainerTools.hh