OpenASIP  2.0
SocketCodeTable.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 SocketCodeTable.cc
26  *
27  * Implementation of SocketCodeTable class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @note rating: red
31  */
32 
33 #include "SocketCodeTable.hh"
34 #include "BinaryEncoding.hh"
35 #include "MoveSlot.hh"
36 #include "SourceField.hh"
37 #include "DestinationField.hh"
38 #include "FUPortCode.hh"
39 #include "RFPortCode.hh"
40 #include "IUPortCode.hh"
41 #include "NullFUPortCode.hh"
42 #include "NullRFPortCode.hh"
43 #include "NullIUPortCode.hh"
44 #include "SocketEncoding.hh"
45 #include "BEMTester.hh"
46 #include "ContainerTools.hh"
47 #include "SequenceTools.hh"
48 #include "StringTools.hh"
49 #include "Application.hh"
50 #include "ObjectState.hh"
51 
52 using std::string;
53 
54 const std::string SocketCodeTable::OSNAME_SOCKET_CODE_TABLE = "sc_table";
55 const std::string SocketCodeTable::OSKEY_NAME = "name";
56 const std::string SocketCodeTable::OSKEY_EXTRA_BITS = "extra_bits";
57 
58 /**
59  * The constructor.
60  *
61  * Creates a code table and registers it to a binary encoding map.
62  *
63  * @param name Name of the table.
64  * @param parent The encoding map.
65  * @exception ObjectAlreadyExists If the parent encoding map already contains
66  * a socket code table with the same name.
67  */
69  const std::string& name, BinaryEncoding& parent)
70  : parent_(NULL), name_(name), extraBits_(0) {
72  parent_ = &parent;
73 }
74 
75 /**
76  * The constructor.
77  *
78  * Loads the state of the table from the given ObjectState tree.
79  *
80  * @param state The ObjectState tree.
81  * @param parent The parent binary encoding map.
82  * @exception ObjectStateLoadingException If an error occurs while loading
83  * the state.
84  */
86  const ObjectState* state, BinaryEncoding& parent)
87  : parent_(&parent), name_(""), extraBits_(0) {
88  loadState(state);
89  parent_ = NULL;
91  parent_ = &parent;
92 }
93 
94 /**
95  * The destructor.
96  *
97  * Removes the all the references to the socket code table from socket
98  * encodings.
99  */
101 
102  BinaryEncoding* parent = this->parent();
103  for (int i = 0; i < parent->moveSlotCount(); i++) {
104  MoveSlot& slot = parent->moveSlot(i);
105  SlotField& src = slot.sourceField();
106  removeReferences(src);
107  SlotField& dst = slot.destinationField();
108  removeReferences(dst);
109  }
110 
114 
115  parent_ = NULL;
117 }
118 
119 
120 /**
121  * Returns the parent binary encoding map.
122  *
123  * @return The parent binary encoding map.
124  */
127  return parent_;
128 }
129 
130 
131 /**
132  * Returns the name of the socket code table.
133  *
134  * @return The name.
135  */
136 std::string
138  return name_;
139 }
140 
141 
142 /**
143  * Sets new name for the socket code table.
144  *
145  * @param name The new name.
146  * @exception ObjectAlreadyExists If the parent binary encoding map already
147  * has a socket code table with the same name.
148  */
149 void
150 SocketCodeTable::setName(const std::string& name) {
151  if (name == this->name()) {
152  return ;
153  }
154 
155  if (hasParentSCTable(name)) {
156  const string procName = "SocketCodeTable::setName";
157  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
158  }
159 
160  name_ = name;
161 }
162 
163 /**
164  * Sets the number of extra zero bits for the table.
165  *
166  * The bit width of the table can be forced longer than necessary by defining
167  * some number of extra zero bits that always exists in the right end of the
168  * table field.
169  *
170  * @param bits The number of extra zero bits.
171  * @exception OutOfRange If the given number is negative.
172  */
173 void
175  if (bits < 0) {
176  const string procName = "SocketCodeTable::setExtraBits";
177  throw OutOfRange(__FILE__, __LINE__, procName);
178  }
179 
180  extraBits_ = bits;
181 }
182 
183 /**
184  * Returns the number of extra bits.
185  *
186  * @return The number of extra bits.
187  */
188 int
190  return extraBits_;
191 }
192 
193 
194 /**
195  * Returns the bit width of the control codes in the table.
196  *
197  * @return The bit width.
198  */
199 int
201  return maxCodeWidth() + extraBits();
202 }
203 
204 /**
205  * Returns the bit width of the longest control code.
206  *
207  * This does not account the extra bits of the socket table.
208  *
209  * @return The bit width.
210  */
211 int
213  int width(0);
214 
215  for (int i = 0; i < fuPortCodeCount(); i++) {
216  FUPortCode& code = fuPortCode(i);
217  if (width < code.width()) {
218  width = code.width();
219  }
220  }
221 
222  for (int i = 0; i < rfPortCodeCount(); i++) {
223  RFPortCode& code = rfPortCode(i);
224  if (width < code.width()) {
225  width = code.width();
226  }
227  }
228 
229  for (int i = 0; i < iuPortCodeCount(); i++) {
230  IUPortCode& code = iuPortCode(i);
231  if (width < code.width()) {
232  width = code.width();
233  }
234  }
235  return width;
236 }
237 
238 /**
239  * Adds the given control code that identifies a port of a function unit.
240  *
241  * This method is to be called from the constructor of FUPortCode class.
242  *
243  * @param code The code to be added.
244  * @exception ObjectAlreadyExists If the port is already encoded in this
245  * table or if the encoding is ambiguous with
246  * other encodings in the socket code table.
247  */
248 void
250  const string procName = "SocketCodeTable::addFUPortCode";
251 
253  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
254  }
255 
257  *this, code.encoding(), code.extraBits())) {
258  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
259  }
260 
261  if (code.hasOperation()) {
262  if (hasFUPortCode(
263  code.unitName(), code.portName(), code.operationName())) {
264  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
265  }
266  } else {
267  if (hasFUPortCode(code.unitName(), code.portName())) {
268  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
269  }
270  }
271 
272  fuPortCodes_.push_back(&code);
273 }
274 
275 /**
276  * Removes the given FU port code from the socket code table.
277  *
278  * This method is to be called from the destructor of FUPortCode class.
279  *
280  * @param code The code to be removed.
281  */
282 void
284  assert(code.parent() == NULL);
286 }
287 
288 
289 /**
290  * Returns the number of FU port codes in this table.
291  *
292  * @return The number of FU port codes.
293  */
294 int
296  return fuPortCodes_.size();
297 }
298 
299 
300 /**
301  * Returns the FU port code stored at the given position in the table.
302  *
303  * @param index The position.
304  * @exception OutOfRange If the index is negative or not smaller than the
305  * number of FU port codes in the table.
306  */
307 FUPortCode&
308 SocketCodeTable::fuPortCode(int index) const {
309  if (index < 0 || index >= fuPortCodeCount()) {
310  const string procName = "SocketCodeTable::fuPortCode";
311  throw OutOfRange(__FILE__, __LINE__, procName);
312  }
313 
314  return *fuPortCodes_[index];
315 }
316 
317 /**
318  * Tells whether the table has a control code for the port of the function
319  * unit.
320  *
321  * @param fu Name of the function unit.
322  * @param port Name of the port.
323  * @return True if the table has the control code, otherwise false.
324  */
325 bool
327  const std::string& fu,
328  const std::string& port) const {
329 
330  FUPortCode& code = fuPortCode(fu, port);
331  return &code != &NullFUPortCode::instance();
332 }
333 
334 
335 /**
336  * Tells whether the table has a control code that identifies the given
337  * operation and the port that carries it.
338  *
339  * @param fu Name of the function unit.
340  * @param port Name of the port.
341  * @param operation Name of the operation.
342  * @return True if the table has the control code, otherwise false.
343  */
344 bool
346  const std::string& fu,
347  const std::string& port,
348  const std::string& operation) const {
349 
350  FUPortCode& code = fuPortCode(fu, port, operation);
351  return &code != &NullFUPortCode::instance();
352 }
353 
354 
355 /**
356  * Returns the code for the given port of the given function unit.
357  *
358  * Returns a NullFUPortCode instance if the requested code is not found.
359  *
360  * @param fu Name of the function unit.
361  * @param port Name of the port.
362  * @return The control code for the requested port.
363  */
364 FUPortCode&
366  const std::string& fu,
367  const std::string& port) const {
368 
369  int codes = fuPortCodeCount();
370  for (int i = 0; i < codes; i++) {
371  FUPortCode& code = fuPortCode(i);
372  if (code.unitName() == fu && code.portName() == port &&
373  !code.hasOperation()) {
374  return code;
375  }
376  }
377 
378  return NullFUPortCode::instance();
379 }
380 
381 
382 /**
383  * Returns the code that identifies the given operation and the port that
384  * carries it.
385  *
386  * Returns a NullFUPortCode instance if the requested code is not found.
387  *
388  * @param fu Name of the function unit.
389  * @param port Name of the port.
390  * @param operation Name of the operation.
391  * @return The control code for the requested port.
392  */
393 FUPortCode&
395  const std::string& fu,
396  const std::string& port,
397  const std::string& operation) const {
398 
399  int codes = fuPortCodeCount();
400  for (int i = 0; i < codes; i++) {
401  FUPortCode& code = fuPortCode(i);
402  if (code.unitName() == fu && code.portName() == port &&
403  code.hasOperation() &&
404  StringTools::ciEqual(code.operationName(), operation)) {
405  return code;
406  }
407  }
408 
409  return NullFUPortCode::instance();
410 }
411 
412 
413 /**
414  * Adds a control code that identifies a register file.
415  *
416  * In fact, the control code identifies a RF port, but which port is
417  * irrelevant, since all ports are identical and each must be attached to a
418  * different socket. This method is to be called from the constructor of
419  * RFPortCode class.
420  *
421  * @param code The control code to be added.
422  * @exception ObjectAlreadyExists If the register file is already encoded in
423  * this table or if the encoding is ambiguous
424  * with another encoding in the socket code
425  * table.
426  */
427 void
429  assert(code.parent() == NULL);
430  const string procName = "SocketCodeTable::addRFPortCode";
431 
432  if (!code.hasEncoding() && containsPortCode()) {
433  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
434  }
435 
436  if (code.hasEncoding()) {
438  *this, code.encoding(), code.extraBits())) {
439  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
440  }
441  }
442 
443  if (hasRFPortCode(code.unitName())) {
444  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
445  }
446 
447  rfPortCodes_.push_back(&code);
448 }
449 
450 /**
451  * Removes the given RF port code.
452  *
453  * This method is to be called from the destructor of RFPortCode.
454  *
455  * @param code The code to be removed.
456  */
457 void
459  assert(code.parent() == NULL);
461 }
462 
463 
464 /**
465  * Returns the number of register file sources or destinations encoded in this
466  * table.
467  *
468  * @return The number of register file sources or destinations.
469  */
470 int
472  return rfPortCodes_.size();
473 }
474 
475 
476 /**
477  * Returns the RF code stored at the given position.
478  *
479  * @param index The position.
480  * @exception OutOfRange If the index is negative or not smaller than the
481  * number of RF codes in this table.
482  */
483 RFPortCode&
484 SocketCodeTable::rfPortCode(int index) const {
485  if (index < 0 || index >= rfPortCodeCount()) {
486  const string procName = "SocketCodeTable::rfPortCode";
487  throw OutOfRange(__FILE__, __LINE__, procName);
488  }
489 
490  return *rfPortCodes_[index];
491 }
492 
493 /**
494  * Tells whether the socket code table contains a control code for the given
495  * register file.
496  *
497  * @param regFile Name of the register file.
498  * @return True If the socket code table contains the control code, otherwise
499  * false.
500  */
501 bool
502 SocketCodeTable::hasRFPortCode(const std::string& regFile) const {
503  return &rfPortCode(regFile) != &NullRFPortCode::instance();
504 }
505 
506 
507 /**
508  * Returns the code for the given register file.
509  *
510  * Returns a NullRFPortCode instance if there is no code for the given
511  * register file in the table.
512  *
513  * @param regFile Name of the register file.
514  */
515 RFPortCode&
516 SocketCodeTable::rfPortCode(const std::string& regFile) const {
517  int codes = rfPortCodeCount();
518  for (int i = 0; i < codes; i++) {
519  RFPortCode& code = rfPortCode(i);
520  if (code.unitName() == regFile) {
521  return code;
522  }
523  }
524 
525  return NullRFPortCode::instance();
526 }
527 
528 
529 /**
530  * Adds a control code that identifies an immediate unit.
531  *
532  * In fact, the control code identifies a IU port, but which port is
533  * irrelevant, since all ports are identical and each must be attached to a
534  * different socket. This method is to be called from the constructor of
535  * IUPortCode class.
536  *
537  * @param code The control code to be added.
538  * @exception ObjectAlreadyExists If the register file is already encoded in
539  * this table or if the encoding is ambiguous
540  * with another encoding in the socket code
541  * table.
542  */
543 void
545  assert(code.parent() == NULL);
546  const string procName = "SocketCodeTable::addIUPortCode";
547 
548  if (!code.hasEncoding() && containsPortCode()) {
549  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
550  }
551 
552  if (code.hasEncoding()) {
554  *this, code.encoding(), code.extraBits())) {
555  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
556  }
557  }
558 
559  if (hasIUPortCode(code.unitName())) {
560  throw ObjectAlreadyExists(__FILE__, __LINE__, procName);
561  }
562 
563  iuPortCodes_.push_back(&code);
564 }
565 
566 /**
567  * Removes the given IU port code.
568  *
569  * This method is to be called from the destructor of IUPortCode.
570  *
571  * @param code The code to be removed.
572  */
573 void
575  assert(code.parent() == NULL);
577 }
578 
579 
580 /**
581  * Returns the number of immediate unit sources or destinations encoded in this
582  * table.
583  *
584  * @return The number of immediate unit sources or destinations.
585  */
586 int
588  return iuPortCodes_.size();
589 }
590 
591 
592 /**
593  * Returns the IU code stored at the given position.
594  *
595  * @param index The position.
596  * @exception OutOfRange If the index is negative or not smaller than the
597  * number of IU codes in this table.
598  */
599 IUPortCode&
600 SocketCodeTable::iuPortCode(int index) const {
601  if (index < 0 || index >= iuPortCodeCount()) {
602  const string procName = "SocketCodeTable::iuPortCode";
603  throw OutOfRange(__FILE__, __LINE__, procName);
604  }
605 
606  return *iuPortCodes_[index];
607 }
608 
609 /**
610  * Tells whether the socket code table contains a control code for the given
611  * immediate unit.
612  *
613  * @param immediateUnit Name of the immediate unit.
614  * @return True If the socket code table contains the control code, otherwise
615  * false.
616  */
617 bool
618 SocketCodeTable::hasIUPortCode(const std::string& immediateUnit) const {
619  return &iuPortCode(immediateUnit) != &NullIUPortCode::instance();
620 }
621 
622 
623 /**
624  * Returns the code for the given immediate unit.
625  *
626  * Returns a NullIUPortCode instance if there is no code for the given register
627  * file in the table.
628  *
629  * @param immediateUnit Name of the immediate unit.
630  */
631 IUPortCode&
632 SocketCodeTable::iuPortCode(const std::string& immediateUnit) const {
633  int codes = iuPortCodeCount();
634  for (int i = 0; i < codes; i++) {
635  IUPortCode& code = iuPortCode(i);
636  if (code.unitName() == immediateUnit) {
637  return code;
638  }
639  }
640 
641  return NullIUPortCode::instance();
642 }
643 
644 /**
645  * Returns count of all types of port codes defined in the socket table.
646  */
647 int
650 }
651 
652 /**
653  * Returns the port code stored at the given position.
654  *
655  * The possible kinds of port codes are FUPortCode, RFPortCode and IUPortCode.
656  *
657  * @param index The position.
658  * @exception OutOfRange If the index is negative or not smaller than the
659  * number of portCodeCount().
660  */
661 PortCode&
662 SocketCodeTable::portCode(int index) const {
663  if (index < 0 || index >= portCodeCount()) {
664  THROW_EXCEPTION(OutOfRange, "The given index is out of bounds. ");
665  }
666 
667  if (index < fuPortCodeCount()) {
668  return fuPortCode(index);
669  } else if (index < fuPortCodeCount() + rfPortCodeCount()) {
670  return rfPortCode(index - fuPortCodeCount());
671  } else {
672  return iuPortCode(index - fuPortCodeCount() - rfPortCodeCount());
673  }
674 }
675 
676 /**
677  * Loads the state of the socket code table from the given ObjectState
678  * instance.
679  *
680  * @param state The ObjectState instance.
681  * @exception ObjectStateLoadingException If an error occurs while loading
682  * the state.
683  */
684 void
689 
690  try {
693 
694  for (int i = 0; i < state->childCount(); i++) {
695  ObjectState* child = state->child(i);
696  if (child->name() == FUPortCode::OSNAME_FU_PORT_CODE) {
697  new FUPortCode(child, *this);
698  } else if (child->name() == RFPortCode::OSNAME_RF_PORT_CODE) {
699  new RFPortCode(child, *this);
700  } else if (child->name() == IUPortCode::OSNAME_IU_PORT_CODE) {
701  new IUPortCode(child, *this);
702  }
703  }
704  } catch (const Exception& exception) {
705  const string procName = "SocketCodeTable::loadState";
706  throw ObjectStateLoadingException(__FILE__, __LINE__, procName);
707  }
708 }
709 
710 /**
711  * Saves the state of the socket code table to an ObjectState tree.
712  *
713  * @return The newly created ObjectState tree.
714  */
717 
719  state->setAttribute(OSKEY_NAME, name());
721 
722  // add FU port codes
723  for (int i = 0; i < fuPortCodeCount(); i++) {
724  FUPortCode& code = fuPortCode(i);
725  state->addChild(code.saveState());
726  }
727 
728  // add RF port codes
729  for (int i = 0; i < rfPortCodeCount(); i++) {
730  RFPortCode& code = rfPortCode(i);
731  state->addChild(code.saveState());
732  }
733 
734  // add IU port codes
735  for (int i = 0; i < iuPortCodeCount(); i++) {
736  IUPortCode& code = iuPortCode(i);
737  state->addChild(code.saveState());
738  }
739 
740  return state;
741 }
742 
743 
744 /**
745  * Removes all the references to this socket code table from the socket
746  * encodings of the given slot field.
747  */
748 void
750  for (int i = 0; i < field.socketEncodingCount(); i++) {
751  SocketEncoding& encoding = field.socketEncoding(i);
752  if (&encoding.socketCodes() == this) {
753  encoding.unsetSocketCodes();
754  }
755  }
756 }
757 
758 
759 /**
760  * Tells whether the parent binary encoding table has a socket code table with
761  * the given name.
762  *
763  * @param name The name.
764  * @return True if the parent has a socket code table with the given name,
765  * otherwise false.
766  */
767 bool
768 SocketCodeTable::hasParentSCTable(const std::string& name) const {
769  BinaryEncoding* parent = this->parent();
770  for (int i = 0; i < parent->socketCodeTableCount(); i++) {
772  if (table.name() == name) {
773  return true;
774  }
775  }
776  return false;
777 }
778 
779 
780 /**
781  * Deletes all the RF port codes from the table.
782  */
783 void
786 }
787 
788 
789 /**
790  * Deletes all the FU port codes from the table.
791  */
792 void
795 }
796 
797 
798 /**
799  * Deletes all the IU port codes from the table.
800  */
801 void
804 }
805 
806 
807 /**
808  * Tells whether the socket code table contains a RF or IU port code without
809  * port encoding.
810  *
811  * @return True If the socket code table contains a RF or IU port code
812  * without port encoding, otherwise false.
813  */
814 bool
816  if (rfPortCodeCount() == 1 && !rfPortCode(0).hasEncoding()) {
817  return true;
818  }
819  if (iuPortCodeCount() == 1 && !iuPortCode(0).hasEncoding()) {
820  return true;
821  }
822  return false;
823 }
824 
825 
826 /**
827  * Tells whether the socket code table contains at least one port code.
828  *
829  * @return True if the table contains at least one port code, otherwise
830  * false.
831  */
832 bool
834  if (fuPortCodeCount() != 0 || rfPortCodeCount() != 0 ||
835  iuPortCodeCount() != 0) {
836  return true;
837  } else {
838  return false;
839  }
840 }
SocketCodeTable::removeReferences
void removeReferences(SlotField &field) const
Definition: SocketCodeTable.cc:749
BinaryEncoding
Definition: BinaryEncoding.hh:61
IUPortCode.hh
FUPortCode::operationName
std::string operationName() const
Definition: FUPortCode.cc:160
ObjectState::stringAttribute
std::string stringAttribute(const std::string &name) const
Definition: ObjectState.cc:249
SocketCodeTable::rfPortCodeCount
int rfPortCodeCount() const
Definition: SocketCodeTable.cc:471
PortCode
Definition: PortCode.hh:45
MoveSlot
Definition: MoveSlot.hh:60
SocketCodeTable::rfPortCodes_
RFPortCodeTable rfPortCodes_
RF port codes.
Definition: SocketCodeTable.hh:150
SocketCodeTable::SocketCodeTable
SocketCodeTable(const std::string &name, BinaryEncoding &parent)
Definition: SocketCodeTable.cc:68
SocketCodeTable::addIUPortCode
void addIUPortCode(IUPortCode &code)
Definition: SocketCodeTable.cc:544
ObjectStateLoadingException
Definition: Exception.hh:551
NullIUPortCode::instance
static NullIUPortCode & instance()
Definition: NullIUPortCode.cc:62
SocketCodeTable::fuPortCode
FUPortCode & fuPortCode(int index) const
Definition: SocketCodeTable.cc:308
SocketCodeTable::containsPortCode
bool containsPortCode() const
Definition: SocketCodeTable.cc:833
OutOfRange
Definition: Exception.hh:320
SocketCodeTable::hasRFPortCode
bool hasRFPortCode(const std::string &regFile) const
Definition: SocketCodeTable.cc:502
SequenceTools.hh
SocketCodeTable::removeRFPortCode
void removeRFPortCode(RFPortCode &code)
Definition: SocketCodeTable.cc:458
IUPortCode
Definition: IUPortCode.hh:41
SocketCodeTable::setExtraBits
void setExtraBits(int bits)
Definition: SocketCodeTable.cc:174
BinaryEncoding::socketCodeTableCount
int socketCodeTableCount() const
Definition: BinaryEncoding.cc:569
SocketCodeTable.hh
ObjectState
Definition: ObjectState.hh:59
SocketCodeTable::rfPortCode
RFPortCode & rfPortCode(int index) const
Definition: SocketCodeTable.cc:484
RFPortCode.hh
RFPortCode
Definition: RFPortCode.hh:44
FUPortCode
Definition: FUPortCode.hh:47
SocketCodeTable::fuPortCodeCount
int fuPortCodeCount() const
Definition: SocketCodeTable.cc:295
SocketCodeTable::fuPortCodes_
FUPortCodeTable fuPortCodes_
FU port codes.
Definition: SocketCodeTable.hh:148
RFPortCode::OSNAME_RF_PORT_CODE
static const std::string OSNAME_RF_PORT_CODE
ObjectState name for RF port code.
Definition: RFPortCode.hh:57
SourceField.hh
FUPortCode::OSNAME_FU_PORT_CODE
static const std::string OSNAME_FU_PORT_CODE
ObjectState name for FU port code.
Definition: FUPortCode.hh:66
SlotField::socketEncoding
SocketEncoding & socketEncoding(int index) const
Definition: SlotField.cc:170
BinaryEncoding::socketCodeTable
SocketCodeTable & socketCodeTable(int index) const
Definition: BinaryEncoding.cc:583
MoveSlot.hh
SocketCodeTable::portCodeCount
int portCodeCount() const
Definition: SocketCodeTable.cc:648
SocketCodeTable::removeIUPortCode
void removeIUPortCode(IUPortCode &code)
Definition: SocketCodeTable.cc:574
SocketCodeTable
Definition: SocketCodeTable.hh:68
SocketCodeTable::saveState
virtual ObjectState * saveState() const
Definition: SocketCodeTable.cc:716
NullIUPortCode.hh
PortCode::unitName
std::string unitName() const
Definition: PortCode.cc:140
StringTools.hh
assert
#define assert(condition)
Definition: Application.hh:86
SocketCodeTable::parent
BinaryEncoding * parent() const
Definition: SocketCodeTable.cc:126
SequenceTools::deleteAllItems
static void deleteAllItems(SequenceType &aSequence)
PortCode::extraBits
unsigned int extraBits() const
Definition: PortCode.cc:177
SocketCodeTable::loadState
virtual void loadState(const ObjectState *state)
Definition: SocketCodeTable.cc:685
PortCode::width
int width() const
Definition: PortCode.cc:188
THROW_EXCEPTION
#define THROW_EXCEPTION(exceptionType, message)
Exception wrapper macro that automatically includes file name, line number and function name where th...
Definition: Exception.hh:39
ContainerTools::removeValueIfExists
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
BinaryEncoding.hh
FUPortCode::saveState
virtual ObjectState * saveState() const
Definition: FUPortCode.cc:187
SocketCodeTable::extraBits
int extraBits() const
Definition: SocketCodeTable.cc:189
SocketCodeTable::iuPortCode
IUPortCode & iuPortCode(int index) const
Definition: SocketCodeTable.cc:600
SocketCodeTable::maxCodeWidth
int maxCodeWidth() const
Definition: SocketCodeTable.cc:212
Application.hh
ObjectState.hh
BEMTester.hh
ObjectState::child
ObjectState * child(int index) const
Definition: ObjectState.cc:471
ObjectState::addChild
void addChild(ObjectState *child)
Definition: ObjectState.cc:376
SocketCodeTable::hasFUPortCode
bool hasFUPortCode(const std::string &fu, const std::string &port) const
Definition: SocketCodeTable.cc:326
SocketCodeTable::hasRFOrIUPortCodeWithoutEncoding
bool hasRFOrIUPortCodeWithoutEncoding() const
Definition: SocketCodeTable.cc:815
ObjectState::childCount
int childCount() const
StringTools::ciEqual
static bool ciEqual(const std::string &a, const std::string &b)
Definition: StringTools.cc:240
Exception
Definition: Exception.hh:54
NullRFPortCode::instance
static NullRFPortCode & instance()
Definition: NullRFPortCode.cc:62
SocketCodeTable::hasIUPortCode
bool hasIUPortCode(const std::string &immediateUnit) const
Definition: SocketCodeTable.cc:618
BinaryEncoding::removeSocketCodeTable
void removeSocketCodeTable(SocketCodeTable &table)
Definition: BinaryEncoding.cc:645
MoveSlot::sourceField
SourceField & sourceField() const
Definition: MoveSlot.cc:277
ObjectState::name
std::string name() const
SocketEncoding.hh
SocketCodeTable::OSKEY_NAME
static const std::string OSKEY_NAME
ObjectState attribute key for name of the table.
Definition: SocketCodeTable.hh:123
BEMTester::canAddPortEncoding
static bool canAddPortEncoding(SocketCodeTable &table, unsigned int encoding, unsigned int extraBits)
Definition: BEMTester.cc:247
SocketCodeTable::setName
void setName(const std::string &name)
Definition: SocketCodeTable.cc:150
SocketCodeTable::addFUPortCode
void addFUPortCode(FUPortCode &code)
Definition: SocketCodeTable.cc:249
IUPortCode::saveState
virtual ObjectState * saveState() const
Definition: IUPortCode.cc:136
SocketCodeTable::deleteFUPortCodes
void deleteFUPortCodes()
Definition: SocketCodeTable.cc:793
SocketCodeTable::parent_
BinaryEncoding * parent_
The parent binary encoding map.
Definition: SocketCodeTable.hh:144
SocketCodeTable::iuPortCodeCount
int iuPortCodeCount() const
Definition: SocketCodeTable.cc:587
SocketCodeTable::name_
std::string name_
Name of the table.
Definition: SocketCodeTable.hh:146
IUPortCode::OSNAME_IU_PORT_CODE
static const std::string OSNAME_IU_PORT_CODE
ObjectState name for RF port code.
Definition: IUPortCode.hh:55
NullRFPortCode.hh
ObjectAlreadyExists
Definition: Exception.hh:1002
FUPortCode::hasOperation
bool hasOperation() const
Definition: FUPortCode.cc:176
SlotField
Definition: SlotField.hh:58
SocketCodeTable::iuPortCodes_
IUPortCodeTable iuPortCodes_
IU port codes.
Definition: SocketCodeTable.hh:152
BinaryEncoding::addSocketCodeTable
void addSocketCodeTable(SocketCodeTable &table)
Definition: BinaryEncoding.cc:625
SocketEncoding::unsetSocketCodes
void unsetSocketCodes()
Definition: SocketEncoding.cc:165
SocketCodeTable::OSNAME_SOCKET_CODE_TABLE
static const std::string OSNAME_SOCKET_CODE_TABLE
ObjectState name for socket code table.
Definition: SocketCodeTable.hh:121
SlotField::socketEncodingCount
int socketEncodingCount() const
Definition: SlotField.cc:156
NullFUPortCode.hh
ObjectState::intAttribute
int intAttribute(const std::string &name) const
Definition: ObjectState.cc:276
RFPortCode::saveState
virtual ObjectState * saveState() const
Definition: RFPortCode.cc:136
BinaryEncoding::moveSlot
MoveSlot & moveSlot(int index) const
Definition: BinaryEncoding.cc:121
SocketCodeTable::portCode
PortCode & portCode(int index) const
Definition: SocketCodeTable.cc:662
PortCode::hasEncoding
bool hasEncoding() const
Definition: PortCode.cc:151
MoveSlot::destinationField
DestinationField & destinationField() const
Definition: MoveSlot.cc:341
DestinationField.hh
PortCode::parent
SocketCodeTable * parent() const
Definition: PortCode.cc:226
SocketCodeTable::hasParentSCTable
bool hasParentSCTable(const std::string &name) const
Definition: SocketCodeTable.cc:768
SocketCodeTable::extraBits_
int extraBits_
The number of extra bits.
Definition: SocketCodeTable.hh:154
SocketCodeTable::~SocketCodeTable
virtual ~SocketCodeTable()
Definition: SocketCodeTable.cc:100
BinaryEncoding::moveSlotCount
int moveSlotCount() const
Definition: BinaryEncoding.cc:104
SocketCodeTable::addRFPortCode
void addRFPortCode(RFPortCode &code)
Definition: SocketCodeTable.cc:428
SocketEncoding::socketCodes
SocketCodeTable & socketCodes() const
Definition: SocketEncoding.cc:191
SocketEncoding
Definition: SocketEncoding.hh:51
FUPortCode.hh
PortCode::encoding
unsigned int encoding() const
Definition: PortCode.cc:164
NullFUPortCode::instance
static NullFUPortCode & instance()
Definition: NullFUPortCode.cc:62
SocketCodeTable::deleteIUPortCodes
void deleteIUPortCodes()
Definition: SocketCodeTable.cc:802
SocketCodeTable::width
int width() const
Definition: SocketCodeTable.cc:200
SocketCodeTable::deleteRFPortCodes
void deleteRFPortCodes()
Definition: SocketCodeTable.cc:784
SocketCodeTable::name
std::string name() const
Definition: SocketCodeTable.cc:137
SocketCodeTable::OSKEY_EXTRA_BITS
static const std::string OSKEY_EXTRA_BITS
ObjectState attribute key for the number of extra bits.
Definition: SocketCodeTable.hh:125
ObjectState::setAttribute
void setAttribute(const std::string &name, const std::string &value)
Definition: ObjectState.cc:100
FUPortCode::portName
std::string portName() const
Definition: FUPortCode.cc:147
SocketCodeTable::removeFUPortCode
void removeFUPortCode(FUPortCode &code)
Definition: SocketCodeTable.cc:283
ContainerTools.hh