OpenASIP 2.2
Loading...
Searching...
No Matches
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"
56
57#include "AssocTools.hh"
58#include "SetTools.hh"
59#include "ContainerTools.hh"
60#include "MathTools.hh"
61
62using std::string;
63using boost::format;
64using 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 */
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 */
94bool
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
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 */
144int
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 */
158std::string
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 */
172int
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 */
185std::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 */
203void
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 */
225void
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 */
316void
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 */
384void
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 */
467void
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 */
567void
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 */
595void
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 */
627void
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 */
690void
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 */
715bool
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 */
766bool
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}
#define __func__
#define assert(condition)
TTAMachine::Machine * machine
the architecture definition of the estimated processor
static bool containsKey(const ContainerType &aContainer, const KeyType &aKey)
StringVector errorMessages_
Contains the error messages.
const BinaryEncoding & bem_
The binary encoding map.
void checkMoveSlot(const TTAMachine::Bus &bus)
void checkImmediateSlot(const TTAMachine::ImmediateSlot &immSlot)
void checkDestinationField(const TTAMachine::Bus &bus)
std::string errorMessage(int index) const
bool needsSocketCodeTable(const SocketEncoding &socketEnc) const
int errorCount() const
StringVector warningMessages_
Contains the warning messages.
std::string warningMessage(int index) const
void checkSocketCodeTable(const SocketEncoding &socketEnc)
bool needsSourceField(const MoveSlot &slot) const
int warningCount() const
void checkSourceField(const TTAMachine::Bus &bus)
BEMValidator(const BinaryEncoding &bem, const TTAMachine::Machine &machine)
void checkLImmDstRegisterFields()
void checkImmediateControlField()
void checkGuardField(const TTAMachine::Bus &bus)
void checkImemMauWidth(TTAMachine::ControlUnit &gcu)
const TTAMachine::Machine & machine_
The machine.
ImmediateControlField & immediateControlField() const
LImmDstRegisterField & longImmDstRegisterField(int index) const
MoveSlot & moveSlot(int index) const
int longImmDstRegisterFieldCount() const
bool hasImmediateSlot(const std::string &name) const
virtual int width(const TCEString &templateName) const
ImmediateSlotField & immediateSlot(int index) const
bool hasMoveSlot(const std::string &name) const
bool hasImmediateControlField() const
bool hasUnconditionalGuardEncoding(bool inverted) const
bool hasGPRGuardEncoding(const std::string &regFile, int index, bool inverted) const
bool hasFUGuardEncoding(const std::string &fu, const std::string &port, bool inverted) const
bool hasTemplateEncoding(const std::string &name) const
virtual int width() const
bool usedByInstructionTemplate(const std::string &instructionTemplate) const
virtual int width() const
std::string immediateUnit(const std::string &instructionTemplate) const
static unsigned int bitLength(long unsigned int number)
SourceField & sourceField() const
Definition MoveSlot.cc:277
DestinationField & destinationField() const
Definition MoveSlot.cc:341
std::string name() const
Definition MoveSlot.cc:136
GuardField & guardField() const
Definition MoveSlot.cc:215
bool hasSourceField() const
Definition MoveSlot.cc:264
bool hasDestinationField() const
Definition MoveSlot.cc:327
bool hasGuardField() const
Definition MoveSlot.cc:202
static void intersection(const std::set< ValueType > &firstContainer, const std::set< ValueType > &secondContainer, std::set< ValueType > &intersection)
MoveSlot * parent() const
Definition SlotField.cc:98
bool hasSocketEncoding(const std::string &socket) const
Definition SlotField.cc:188
SocketEncoding & socketEncoding(int index) const
Definition SlotField.cc:170
bool hasRFPortCode(const std::string &regFile) const
bool hasIUPortCode(const std::string &immediateUnit) const
bool hasFUPortCode(const std::string &fu, const std::string &port) const
SocketCodeTable & socketCodes() const
bool hasSocketCodes() const
std::string socketName() const
SlotField * parent() const
bool hasBridgeEncoding(const std::string &bridge) const
bool hasImmediateEncoding() const
virtual int width() const
FunctionUnit * parentUnit() const
Definition BaseFUPort.cc:96
virtual bool isOpcodeSetting() const =0
virtual int numberOfRegisters() const
Bus * destinationBus() const
virtual Segment * segment(int index) const
Definition Bus.cc:329
virtual Bus * previousBus() const
Definition Bus.cc:518
int immediateWidth() const
Definition Bus.cc:160
Guard * guard(int index) const
Definition Bus.cc:456
virtual bool hasPreviousBus() const
Definition Bus.cc:473
virtual bool hasNextBus() const
Definition Bus.cc:488
virtual int segmentCount() const
Definition Bus.cc:385
int guardCount() const
Definition Bus.cc:441
virtual Bus * nextBus() const
Definition Bus.cc:501
virtual bool canRead(const Bus &bus) const
Definition Bus.cc:537
virtual TCEString name() const
virtual AddressSpace * addressSpace() const
virtual HWOperation * operation(const std::string &name) const
virtual int operationCount() const
virtual bool hasAddressSpace() const
virtual bool isInverted() const
const std::string & name() const
virtual bool isOneOfDestinations(const ImmediateUnit &dstUnit) const
ComponentType * item(int index) const
bool hasItem(const std::string &name) const
virtual ImmediateSlotNavigator immediateSlotNavigator() const
Definition Machine.cc:462
virtual BridgeNavigator bridgeNavigator() const
Definition Machine.cc:404
virtual InstructionTemplateNavigator instructionTemplateNavigator() const
Definition Machine.cc:428
virtual SocketNavigator socketNavigator() const
Definition Machine.cc:368
virtual ImmediateUnitNavigator immediateUnitNavigator() const
Definition Machine.cc:416
virtual BusNavigator busNavigator() const
Definition Machine.cc:356
virtual ControlUnit * controlUnit() const
Definition Machine.cc:345
FUPort * port() const
Unit * parentUnit() const
virtual std::string name() const
Definition Port.cc:141
const RegisterFile * registerFile() const
const Connection & connection(const Socket &socket) const
Definition Segment.cc:250
int connectionCount() const
@ OUTPUT
Data goes from port to bus.
Definition Socket.hh:60
@ INPUT
Data goes from bus to port.
Definition Socket.hh:59
Direction direction() const
Port * port(int index) const
Definition Socket.cc:266
int portCount() const