1 #include "SpecialBlock.h"
\r
2 #include "FunctionalInterface.h"
\r
4 SpecialBlock::SpecialBlock(int _type, GroupBlock* _parent, ReferenceBlock* _reference, bool createIfaces) throw(Exception) : FunctionalBlock(_parent, _reference, createIfaces) {
\r
8 SpecialBlock::~SpecialBlock() {
\r
11 bool SpecialBlock::isSpecialBlock() {
\r
15 void SpecialBlock::checkInputPatternCompatibility() throw(Exception) {
\r
17 switch(specialType) {
\r
19 checkInputPatternCompatibilitySource();
\r
22 checkInputPatternCompatibilitySink();
\r
25 checkInputPatternCompatibilityClockConvert();
\r
31 catch(Exception e) {
\r
36 void SpecialBlock::computeOutputPattern(int nbExec) throw(Exception) {
\r
38 switch(specialType) {
\r
40 computeOutputPatternSource(nbExec);
\r
43 computeOutputPatternSink(nbExec);
\r
46 computeOutputPatternClockConvert(nbExec);
\r
52 catch(Exception e) {
\r
57 void SpecialBlock::checkInputPatternCompatibilitySource() throw(Exception) {
\r
59 void SpecialBlock::computeOutputPatternSource(int nbExec) throw(Exception) {
\r
61 cout << "computing output pattern of " << qPrintable(name) << " for " << nbExec << " executions" << endl;
\r
62 foreach(AbstractInterface* iface, getControlOutputs()) {
\r
63 FunctionalInterface* connIface = AI_TO_FUN(iface);
\r
64 // create output pattern
\r
65 QList<char>* pp = productionPattern.value(connIface);
\r
66 QList<char>* pattern = new QList<char>(*pp);
\r
67 for(int i=1;i<nbExec;i++) pattern->append(*pp);
\r
68 // assign pattern to interface
\r
69 connIface->setOutputPattern(pattern);
\r
71 outputPattern.insert(connIface,pattern);
\r
73 setOutputPatternComputed(true);
\r
76 void SpecialBlock::checkInputPatternCompatibilitySink() throw(Exception) {
\r
78 void SpecialBlock::computeOutputPatternSink(int nbExec) throw(Exception) {
\r
81 void SpecialBlock::checkInputPatternCompatibilityClockConvert() throw(Exception) {
\r
83 void SpecialBlock::computeOutputPatternClockConvert(int nbExec) throw(Exception) {
\r