OpenASIP 2.2
Loading...
Searching...
No Matches
FunctionUnit.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 FunctionUnit.cc
26 *
27 * Implementation of class FunctionUnit.
28 *
29 * @author Lasse Laasonen 2003 (lasse.laasonen-no.spam-tut.fi)
30 */
31
32#include "FunctionUnit.hh"
33#include "HWOperation.hh"
34#include "ExecutionPipeline.hh"
35#include "Machine.hh"
36#include "FUPort.hh"
37#include "Guard.hh"
38#include "AddressSpace.hh"
39#include "ControlUnit.hh"
40#include "PipelineElement.hh"
41#include "MOMTextGenerator.hh"
42#include "Application.hh"
43#include "ContainerTools.hh"
44#include "StringTools.hh"
45#include "ResourceVector.hh"
46#include "ResourceVectorSet.hh"
47#include "CIStringSet.hh"
48#include "ObjectState.hh"
49
50using std::string;
51using boost::format;
52
53namespace TTAMachine {
54
55// initialization of static data members
56const string FunctionUnit::OSNAME_FU = "fu";
57const string FunctionUnit::OSKEY_AS = "as";
58const string FunctionUnit::OSKEY_ORDER_NUMBER = "order_no";
59
60/**
61 * Constructor.
62 *
63 * @param name Name of the function unit.
64 * @exception InvalidName If the given name is not a valid component name.
65 */
66FunctionUnit::FunctionUnit(const string& name)
67 : Unit(name), addressSpace_(NULL), orderNumber_(0) {}
68
69/**
70 * Constructor.
71 *
72 * Loads the state of the function unit from the given ObjectState instance.
73 * Does not load references to other components.
74 *
75 * @param state The ObjectState instance to load the state from.
76 * @exception ObjectStateLoadingException If the given ObjectState instance
77 * is invalid.
78 */
80 : Unit(state), addressSpace_(NULL), orderNumber_(0) {
82}
83
84/**
85 * Destructor.
86 *
87 * Deletes all the operations.
88 */
93
94
95/**
96 * Copies the instance.
97 *
98 * Current FunctionUnit state is copied to a new FunctionUnit object.
99 *
100 * @return Copy of the instance.
101 */
104
105 return new FunctionUnit(saveState());
106}
107
108
109/**
110 * Sets the name of the function unit.
111 *
112 * @param name Name of the function unit.
113 * @exception ComponentAlreadyExists If a function unit with the given name
114 * is already in the same machine.
115 * @exception InvalidName If the given name is not a valid component name.
116 */
117void
118FunctionUnit::setName(const string& name) {
119 if (name == this->name()) {
120 return;
121 }
122
123 if (machine() != NULL) {
124 if (machine()->functionUnitNavigator().hasItem(name) ||
125 (machine()->controlUnit() != NULL &&
126 machine()->controlUnit()->name() == name)) {
127 string procName = "FunctionUnit::setName";
128 throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
129 } else {
131 }
132 } else {
134 }
135}
136
137/**
138 * Returns the requested port.
139 *
140 * @param name Name of the port.
141 * @return The requested port.
142 * @exception InstanceNotFound If there is no port by the given name.
143 */
145FunctionUnit::port(const std::string& name) const {
146 if (!hasPort(name)) {
147 string procName = "FunctionUnit::port";
148 throw InstanceNotFound(__FILE__, __LINE__, procName);
149 }
150
152 BaseFUPort* fuPort = dynamic_cast<BaseFUPort*>(port);
153 assert(fuPort != NULL);
154 return fuPort;
155}
156
157/**
158 * Returns port by the given index.
159 *
160 * The index must be between 0 and the return value of numberOfPorts() - 1.
161 *
162 * @param index Index.
163 * @return The port found by the given index.
164 * @exception OutOfRange If the given index is out of range.
165 */
167FunctionUnit::port(int index) const {
168 // the out of range test is already done in Unit::Port,
169 // no need to do it here also.
170 return static_cast<BaseFUPort*>(Unit::port(index));
171}
172
173/**
174 * Returns the number of port used for inputs and outputs of operations.
175 *
176 * Control unit may contain also ports for special registers. Those ports
177 * are ignored by this method.
178 *
179 * @return The number of operation ports.
180 */
181int
183
184 int portCount = this->portCount();
185 int opCount = 0;
186
187 for (int i = 0; i < portCount; i++) {
188 Port* port = Unit::port(i);
189 if (dynamic_cast<FUPort*>(port) != NULL) {
190 opCount++;
191 }
192 }
193 return opCount;
194}
195
196
197/**
198 * Tells whether the function unit has an operation port with the given name.
199 *
200 * @param name Name of the port.
201 * @return True if the function unit has the operation port, otherwise false.
202 */
203bool
204FunctionUnit::hasOperationPort(const std::string& name) const {
205 if (!hasPort(name)) {
206 return false;
207 } else {
208 Port* port = this->port(name);
209 return dynamic_cast<FUPort*>(port) != NULL;
210 }
211}
212
213
214/**
215 * Returns an operation port by the given name.
216 *
217 * Operation port is a port which can be read or written by an operation.
218 *
219 * @param name Name of the port.
220 * @return The requested port.
221 * @exception InstanceNotFound If the requested port does not exist.
222 */
223FUPort*
224FunctionUnit::operationPort(const std::string& name) const {
226 FUPort* fuPort = dynamic_cast<FUPort*>(port);
227 if (fuPort == NULL) {
228 const string procName = "FunctionUnit::operationPort";
229 throw InstanceNotFound(__FILE__, __LINE__, procName);
230 }
231 return fuPort;
232}
233
234/**
235 * Returns an operation port by the given index.
236 *
237 * Operation port is a port which can be read or written by an operation.
238 *
239 * @param index The index.
240 * @return The port found by the given index.
241 * @exception OutOfRange If the given index is less than 0 or greater or
242 * equal to the number of operation ports.
243 */
244FUPort*
246 int portCount = this->portCount();
247 int current(-1);
248
249 for (int i = 0; i < portCount; i++) {
250 Port* port = Unit::port(i);
251 if (dynamic_cast<FUPort*>(port) != NULL) {
252 current++;
253 if (current == index) {
254 return dynamic_cast<FUPort*>(port);
255 }
256 }
257 }
258
259 const string procName = "FunctionUnit::operandPort";
260 throw OutOfRange(__FILE__, __LINE__, procName);
261}
262
263/**
264 * Returns triggering port if found. Otherwise returns NULL.
265 */
268 int portc = portCount();
269 for (int i = 0; i < portc; i++) {
270 if (port(i)->isTriggering()) {
271 return port(i);
272 }
273 }
274 return NULL;
275}
276
277/**
278 * Adds an operation into the function unit. This method is called from
279 * HWOperation constructor. Do not use this method.
280 *
281 * @param operation Operation which is added.
282 * @exception ComponentAlreadyExists If there is already an operation by the
283 * same name as the given operation.
284 */
285void
287 // run time check that this method is called from HWOperation constructor
288 // only.
289 assert(operation.parentUnit() == NULL);
290
292 operations_.push_back(&operation);
293 } else {
294 string procName = "FunctionUnit::addOperation";
295 throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
296 }
297}
298
299/**
300 * Deletes an operation from the function unit.
301 *
302 * Destructor of the operation is called.
303 *
304 * @param operation Operation to be deleted.
305 * @exception InstanceNotFound If the given operation doesn't belong to this
306 * function unit.
307 */
308void
310 if (operation.parentUnit() == NULL) {
312 &operation);
313 assert(removed);
314 } else {
316 string procName = "FunctionUnit::deleteOperation";
317 throw InstanceNotFound(__FILE__, __LINE__, procName);
318 }
319 delete &operation;
320 }
321}
322
323/**
324 * Returns true if the requested operation exists in the function unit.
325 *
326 * @param operation Name of the operation.
327 * @return True if the requested operation exists in the function unit.
328 */
329bool
330FunctionUnit::hasOperation(const std::string& name) const {
332}
333
334/**
335 * Returns true if the requested operation exists in the function unit.
336 *
337 * @param operation Name of the operation which MUST be in lowercase.
338 * @return True if the requested operation exists in the function unit.
339 */
340bool
341FunctionUnit::hasOperationLowercase(const std::string& name) const {
342 OperationTable::const_iterator iter = operations_.begin();
343 while (iter != operations_.end()) {
344 if ((*iter)->name() == name) {
345 return true;
346 }
347 iter++;
348 }
349 return false;
350}
351
352/**
353 * Returns operation by the given name.
354 *
355 * The requested operation must exist, otherwise assertion fails.
356 *
357 * @param name Name of the operation.
358 * @return Operation by the given name.
359 * @exception InstanceNotFound If an operation is not found by the given
360 * name.
361 */
363FunctionUnit::operation(const string& name) const {
365}
366
367/**
368 * Returns operation by the given name.
369 *
370 * The requested operation must exist, otherwise assertion fails.
371 *
372 * @param name Name of the operation.
373 * @return Operation by the given name which MUST be in lowercase.
374 * @exception InstanceNotFound If an operation is not found by the given
375 * name.
376 */
378FunctionUnit::operationLowercase(const string& name) const {
379 OperationTable::const_iterator iter = operations_.begin();
380 while (iter != operations_.end()) {
381 if ((*iter)->name() == name) {
382 return *iter;
383 }
384 iter++;
385 }
386
387 string procName = "FunctionUnit::operation";
388 throw InstanceNotFound(
389 __FILE__, __LINE__, procName,"Operation not found:" + name );
390}
391
392/**
393 * Returns operation by the given index.
394 *
395 * The value of given index must be between 0 and the return value of
396 * operationCount() - 1.
397 *
398 * @param index Index.
399 * @return Operation by the given index.
400 * @exception OutOfRange If the given index is less than zero or greater or
401 * equal to the number of operations in the function
402 * unit.
403 */
405FunctionUnit::operation(int index) const {
406 if (index < 0 || index >= operationCount()) {
407 string procName = "FunctionUnit::operation";
408 throw OutOfRange(__FILE__, __LINE__, procName);
409 }
410 return operations_[index];
411}
412
413/**
414 * Returns the number of operations in the function unit.
415 *
416 * @return The number of operations in the function unit.
417 */
418int
420 return operations_.size();
421}
422
423
424/**
425 * Adds FUs operations to the set given as a parameter.
426 */
427void
429 OperationTable::const_iterator iter = operations_.begin();
430 while (iter != operations_.end()) {
431 opNames.insert((*iter)->name());
432 ++iter;
433 }
434}
435
436
437/**
438 * Returns the maximum latency among the operations of the function unit.
439 *
440 * @return The maximum latency.
441 */
442int
444 int max(0);
445 for (int i = 0; i < operationCount(); i++) {
446 if (operation(i)->latency() > max) {
447 max = operation(i)->latency();
448 }
449 }
450 return max;
451}
452
453
454/**
455 * Adds a pipeline element to the function unit.
456 *
457 * Pipeline elements are added automatically if some operation uses it.
458 * Clients must not add pipeline elements explicitly. PipelineElement adds
459 * itself automatically to the parent function when it is created.
460 *
461 * @param name Name of the pipeline element.
462 * @exception ComponentAlreadyExists If there is already a pipeline element
463 * by the given name.
464 */
465void
467 // sanity check to verify that this is called from PipelineElement's
468 // constructor
469 assert(element.parentUnit() == NULL);
470
471 string name = element.name();
473 string procName = "FunctionUnit::addPipelineElement";
474 throw ComponentAlreadyExists(__FILE__, __LINE__, procName);
475 } else {
476 pipelineElements_.push_back(&element);
477 }
478}
479
480/**
481 * Deletes the given pipeline element from function unit.
482 *
483 * The pipeline element is automatically deleted if it is not used by any
484 * of the operations. Clients must not use this method!
485 *
486 * @param element The pipeline element to delete.
487 */
488void
490
491 // sanity check to verify that this is called from PipelineElement's
492 // destructor.
493 assert(element.parentUnit() == NULL);
494
496 pipelineElements_, &element);
497 assert(removed);
498}
499
500
501/**
502 * Returns the number of pipeline elements in the function unit.
503 *
504 * @return The number of pipeline elements.
505 */
506int
510
511
512/**
513 * Returns a pipeline element by the given index.
514 *
515 * The index must be greater or equal to 0 and less than the number of
516 * pipeline elements in the function unit.
517 *
518 * @param index The index.
519 * @return A pipeline element by the given index.
520 * @exception OutOfRange If the given index is out of range.
521 */
524 if (index < 0 || index >= pipelineElementCount()) {
525 string procName = "FunctionUnit::pipelineElement";
526 throw OutOfRange(__FILE__, __LINE__, procName);
527 }
528
529 return pipelineElements_[index];
530}
531
532/**
533 * Returns true if the function unit has a pipeline element by the given
534 * name.
535 *
536 * @return True if the function unit has a pipeline element by the given
537 * name.
538 */
539bool
540FunctionUnit::hasPipelineElement(const std::string& name) const {
541 PipelineElementTable::const_iterator iter = pipelineElements_.begin();
542 while (iter != pipelineElements_.end()) {
543 if ((*iter)->name() == name) {
544 return true;
545 }
546 iter++;
547 }
548 return false;
549}
550
551
552/**
553 * Returns the pipeline element which has the given name.
554 *
555 * @param name Name of the pipeline element.
556 * @return The pipeline element which has the given name, or NULL
557 * If there is no pipeline element by the given
558 * name.
559 */
561FunctionUnit::pipelineElement(const std::string& name) const {
562
563 PipelineElementTable::const_iterator iter = pipelineElements_.begin();
564 while (iter != pipelineElements_.end()) {
565 if ((*iter)->name() == name) {
566 return *iter;
567 }
568 iter++;
569 }
570 return NULL;
571}
572
573
574/**
575 * Returns the address space used by the function unit.
576 *
577 * @return The address space used by the function unit.
578 */
581 return addressSpace_;
582}
583
584
585/**
586 * Adds an address space which can be accessed by the function unit.
587 *
588 * @param as Address space which can be accessed.
589 * @exception IllegalRegistration If the given address space and the function
590 * unit are not registrered to the same
591 * machine.
592 */
593void
595 if (as != NULL) {
597 }
598
599 addressSpace_ = as;
600}
601
602/**
603 * Returns true if the address space is set.
604 *
605 * @return True if the address space is set.
606 */
607bool
609
610 if (addressSpace_ == NULL) {
611 return false;
612 }
613 return true;
614}
615
616
617/**
618 * Deletes a pipeline element by the given name if it is not used by any
619 * operation.
620 */
621void
622FunctionUnit::cleanup(const std::string& resource) {
623
624 if (!hasPipelineElement(resource)) {
625 return;
626 }
627
628 for (int i = 0; i < operationCount(); i++) {
629 HWOperation* operation = this->operation(i);
631 for (int cycle = 0; cycle < pLine->latency(); cycle++) {
632 if (pLine->isResourceUsed(resource, cycle)) {
633 return;
634 }
635 }
636 }
637
638
639 PipelineElement* toDelete = pipelineElement(resource);
640 delete toDelete;
641}
642
643
644/**
645 * Removes registration of the function unit from its current machine.
646 */
647void
649
650 if (machine() == NULL) {
651 return;
652 }
653
655 Machine* mach = machine();
657 mach->removeFunctionUnit(*this);
658}
659
660
661/**
662 * Removes function unit part of a derived class from machine.
663 */
664void
669
670
671/**
672 * Saves the contents to an ObjectState tree.
673 *
674 * @return The newly created ObjectState tree.
675 */
678
679 ObjectState* fuState = Unit::saveState();
680 fuState->setName(OSNAME_FU);
682 // set address space
683 if (addressSpace_ != NULL) {
685 }
686
687 // add operations
688 for (int i = 0; i < operationCount(); i++) {
689 HWOperation* operation = this->operation(i);
690 fuState->addChild(operation->saveState());
691 }
692
693 return fuState;
694}
695
696
697/**
698 * Loads its state from the given ObjectState instance.
699 *
700 * @param state The ObjectState instance.
701 * @exception ObjectStateLoadingException If the given ObjectState instance
702 * is invalid or if connections to
703 * other machine parts cannot be made.
704 */
705void
707 const string procName = "FunctionUnit::loadState";
708
709 Unit::loadState(state);
711
712 try {
713 // set address space
714 if (state->hasAttribute(OSKEY_AS)) {
715 MOMTextGenerator textGenerator;
718 string asName = state->stringAttribute(OSKEY_AS);
719 if (!isRegistered() || !asNav.hasItem(asName)) {
720 format errorMsg = textGenerator.text(MOMTextGenerator::
721 TXT_FU_REF_LOAD_ERR_AS);
722 errorMsg % asName % name();
724 __FILE__, __LINE__, procName, errorMsg.str());
725 } else {
726 setAddressSpace(asNav.item(asName));
727 }
728 }
729
730 } catch (const Exception& e) {
732 __FILE__, __LINE__, procName, e.errorMessage());
733 }
734}
735
736/**
737 * Compares two FunctionUnit architectures.
738 *
739 * Names are not compared. Port width comparison can be omitted.
740 *
741 * @param fu Function unit to compare with.
742 * @param checkPortWidths Boolean for if port widths are matched or not.
743 * Defaul is true.
744 * @return True if the architectures match otherwise false.
745 */
746bool
748 const FunctionUnit* fu, const bool checkPortWidths) const {
749 if (operationCount() != fu->operationCount()) {
750 return false;
751 }
752 int fuPortCount = fu->operationPortCount();
753 if (operationPortCount() != fuPortCount) {
754 return false;
755 }
756 int fuPipelineElementCount = fu->pipelineElementCount();
757 if (pipelineElementCount() != fuPipelineElementCount) {
758 return false;
759 }
760 if (addressSpace() != NULL && fu->addressSpace() != NULL) {
761 if (addressSpace()->name() != fu->addressSpace()->name()) {
762 return false;
763 }
764 } else if ((addressSpace() == NULL && fu->addressSpace() != NULL) ||
765 (addressSpace() != NULL && fu->addressSpace() == NULL)) {
766 return false;
767 }
768 for (int i = 0; i < fuPipelineElementCount; i++) {
769 string element = pipelineElement(i)->name();
770 if (fu->hasPipelineElement(element)) {
771 return false;
772 }
773 }
774 for (int i = 0; i < fuPortCount; i++) {
775 if (checkPortWidths) {
777 return false;
778 }
779 } else {
780 if (operationPort(i)->isTriggering() !=
781 fu->operationPort(i)->isTriggering()) {
782 return false;
783 }
784 if (operationPort(i)->isOpcodeSetting() !=
785 fu->operationPort(i)->isOpcodeSetting()) {
786 return false;
787 }
788 }
789 }
790 if (!(ResourceVectorSet(*this) == ResourceVectorSet(*fu))) {
791 return false;
792 }
793 return true;
794}
795
796
797/**
798 * Checks if all the operations in the FU have the same latency and there are
799 * no shared resources.
800 *
801 * @return True if the FU needs conflict detection
802 */
803bool
805
806 if (operationCount() == 0) {
807 return false;
808 }
809
810 // same latency for all operations?
811 const int latency = operation(0)->latency();
812 for (int i = 1; i < operationCount(); ++i) {
813 if (latency != operation(i)->latency()) {
814 return true;
815 }
816 }
817
818 if (pipelineElementCount() == 0) {
819 return false;
820 }
821
822 return true;
823}
824
825
826/**
827 * Cleans up the guards that refer to a port of this function unit.
828 */
829void
831
832 Machine* mach = machine();
833 if (mach == NULL) {
834 return;
835 }
836
837 Machine::BusNavigator navi = mach->busNavigator();
838 for (int busIndex = 0; busIndex < navi.count(); busIndex++) {
839 Bus* bus = navi.item(busIndex);
840 int guardIndex = 0;
841 while (guardIndex < bus->guardCount()) {
842 Guard* guard = bus->guard(guardIndex);
843 PortGuard* portGuard =
844 dynamic_cast<PortGuard*>(guard);
845 if (portGuard != NULL) {
846 BaseFUPort* port = portGuard->port();
847 FunctionUnit* referenced = port->parentUnit();
848 if (referenced == this) {
849
850 // guard is removed from bus automatically
851 delete portGuard;
852 } else {
853 guardIndex++;
854 }
855 } else {
856 guardIndex++;
857 }
858 }
859 }
860}
861
862
863/**
864 * Loads the state of the function unit without references to other
865 * components.
866 *
867 * @param fuState The ObjectState instance from which the state is loaded.
868 * @exception ObjectStateLoadingException If an error occurs while loading
869 * the state.
870 */
871void
874 addressSpace_ = NULL;
875
878 }
879
880 try {
881 // load operations
882 for (int i = 0; i < fuState->childCount(); i++) {
883 ObjectState* child = fuState->child(i);
884 if (child->name() == HWOperation::OSNAME_OPERATION) {
885 new HWOperation(child, *this);
886 }
887 }
888 } catch (const Exception& e) {
889 const string procName = "FunctionUnit::loadStateWithoutReferences";
891 __FILE__, __LINE__, procName, e.errorMessage());
892 }
893}
894
895/**
896 * Deletes all the operations of the function unit.
897 */
898void
900 while (operations_.size() > 0) {
901 delete operations_[0];
902 }
903}
904
905/**
906 * Returns the order number of the FU.
907 *
908 * In certain architectures (Cell SPU) the "relative order" of the function
909 * units matters when it comes to accessing same register by multiple operations
910 * in the same cycle.
911 * This method returns number indicating possition of the FU in the ADF file.
912 * Alows putting the FU into the order in the instruction.
913 */
914int
916 return orderNumber_;
917}
918
919/**
920 * Sets order number of the FU.
921 *
922 * In certain architectures (Cell SPU) the "relative order" of the function
923 * units matters when it comes to accessing same register by multiple operations
924 * in the same cycle.
925 * This method sets number indicating possition of the FU in the ADF file.
926 */
927void
929 orderNumber_ = number;
930}
931}
#define assert(condition)
static bool removeValueIfExists(ContainerType &aContainer, const ElementType &aKey)
static bool containsValue(const ContainerType &aContainer, const ElementType &aKey)
std::string errorMessage() const
Definition Exception.cc:123
bool hasAttribute(const std::string &name) const
void setName(const std::string &name)
void setAttribute(const std::string &name, const std::string &value)
ObjectState * child(int index) const
void addChild(ObjectState *child)
std::string stringAttribute(const std::string &name) const
int intAttribute(const std::string &name) const
std::string name() const
int childCount() const
static std::string stringToLower(const std::string &source)
FunctionUnit * parentUnit() const
Definition BaseFUPort.cc:96
Guard * guard(int index) const
Definition Bus.cc:456
virtual void setName(const std::string &name)
virtual Machine * machine() const
virtual bool isRegistered() const
virtual void ensureRegistration(const Component &component) const
virtual TCEString name() const
bool isResourceUsed(const std::string &name, int cycle) const
virtual bool isTriggering() const
Definition FUPort.cc:182
virtual bool isOpcodeSetting() const
Definition FUPort.cc:195
virtual void addPipelineElement(PipelineElement &element)
virtual void loadState(const ObjectState *state)
virtual AddressSpace * addressSpace() const
virtual void addOperation(HWOperation &operation)
virtual void deleteOperation(HWOperation &operation)
virtual BaseFUPort * triggerPort() const
virtual int pipelineElementCount() const
virtual bool hasPipelineElement(const std::string &name) const
virtual HWOperation * operation(const std::string &name) const
virtual ObjectState * saveState() const
virtual FunctionUnit * copy() const
PipelineElementTable pipelineElements_
Contains all the pipeline elements of the function unit.
virtual int operationCount() const
virtual void operationNames(TCETools::CIStringSet &opNames) const
OperationTable operations_
Contains all the operations of the function unit.
virtual bool hasOperationLowercase(const std::string &name) const
virtual int maxLatency() const
virtual void cleanup(const std::string &resource)
virtual FUPort * operationPort(const std::string &name) const
virtual void unsetMachine()
int orderNumber_
Number indicating possition of the FU in the ADF file. Alows putting the FU into the order in the ins...
void loadStateWithoutReferences(const ObjectState *fuState)
virtual void setAddressSpace(AddressSpace *as)
AddressSpace * addressSpace_
Address space used by the function unit.
virtual int orderNumber() const
virtual HWOperation * operationLowercase(const std::string &name) const
virtual bool hasOperationPort(const std::string &name) const
virtual PipelineElement * pipelineElement(int index) const
virtual bool hasOperation(const std::string &name) const
bool needsConflictDetection() const
static const std::string OSNAME_FU
ObjectState name for function unit.
FunctionUnit(const std::string &name)
virtual int operationPortCount() const
virtual void setName(const std::string &name)
static const std::string OSKEY_AS
ObjectState attribute key for name of the address space.
static const std::string OSKEY_ORDER_NUMBER
ObjectState attribute key for FU order number name.
virtual void deletePipelineElement(PipelineElement &element)
virtual bool hasAddressSpace() const
virtual BaseFUPort * port(const std::string &name) const
virtual void setOrderNumber(int)
virtual bool isArchitectureEqual(const FunctionUnit *fu, const bool checkPortWidths=true) const
ExecutionPipeline * pipeline() const
virtual ObjectState * saveState() const
const std::string & name() const
FunctionUnit * parentUnit() const
static const std::string OSNAME_OPERATION
ObjectState name for HWOperation.
ComponentType * item(int index) const
bool hasItem(const std::string &name) const
virtual BusNavigator busNavigator() const
Definition Machine.cc:356
virtual AddressSpaceNavigator addressSpaceNavigator() const
Definition Machine.cc:392
virtual void removeFunctionUnit(FunctionUnit &unit)
Definition Machine.cc:530
FunctionUnit * parentUnit() const
const std::string & name() const
FUPort * port() const
virtual void unsetMachine()
Definition Unit.cc:262
virtual bool hasPort(const std::string &name) const
Definition Unit.cc:96
virtual int portCount() const
Definition Unit.cc:135
virtual Port * port(const std::string &name) const
Definition Unit.cc:116
virtual void loadState(const ObjectState *state)
Definition Unit.cc:309
virtual ObjectState * saveState() const
Definition Unit.cc:285
virtual boost::format text(int textId)
std::set< TCEString, CaseInsensitiveCmp > CIStringSet