OpenASIP  2.0
BEMValidator.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 BEMValidator.cc
26  *
27  * Implementation of BEMValidator class.
28  *
29  * @author Lasse Laasonen 2005 (lasse.laasonen-no.spam-tut.fi)
30  * @author Otto Esko 2008 (otto.esko-no.spam-tut.fi)
31  * @note rating: red
32  */
33 #include <string>
34 #include <boost/format.hpp>
35 
36 #include "BEMValidator.hh"
37 
38 #include "Machine.hh"
39 #include "Segment.hh"
40 #include "Socket.hh"
41 #include "HWOperation.hh"
42 #include "Guard.hh"
43 #include "FUPort.hh"
44 #include "ControlUnit.hh"
45 
46 #include "BinaryEncoding.hh"
47 #include "MoveSlot.hh"
48 #include "DestinationField.hh"
49 #include "SourceField.hh"
50 #include "GuardField.hh"
51 #include "SocketEncoding.hh"
52 #include "SocketCodeTable.hh"
53 #include "ImmediateSlotField.hh"
54 #include "ImmediateControlField.hh"
55 #include "LImmDstRegisterField.hh"
56 
57 #include "AssocTools.hh"
58 #include "SetTools.hh"
59 #include "ContainerTools.hh"
60 #include "MathTools.hh"
61 
62 using std::string;
63 using boost::format;
64 using namespace TTAMachine;
65 
66 /**
67  * The constructor.
68  *
69  * @param bem The binary encoding map.
70  * @param machine The machine.
71  */
73  const BinaryEncoding& bem,
75  bem_(bem), machine_(machine) {
76 }
77 
78 
79 /**
80  * The destructor.
81  */
83 }
84 
85 
86 /**
87  * Validates the binary encoding map against the machine.
88  *
89  * Updates the error and warning messages that can be queried with
90  * {error,warning}Count and {error,warning}Message methods.
91  *
92  * @return True if the BEM is valid for the machine, otherwise false.
93  */
94 bool
96 
97  errorMessages_.clear();
98 
99  // check move slots for each bus
101  for (int i = 0; i < busNav.count(); i++) {
102  Bus* bus = busNav.item(i);
103  checkMoveSlot(*bus);
104  }
105 
106  // check immediate slots
107  Machine::ImmediateSlotNavigator immSlotNav =
109  for (int i = 0; i < immSlotNav.count(); i++) {
110  ImmediateSlot* immSlot = immSlotNav.item(i);
111  checkImmediateSlot(*immSlot);
112  }
113 
114  // check immediate control field
116 
117  // check long immediate destination register fields
119 
121  if (gcu == NULL) {
122  string errorMsg("Error: Couldn't find GCU from machine");
123  errorMessages_.push_back(errorMsg);
124  } else {
125  // no reason to check this as we are generating the
126  // instruction memory width according to the instruction
127  // width always (instruction indexed imem assumed)
128  // checkImemMauWidth(*gcu);
129  }
130 
131  if (errorCount() == 0) {
132  return true;
133  } else {
134  return false;
135  }
136 }
137 
138 
139 /**
140  * Returns the number of errors found.
141  *
142  * @return The number of errors.
143  */
144 int
146  return errorMessages_.size();
147 }
148 
149 
150 /**
151  * Returns an error message by the given index.
152  *
153  * @param index The index.
154  * @return The error message by the given index.
155  * @exception OutOfRange If the given index is negative or not smaller
156  * than the number of errors.
157  */
158 std::string
159 BEMValidator::errorMessage(int index) const {
160  if (index < 0 || index >= errorCount()) {
161  throw OutOfRange(__FILE__, __LINE__, __func__);
162  } else {
163  return errorMessages_[index];
164  }
165 }
166 
167 /**
168  * Returns the number of warnings found.
169  *
170  * @return The number of warnings.
171  */
172 int
174  return warningMessages_.size();
175 }
176 
177 /**
178  * Returns an warning message by the given index.
179  *
180  * @param index The index.
181  * @return The warning message by the given index.
182  * @exception OutOfRange If the given index is negative or not smaller
183  * than the number of errors.
184  */
185 std::string
187 
188  if (index < 0 || index >= warningCount()) {
189  throw OutOfRange(__FILE__, __LINE__, __func__);
190  } else {
191  return warningMessages_[index];
192  }
193 }
194 
195 /**
196  * Checks that the move slot for the given bus is valid in BEM.
197  *
198  * If errors are found, error messages are inserted to the vector of
199  * error messages.
200  *
201  * @param bus The bus.
202  */
203 void
205 
206  if (!bem_.hasMoveSlot(bus.name())) {
207  format errorMsg("BEM does not contain move slot for bus %1%.");
208  errorMsg % bus.name();
209  errorMessages_.push_back(errorMsg.str());
210  return;
211  }
212 
213  checkSourceField(bus);
215  checkGuardField(bus);
216 }
217 
218 
219 /**
220  * Checks the source field of the given bus for errors.
221  *
222  * If errors are found, inserts the error messages to the vector of error
223  * messages.
224  */
225 void
227 
228  MoveSlot& moveSlot = bem_.moveSlot(bus.name());
229 
230  // collect the output sockets to a set
231  typedef std::set<Socket*> SocketSet;
232  SocketSet outputSockets;
233 
234  for (int i = 0; i < bus.segmentCount(); i++) {
235  Segment* segment = bus.segment(i);
236  for (int i = 0; i < segment->connectionCount(); i++) {
237  Socket* socket = segment->connection(i);
238  if (socket->portCount() > 0 &&
239  socket->direction() == Socket::OUTPUT) {
240  outputSockets.insert(socket);
241  }
242  }
243  }
244 
245  if (needsSourceField(moveSlot)) {
246  if (!moveSlot.hasSourceField()) {
247  format errorMsg(
248  "Move slot of bus %1% does not contain source field.");
249  errorMsg % bus.name();
250  errorMessages_.push_back(errorMsg.str());
251  } else {
252  // check the source field for socket encodings
253  SourceField& srcField = moveSlot.sourceField();
254  for (SocketSet::const_iterator iter = outputSockets.begin();
255  iter != outputSockets.end(); iter++) {
256  Socket* socket = *iter;
257  if (!srcField.hasSocketEncoding(socket->name())) {
258  format errorMsg(
259  "Source field of move slot of bus %1% does not"
260  "have an encoding for socket %2%.");
261  errorMsg % bus.name() % socket->name();
262  errorMessages_.push_back(errorMsg.str());
263  } else {
264  SocketEncoding& socketEnc = srcField.socketEncoding(
265  socket->name());
266  if (needsSocketCodeTable(socketEnc)) {
267  if (!socketEnc.hasSocketCodes()) {
268  format errorMsg(
269  "Encoding of socket %1% in source "
270  "field of move slot %2% does not refer to "
271  "any socket code table.");
272  errorMsg % socket->name() % bus.name();
273  errorMessages_.push_back(errorMsg.str());
274  } else {
275  checkSocketCodeTable(socketEnc);
276  }
277  }
278  }
279  }
280 
281  // check the source field for bridge encodings
283  for (int i = 0; i < bridgeNav.count(); i++) {
284  Bridge* bridge = bridgeNav.item(i);
285  if (bridge->destinationBus() == &bus &&
286  !moveSlot.sourceField().hasBridgeEncoding(
287  bridge->name())) {
288  format errorMsg(
289  "Source field of bus %1% does not have encoding "
290  "for bridge %2%.");
291  errorMsg % bus.name() % bridge->name();
292  errorMessages_.push_back(errorMsg.str());
293  }
294  }
295 
296  // check the source field for immediate encoding
297  if (bus.immediateWidth() > 0 &&
298  !srcField.hasImmediateEncoding()) {
299  format errorMsg(
300  "Source field of bus %1% does not have an immediate "
301  "encoding.");
302  errorMsg % bus.name();
303  errorMessages_.push_back(errorMsg.str());
304  }
305  }
306  }
307 }
308 
309 
310 /**
311  * Checks the destination field of the given bus for errors.
312  *
313  * If errors are found, inserts the error messages to the vector of error
314  * messages.
315  */
316 void
318 
319  MoveSlot& moveSlot = bem_.moveSlot(bus.name());
320 
321  // collect the input sockets to a set
322  typedef std::set<Socket*> SocketSet;
323  SocketSet inputSockets;
324 
325  for (int i = 0; i < bus.segmentCount(); i++) {
326  Segment* segment = bus.segment(i);
327  for (int i = 0; i < segment->connectionCount(); i++) {
328  Socket* socket = segment->connection(i);
329  if (socket->portCount() > 0 &&
330  socket->direction() == Socket::INPUT) {
331  inputSockets.insert(socket);
332  }
333  }
334  }
335 
336  // check the destination field
337  if (inputSockets.size() > 1) {
338  if (!moveSlot.hasDestinationField()) {
339  format errorMsg(
340  "Move slot of bus %1% does not contain destination field.");
341  errorMsg % bus.name();
342  errorMessages_.push_back(errorMsg.str());
343  } else {
344  DestinationField& dstField = moveSlot.destinationField();
345  for (SocketSet::const_iterator iter = inputSockets.begin();
346  iter != inputSockets.end(); iter++) {
347  Socket* socket = *iter;
348  if (!dstField.hasSocketEncoding(socket->name())) {
349  format errorMsg(
350  "Destination field of move slot of bus %1% does not"
351  "have an encoding for socket %2%.");
352  errorMsg % bus.name() % socket->name();
353  errorMessages_.push_back(errorMsg.str());
354  } else {
355  SocketEncoding& socketEnc = dstField.socketEncoding(
356  socket->name());
357  if (needsSocketCodeTable(socketEnc)) {
358  if (!socketEnc.hasSocketCodes()) {
359  format errorMsg(
360  "Encoding of socket %1% in destination "
361  "field of move slot %2% does not refer to "
362  "any socket code table.");
363  errorMsg % socket->name() % bus.name();
364  errorMessages_.push_back(errorMsg.str());
365  } else {
366  checkSocketCodeTable(socketEnc);
367  }
368  }
369  }
370  }
371  }
372  }
373 }
374 
375 
376 /**
377  * Checks the guard field of the given bus for errors.
378  *
379  * If errors are found, inserts the error messages to the vector of error
380  * messages.
381  *
382  * @param bus The bus.
383  */
384 void
386 
387  MoveSlot& slot = bem_.moveSlot(bus.name());
388 
389  if (bus.guardCount() < 2) {
390  return;
391  } else if (!slot.hasGuardField()) {
392  format errorMsg("Move slot %1% does not contain guard field.");
393  errorMsg % bus.name();
394  errorMessages_.push_back(errorMsg.str());
395  return;
396  }
397 
398  GuardField& grdField = slot.guardField();
399 
400  for (int i = 0; i < bus.guardCount(); i++) {
401  Guard* guard = bus.guard(i);
402  UnconditionalGuard* ucGuard =
403  dynamic_cast<UnconditionalGuard*>(guard);
404  PortGuard* portGuard = dynamic_cast<PortGuard*>(guard);
405  RegisterGuard* regGuard = dynamic_cast<RegisterGuard*>(guard);
406  if (ucGuard != NULL &&
407  !grdField.hasUnconditionalGuardEncoding(ucGuard->isInverted())) {
408  format errorMsg(
409  "Guard field of move slot %1% does not have encoding "
410  "for always-%2% guard.");
411  errorMsg % bus.name();
412  if (ucGuard->isInverted()) {
413  errorMsg % "false";
414  } else {
415  errorMsg % "true";
416  }
417  errorMessages_.push_back(errorMsg.str());
418 
419  } else if (portGuard != NULL) {
420  FUPort* port = portGuard->port();
421  FunctionUnit* fu = port->parentUnit();
422  if (!grdField.hasFUGuardEncoding(
423  fu->name(), port->name(), portGuard->isInverted())) {
424  format errorMsg(
425  "Guard field of move slot %1% does not have encoding "
426  "for %2% FU port guard of port %3% of FU %4%.");
427  errorMsg % bus.name();
428  if (portGuard->isInverted()) {
429  errorMsg % "inverted";
430  } else {
431  errorMsg % "non-inverted";
432  }
433  errorMsg % port->name() % fu->name();
434  errorMessages_.push_back(errorMsg.str());
435  }
436  } else if (regGuard != NULL) {
437  string regFile = regGuard->registerFile()->name();
438  if (!grdField.hasGPRGuardEncoding(
439  regFile, regGuard->registerIndex(),
440  regGuard->isInverted())) {
441  format errorMsg(
442  "Guard field of move slot %1% does not have encoding "
443  "for %2% GPR guard of register %3% of register file "
444  "%4%.");
445  errorMsg % bus.name();
446  if (regGuard->isInverted()) {
447  errorMsg % "inverted";
448  } else {
449  errorMsg % "non-inverted";
450  }
451  errorMsg % regGuard->registerIndex() % regFile;
452  errorMessages_.push_back(errorMsg.str());
453  }
454  }
455  }
456 }
457 
458 
459 /**
460  * Checks that the socket code table of the given socket encoding is valid.
461  *
462  * If errors are found, inserts the error messages to the vector of error
463  * messages.
464  *
465  * @param socketEnc The socket encoding.
466  */
467 void
469 
470  SlotField* slotField = socketEnc.parent();
471  bool srcField = (dynamic_cast<SourceField*>(slotField) != NULL);
472  string busName = slotField->parent()->name();
473  string socketName = socketEnc.socketName();
474 
475  assert(socketEnc.hasSocketCodes());
476  SocketCodeTable& table = socketEnc.socketCodes();
478  assert(socketNav.hasItem(socketName));
479  Socket* socket = socketNav.item(socketName);
480 
481  for (int i = 0; i < socket->portCount(); i++) {
482  Port* port = socket->port(i);
483  Unit* parentUnit = port->parentUnit();
484  FunctionUnit* fu = dynamic_cast<FunctionUnit*>(parentUnit);
485  RegisterFile* rf = dynamic_cast<RegisterFile*>(parentUnit);
486  ImmediateUnit* iu = dynamic_cast<ImmediateUnit*>(parentUnit);
487 
488  if (fu != NULL) {
489  BaseFUPort* fuPort = dynamic_cast<BaseFUPort*>(port);
490  assert(fuPort != NULL);
491  if (fuPort->isOpcodeSetting()) {
492  for (int i = 0; i < fu->operationCount(); i++) {
493  HWOperation* operation = fu->operation(i);
494  if (!table.hasFUPortCode(
495  fu->name(), port->name(), operation->name())) {
496  format errorMsg(
497  "Socket code table of socket %1% in %2% field "
498  "of move slot %3% does not contain FU port code "
499  "for operation %4% for port %5% of FU %6%.");
500  errorMsg % socketEnc.socketName();
501  if (srcField) {
502  errorMsg % "source";
503  } else {
504  errorMsg % "destination";
505  }
506  errorMsg % busName % operation->name() %
507  port->name() % fu->name();
508  errorMessages_.push_back(errorMsg.str());
509  }
510  }
511  } else {
512  if (!table.hasFUPortCode(fu->name(), port->name())) {
513  format errorMsg(
514  "Socket code table of socket %1% in %2% field of "
515  "move slot %3% does not contain FU port code for "
516  "port %4% of FU %5%.");
517  errorMsg % socketEnc.socketName();
518  if (srcField) {
519  errorMsg % "source";
520  } else {
521  errorMsg % "destination";
522  }
523  errorMsg % busName % port->name() % fu->name();
524  errorMessages_.push_back(errorMsg.str());
525  }
526  }
527 
528  } else if (rf != NULL && iu == NULL
529  && !table.hasRFPortCode(rf->name())) {
530  format errorMsg(
531  "Socket code table of socket %1% in %2% field of move "
532  "slot %3% does not contain RF port code for RF %4%.");
533  errorMsg % socketName;
534  if (srcField) {
535  errorMsg % "source";
536  } else {
537  errorMsg % "destination";
538  }
539  errorMsg % busName % rf->name();
540  errorMessages_.push_back(errorMsg.str());
541  } else if (iu != NULL && !table.hasIUPortCode(iu->name())) {
542  format errorMsg(
543  "Socket code table of socket %1% in %2% field of move slot "
544  "%3% does not contain IU port code for IU %4%.");
545  errorMsg % socketName;
546  if (srcField) {
547  errorMsg % "source";
548  } else {
549  errorMsg % "destination";
550  }
551  errorMsg % busName % iu->name();
552  errorMessages_.push_back(errorMsg.str());
553  }
554  }
555 }
556 
557 
558 /**
559  * Checks that the BEM contains a valid immediate slot field for the given
560  * immediate slot.
561  *
562  * If errors are found, inserts the error messages to the vector of error
563  * messages.
564  *
565  * @param immSlot The immediate slot.
566  */
567 void
569 
570  if (immSlot.width() == 0) {
571  return;
572  }
573 
574  if (!bem_.hasImmediateSlot(immSlot.name())) {
575  format errorMsg(
576  "BEM does not contain field for immediate slot %1%.");
577  errorMsg % immSlot.name();
578  errorMessages_.push_back(errorMsg.str());
579  } else {
580  ImmediateSlotField& field = bem_.immediateSlot(immSlot.name());
581  if (field.width() < immSlot.width()) {
582  format errorMsg("Immediate slot %1% is too narrow in BEM.");
583  errorMessages_.push_back(errorMsg.str());
584  }
585  }
586 }
587 
588 
589 /**
590  * Checks that the BEM contains a valid immediate control field.
591  *
592  * If errors are found, inserts the error messages to the vector of error
593  * messages.
594  */
595 void
599  if (iTempNav.count() > 1) {
601  string errorMsg("BEM does not contain immediate control field.");
602  errorMessages_.push_back(errorMsg);
603  } else {
605  for (int i = 0; i < iTempNav.count(); i++) {
606  InstructionTemplate* iTemp = iTempNav.item(i);
607  if (!field.hasTemplateEncoding(iTemp->name())) {
608  format errorMsg(
609  "Immediate control field does not have encoding "
610  "for instruction template %1%.");
611  errorMsg % iTemp->name();
612  errorMessages_.push_back(errorMsg.str());
613  }
614  }
615  }
616  }
617 }
618 
619 
620 /**
621  * Checks that the BEM contains valid long immediate destination register
622  * fields.
623  *
624  * If errors are found, inserts the error messages to the vector of error
625  * messages.
626  */
627 void
629 
634 
635  for (int i = 0; i < itNav.count(); i++) {
636 
637  InstructionTemplate* iTemp = itNav.item(i);
638  typedef std::set<std::string> StringSet;
639 
640  StringSet iTempDestinations;
641  for (int i = 0; i < iuNav.count(); i++) {
642  ImmediateUnit* iu = iuNav.item(i);
643  if (iTemp->isOneOfDestinations(*iu) &&
644  iu->numberOfRegisters() > 1) {
645  iTempDestinations.insert(iu->name());
646  }
647  }
648 
649  StringSet destinationsInBEM;
650  for (int i = 0; i < bem_.longImmDstRegisterFieldCount(); i++) {
652  if (field.usedByInstructionTemplate(iTemp->name())) {
653  string dstIU = field.immediateUnit(iTemp->name());
654  destinationsInBEM.insert(dstIU);
655  if (AssocTools::containsKey(iTempDestinations, dstIU)) {
656  ImmediateUnit* iu = iuNav.item(dstIU);
657  int regIndexWidth = MathTools::bitLength(
658  iu->numberOfRegisters() - 1);
659  if (field.width() < regIndexWidth) {
660  format errorMsg(
661  "Long immediate destination register field is "
662  "too narrow for destination %1% in instruction "
663  "template %2%.");
664  errorMsg % dstIU % iTemp->name();
665  errorMessages_.push_back(errorMsg.str());
666  }
667  }
668  }
669  }
670 
671  StringSet intersection;
673  iTempDestinations, destinationsInBEM, intersection);
674  if (intersection.size() < iTempDestinations.size()) {
675  format errorMsg(
676  "Long immediate destination register fields do not "
677  "cover all the destinations of instruction template %1%.");
678  errorMsg % iTemp->name();
679  errorMessages_.push_back(errorMsg.str());
680  }
681  }
682 }
683 
684 /**
685  * Checks that the instruction memory width (MAU) is greater or equal than
686  * the width of one instruction.
687  *
688  * @param gcu Global Control Unit of the machine
689  */
690 void
692  int imemWidth = 0;
693  if (gcu.hasAddressSpace()) {
694  imemWidth = gcu.addressSpace()->width();
695  } else {
696  string errorMsg("GCU does not have an address space");
697  errorMessages_.push_back(errorMsg);
698  }
699  int instructionWidth = bem_.width();
700 
701  if (imemWidth < instructionWidth) {
702  string warningMsg(
703  "Warning: Instruction width is greater than the instruction "
704  "memory width.");
705  warningMessages_.push_back(warningMsg);
706  }
707 }
708 
709 /**
710  * Tells whether the given move slot needs source field.
711  *
712  * @param slot The move slot.
713  * @return True if the move slot needs source field, otherwise false.
714  */
715 bool
717 
718  string busName = slot.name();
720  assert(busNav.hasItem(busName));
721  Bus* bus = busNav.item(busName);
722 
723  // check output sockets
724  for (int i = 0; i < bus->segmentCount(); i++) {
725  Segment* segment = bus->segment(i);
726  for (int i = 0; i < segment->connectionCount(); i++) {
727  Socket* socket = segment->connection(i);
728  if (socket->portCount() > 0 &&
729  socket->direction() == Socket::OUTPUT) {
730  return true;
731  }
732  }
733  }
734 
735  // check bridges
736  if (bus->hasNextBus()) {
737  Bus* nextBus = bus->nextBus();
738  if (bus->canRead(*nextBus)) {
739  return true;
740  }
741  }
742 
743  if (bus->hasPreviousBus()) {
744  Bus* prevBus = bus->previousBus();
745  if (bus->canRead(*prevBus)) {
746  return true;
747  }
748  }
749 
750  // check immediate
751  if (bus->immediateWidth() > 0) {
752  return true;
753  }
754 
755  return false;
756 }
757 
758 
759 /**
760  * Tells whether the given socket encoding needs a socket code table.
761  *
762  * @param socketEnc The socket encoding.
763  * @return True if the socket encoding needs a socket code table, otherwise
764  * false.
765  */
766 bool
768 
769  string socketName = socketEnc.socketName();
771  assert(socketNav.hasItem(socketName));
772  Socket* socket = socketNav.item(socketName);
773 
774  if (socket->portCount() > 1) {
775  return true;
776  } else if (socket->portCount() == 0) {
777  return false;
778  }
779 
780  Port* port = socket->port(0);
781  Unit* unit = port->parentUnit();
782  BaseRegisterFile* rf = dynamic_cast<BaseRegisterFile*>(unit);
783  if (rf != NULL && rf->numberOfRegisters() > 1) {
784  return true;
785  }
786 
787  FunctionUnit* fu = dynamic_cast<FunctionUnit*>(unit);
788  if (fu != NULL) {
789  BaseFUPort* fuPort = dynamic_cast<BaseFUPort*>(port);
790  assert(fuPort != NULL);
791  if (fuPort->isOpcodeSetting() && fu->operationCount() > 1) {
792  return true;
793  }
794  }
795 
796  return false;
797 }
BEMValidator::~BEMValidator
~BEMValidator()
Definition: BEMValidator.cc:82
TTAMachine::Bus::immediateWidth
int immediateWidth() const
Definition: Bus.cc:160
TTAMachine::Guard
Definition: Guard.hh:55
BinaryEncoding::immediateSlot
ImmediateSlotField & immediateSlot(int index) const
Definition: BinaryEncoding.cc:234
BEMValidator::checkDestinationField
void checkDestinationField(const TTAMachine::Bus &bus)
Definition: BEMValidator.cc:317
BinaryEncoding
Definition: BinaryEncoding.hh:61
BEMValidator::checkImmediateControlField
void checkImmediateControlField()
Definition: BEMValidator.cc:596
MoveSlot::name
std::string name() const
Definition: MoveSlot.cc:136
TTAMachine::Socket::port
Port * port(int index) const
Definition: Socket.cc:266
TTAMachine::Socket::portCount
int portCount() const
BEMValidator::BEMValidator
BEMValidator(const BinaryEncoding &bem, const TTAMachine::Machine &machine)
Definition: BEMValidator.cc:72
BinaryEncoding::hasMoveSlot
bool hasMoveSlot(const std::string &name) const
Definition: BinaryEncoding.cc:138
TTAMachine::Bridge::destinationBus
Bus * destinationBus() const
GuardField::hasFUGuardEncoding
bool hasFUGuardEncoding(const std::string &fu, const std::string &port, bool inverted) const
Definition: GuardField.cc:410
TTAMachine::Component::name
virtual TCEString name() const
Definition: MachinePart.cc:125
BEMValidator::checkMoveSlot
void checkMoveSlot(const TTAMachine::Bus &bus)
Definition: BEMValidator.cc:204
TTAMachine::PortGuard::port
FUPort * port() const
DestinationField
Definition: DestinationField.hh:44
MoveSlot
Definition: MoveSlot.hh:60
TTAMachine::FunctionUnit::hasAddressSpace
virtual bool hasAddressSpace() const
Definition: FunctionUnit.cc:608
machine
TTAMachine::Machine * machine
the architecture definition of the estimated processor
Definition: EstimatorCmdLineUI.cc:59
TTAMachine::HWOperation
Definition: HWOperation.hh:52
TTAMachine::RegisterGuard::registerIndex
int registerIndex() const
TTAMachine::BaseFUPort::parentUnit
FunctionUnit * parentUnit() const
Definition: BaseFUPort.cc:96
TTAMachine::Bridge
Definition: Bridge.hh:51
BEMValidator::validate
bool validate()
Definition: BEMValidator.cc:95
TTAMachine::Segment
Definition: Segment.hh:54
BinaryEncoding::longImmDstRegisterFieldCount
int longImmDstRegisterFieldCount() const
Definition: BinaryEncoding.cc:400
AssocTools::containsKey
static bool containsKey(const ContainerType &aContainer, const KeyType &aKey)
GuardField.hh
SlotField::hasSocketEncoding
bool hasSocketEncoding(const std::string &socket) const
Definition: SlotField.cc:188
SourceField::hasImmediateEncoding
bool hasImmediateEncoding() const
Definition: SourceField.cc:279
OutOfRange
Definition: Exception.hh:320
SocketCodeTable::hasRFPortCode
bool hasRFPortCode(const std::string &regFile) const
Definition: SocketCodeTable.cc:502
BEMValidator.hh
TTAMachine::Bus
Definition: Bus.hh:53
TTAMachine::BaseFUPort
Definition: BaseFUPort.hh:44
BinaryEncoding::hasImmediateControlField
bool hasImmediateControlField() const
Definition: BinaryEncoding.cc:334
MoveSlot::hasGuardField
bool hasGuardField() const
Definition: MoveSlot.cc:202
SocketCodeTable.hh
ImmediateSlotField.hh
GuardField
Definition: GuardField.hh:55
TTAMachine::FunctionUnit::addressSpace
virtual AddressSpace * addressSpace() const
Definition: FunctionUnit.cc:580
SourceField.hh
TTAMachine::Machine::Navigator::count
int count() const
TTAMachine::Socket::direction
Direction direction() const
TTAMachine::Bus::segment
virtual Segment * segment(int index) const
Definition: Bus.cc:329
BEMValidator::warningCount
int warningCount() const
Definition: BEMValidator.cc:173
SlotField::socketEncoding
SocketEncoding & socketEncoding(int index) const
Definition: SlotField.cc:170
TTAMachine::Bus::hasPreviousBus
virtual bool hasPreviousBus() const
Definition: Bus.cc:473
BEMValidator::checkGuardField
void checkGuardField(const TTAMachine::Bus &bus)
Definition: BEMValidator.cc:385
MoveSlot.hh
Socket.hh
ImmediateSlotField
Definition: ImmediateSlotField.hh:44
TTAMachine::BaseFUPort::isOpcodeSetting
virtual bool isOpcodeSetting() const =0
SocketCodeTable
Definition: SocketCodeTable.hh:68
ImmediateControlField::hasTemplateEncoding
bool hasTemplateEncoding(const std::string &name) const
Definition: ImmediateControlField.cc:167
TTAMachine::BaseRegisterFile::numberOfRegisters
virtual int numberOfRegisters() const
BEMValidator::warningMessages_
StringVector warningMessages_
Contains the warning messages.
Definition: BEMValidator.hh:95
TTAMachine::InstructionTemplate
Definition: InstructionTemplate.hh:49
assert
#define assert(condition)
Definition: Application.hh:86
TTAMachine::FunctionUnit
Definition: FunctionUnit.hh:55
TTAMachine::Segment::connectionCount
int connectionCount() const
TTAMachine::UnconditionalGuard
Definition: Guard.hh:180
MoveSlot::hasSourceField
bool hasSourceField() const
Definition: MoveSlot.cc:264
TTAMachine::FUPort
Definition: FUPort.hh:46
BEMValidator::needsSourceField
bool needsSourceField(const MoveSlot &slot) const
Definition: BEMValidator.cc:716
Segment.hh
SourceField::hasBridgeEncoding
bool hasBridgeEncoding(const std::string &bridge) const
Definition: SourceField.cc:169
TTAMachine::BaseRegisterFile
Definition: BaseRegisterFile.hh:48
TTAMachine::Machine::controlUnit
virtual ControlUnit * controlUnit() const
Definition: Machine.cc:345
TTAMachine::Bus::canRead
virtual bool canRead(const Bus &bus) const
Definition: Bus.cc:537
HWOperation.hh
ImmediateControlField
Definition: ImmediateControlField.hh:57
TTAMachine::Unit
Definition: Unit.hh:51
TTAMachine::HWOperation::name
const std::string & name() const
Definition: HWOperation.cc:141
BEMValidator::machine_
const TTAMachine::Machine & machine_
The machine.
Definition: BEMValidator.hh:90
TTAMachine::Machine::bridgeNavigator
virtual BridgeNavigator bridgeNavigator() const
Definition: Machine.cc:404
MoveSlot::guardField
GuardField & guardField() const
Definition: MoveSlot.cc:215
TTAMachine::Machine::immediateUnitNavigator
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition: Machine.cc:416
TTAMachine::ControlUnit
Definition: ControlUnit.hh:50
TTAMachine::RegisterGuard
Definition: Guard.hh:137
BinaryEncoding.hh
TTAMachine::Port
Definition: Port.hh:54
MoveSlot::hasDestinationField
bool hasDestinationField() const
Definition: MoveSlot.cc:327
BEMValidator::needsSocketCodeTable
bool needsSocketCodeTable(const SocketEncoding &socketEnc) const
Definition: BEMValidator.cc:767
TTAMachine::Machine::Navigator::hasItem
bool hasItem(const std::string &name) const
BEMValidator::checkImmediateSlot
void checkImmediateSlot(const TTAMachine::ImmediateSlot &immSlot)
Definition: BEMValidator.cc:568
BinaryEncoding::width
virtual int width(const TCEString &templateName) const
Definition: BinaryEncoding.cc:768
SocketEncoding::socketName
std::string socketName() const
Definition: SocketEncoding.cc:145
GuardField::hasGPRGuardEncoding
bool hasGPRGuardEncoding(const std::string &regFile, int index, bool inverted) const
Definition: GuardField.cc:313
__func__
#define __func__
Definition: Application.hh:67
LImmDstRegisterField::immediateUnit
std::string immediateUnit(const std::string &instructionTemplate) const
Definition: LImmDstRegisterField.cc:197
TTAMachine::Socket
Definition: Socket.hh:53
Guard.hh
TTAMachine::FunctionUnit::operationCount
virtual int operationCount() const
Definition: FunctionUnit.cc:419
SocketEncoding::hasSocketCodes
bool hasSocketCodes() const
Definition: SocketEncoding.cc:177
SocketCodeTable::hasFUPortCode
bool hasFUPortCode(const std::string &fu, const std::string &port) const
Definition: SocketCodeTable.cc:326
GuardField::hasUnconditionalGuardEncoding
bool hasUnconditionalGuardEncoding(bool inverted) const
Definition: GuardField.cc:471
LImmDstRegisterField::width
virtual int width() const
Definition: LImmDstRegisterField.cc:213
Machine.hh
SocketCodeTable::hasIUPortCode
bool hasIUPortCode(const std::string &immediateUnit) const
Definition: SocketCodeTable.cc:618
TTAMachine::Machine::socketNavigator
virtual SocketNavigator socketNavigator() const
Definition: Machine.cc:368
MoveSlot::sourceField
SourceField & sourceField() const
Definition: MoveSlot.cc:277
TTAMachine::InstructionTemplate::isOneOfDestinations
virtual bool isOneOfDestinations(const ImmediateUnit &dstUnit) const
Definition: InstructionTemplate.cc:323
ImmediateSlotField::width
virtual int width() const
Definition: ImmediateSlotField.cc:167
TTAMachine::Bus::guardCount
int guardCount() const
Definition: Bus.cc:441
TTAMachine::Segment::connection
const Connection & connection(const Socket &socket) const
Definition: Segment.cc:250
TTAMachine::ImmediateSlot::width
int width() const
Definition: ImmediateSlot.cc:117
TTAMachine::Machine::immediateSlotNavigator
virtual ImmediateSlotNavigator immediateSlotNavigator() const
Definition: Machine.cc:462
TTAMachine::Bus::guard
Guard * guard(int index) const
Definition: Bus.cc:456
SocketEncoding.hh
ImmediateControlField.hh
BEMValidator::checkSocketCodeTable
void checkSocketCodeTable(const SocketEncoding &socketEnc)
Definition: BEMValidator.cc:468
TTAMachine::AddressSpace::width
virtual int width() const
Definition: AddressSpace.cc:155
SetTools::intersection
static void intersection(const std::set< ValueType > &firstContainer, const std::set< ValueType > &secondContainer, std::set< ValueType > &intersection)
LImmDstRegisterField::usedByInstructionTemplate
bool usedByInstructionTemplate(const std::string &instructionTemplate) const
Definition: LImmDstRegisterField.cc:181
TTAMachine::Bus::hasNextBus
virtual bool hasNextBus() const
Definition: Bus.cc:488
BEMValidator::errorMessages_
StringVector errorMessages_
Contains the error messages.
Definition: BEMValidator.hh:93
BinaryEncoding::hasImmediateSlot
bool hasImmediateSlot(const std::string &name) const
Definition: BinaryEncoding.cc:252
SetTools.hh
TTAMachine::Guard::isInverted
virtual bool isInverted() const
BEMValidator::errorCount
int errorCount() const
Definition: BEMValidator.cc:145
TTAMachine::Bus::previousBus
virtual Bus * previousBus() const
Definition: Bus.cc:518
AssocTools.hh
TTAMachine::Port::name
virtual std::string name() const
Definition: Port.cc:141
SlotField
Definition: SlotField.hh:58
BEMValidator::errorMessage
std::string errorMessage(int index) const
Definition: BEMValidator.cc:159
SocketEncoding::parent
SlotField * parent() const
Definition: SocketEncoding.cc:127
FUPort.hh
MathTools::bitLength
static unsigned int bitLength(long unsigned int number)
ControlUnit.hh
TTAMachine::Machine::busNavigator
virtual BusNavigator busNavigator() const
Definition: Machine.cc:356
LImmDstRegisterField
Definition: LImmDstRegisterField.hh:47
BEMValidator::bem_
const BinaryEncoding & bem_
The binary encoding map.
Definition: BEMValidator.hh:88
BinaryEncoding::immediateControlField
ImmediateControlField & immediateControlField() const
Definition: BinaryEncoding.cc:348
BinaryEncoding::moveSlot
MoveSlot & moveSlot(int index) const
Definition: BinaryEncoding.cc:121
TTAMachine::Machine::Navigator::item
ComponentType * item(int index) const
MoveSlot::destinationField
DestinationField & destinationField() const
Definition: MoveSlot.cc:341
TTAMachine::PortGuard
Definition: Guard.hh:99
TTAMachine::FunctionUnit::operation
virtual HWOperation * operation(const std::string &name) const
Definition: FunctionUnit.cc:363
TTAMachine::RegisterFile
Definition: RegisterFile.hh:47
DestinationField.hh
MathTools.hh
TTAMachine
Definition: Assembler.hh:48
TTAMachine::Bus::nextBus
virtual Bus * nextBus() const
Definition: Bus.cc:501
SocketEncoding::socketCodes
SocketCodeTable & socketCodes() const
Definition: SocketEncoding.cc:191
SocketEncoding
Definition: SocketEncoding.hh:51
SlotField::parent
MoveSlot * parent() const
Definition: SlotField.cc:98
TTAMachine::Machine::instructionTemplateNavigator
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition: Machine.cc:428
BinaryEncoding::longImmDstRegisterField
LImmDstRegisterField & longImmDstRegisterField(int index) const
Definition: BinaryEncoding.cc:415
TTAMachine::RegisterGuard::registerFile
const RegisterFile * registerFile() const
TTAMachine::Machine::Navigator
Definition: Machine.hh:186
TTAMachine::Bus::segmentCount
virtual int segmentCount() const
Definition: Bus.cc:385
LImmDstRegisterField.hh
TTAMachine::ImmediateSlot
Definition: ImmediateSlot.hh:44
BEMValidator::checkLImmDstRegisterFields
void checkLImmDstRegisterFields()
Definition: BEMValidator.cc:628
BEMValidator::checkImemMauWidth
void checkImemMauWidth(TTAMachine::ControlUnit &gcu)
Definition: BEMValidator.cc:691
BEMValidator::warningMessage
std::string warningMessage(int index) const
Definition: BEMValidator.cc:186
TTAMachine::Machine
Definition: Machine.hh:73
ContainerTools.hh
BEMValidator::checkSourceField
void checkSourceField(const TTAMachine::Bus &bus)
Definition: BEMValidator.cc:226
TTAMachine::Port::parentUnit
Unit * parentUnit() const
SourceField
Definition: SourceField.hh:48
TTAMachine::ImmediateUnit
Definition: ImmediateUnit.hh:50