+ }
+ else {
+ // start by searching backward
+ ConnectedInterface* connFrom = connectedFrom;
+ while ((connFrom != NULL) && (connFrom->isGroupInterface())) {
+ connFrom = connFrom->getConnectedFrom();
+ }
+ if (connFrom != NULL) {
+ idClock = connFrom->getClockDomain();
+ }
+ //searching forward
+ else {
+ QList<ConnectedInterface*> lstIfaces = getForwardFunctionalInterfaces(this);
+ if (lstIfaces.isEmpty()) throw(Exception(IFACE_INVALID_CLKFREQ,this));
+ foreach(ConnectedInterface* iface, lstIfaces) {
+ // test if all ifaces are in the same clock domain
+ if (idClock == -1) {
+ idClock = iface->getClockDomain();
+ }
+ else if (idClock != iface->getClockDomain()) throw(Exception(IFACE_INVALID_CLKFREQ,this));
+ }
+ }