- if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;\r
- if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;\r
+ if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) ok = true;\r
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) ok = true;\r
+ }\r
+\r
+ if (ok) {\r
+ if (testClock) {\r
+ int dom1 = -1,dom2 = -2;\r
+ try {\r
+ dom1 = getClockDomain();\r
+ dom2 = iface->getClockDomain();\r
+ }\r
+ catch(Exception e) {\r
+ cerr << qPrintable(e.getMessage()) << endl;\r
+ return false;\r
+ }\r
+ if (dom1 != dom2) {\r
+ cout << "cannot connect interfaces that are in different clock domains" << endl;\r
+ return false;\r
+ }\r
+ }\r
+ return true;\r