if (connIface->getConnectedFrom() != NULL) return false;
if (this->getOwner() == iface->getOwner()->getParent()) {
- if ((direction == Input) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()->getParent()) {
- if ((direction == Output) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()) {
- if ((direction == Output) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
if (getConnectedFrom() != NULL) return false;
if (this->getOwner() == iface->getOwner()->getParent()) {
- if ((direction == Output) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Output) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()->getParent()) {
- if ((direction == Input) && (iface->getDirection() == Output)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
else if (this->getOwner()->getParent() == iface->getOwner()) {
- if ((direction == Input) && (iface->getDirection() == Input)) return true;
- if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
+ if ((direction == Input) && (iface->getDirection() == Input) && (purpose == iface->getPurpose())) return true;
+ if ((direction == InOut) && (iface->getDirection() == InOut) && (purpose == iface->getPurpose())) return true;
}
- else if ((getOwner()->isTopGroupBlock()) && (iface->getOwner()->isSourceBlock())) {
- if ((direction == Input) && (iface->getDirection() == Output)) return true;
+ else if ((getOwner()->isTopGroupBlock()) && (iface->getOwner()->isStimuliBlock())) {
+ if ((direction == Input) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;
}
return false;
}
+int GroupInterface::getClockDomain() throw(Exception) {
+
+ int idClock = -1;
+
+ GroupInterface* iface = NULL;
+ if (clkIfaceType == ClockName) {
+ iface = AI_TO_GRP(getClockIface());
+ }
+ else if ((direction == Input) && (purpose == Clock)) {
+ iface = this;
+ }
+
+ if ( iface != NULL) {
+
+ QString name = iface->getName();
+ name.remove(0,8);
+ bool ok;
+ idClock = name.toInt(&ok);
+ if (!ok) throw(Exception(IFACE_INVALID_CLKFREQ,this));
+
+ }
+
+ return idClock;
+}
+
+
void GroupInterface::connectionsValidation(QStack<AbstractInterface*> *interfacetoValidate, QList<AbstractInterface*> *validatedInterfaces) throw(Exception) {
cout << "group interface connection validation" << endl;
}