if (! _owner->isGroupBlock()) throw(Exception(BLOCK_INVALID_TYPE));
connectedFrom = NULL;
+ // force clock and reset to boolean width type instead of inherited
+ if ((purpose == Clock) || (purpose == Reset)) {
+ type = Boolean;
+ }
}
bool GroupInterface::isGroupInterface() {
return inter;
}
+int GroupInterface::getWidth() {
+
+ bool ok;
+ int w = -1;
+
+ QString expr = width;
+
+ if (type == Boolean) {
+ return 1;
+ }
+ else if (type == Inherited) {
+ // must search from which iface it is connected.
+ ConnectedInterface* fromIface = connectedFrom;
+ while ((fromIface != NULL) && (fromIface->getType() == Inherited)) {
+ fromIface = fromIface->getConnectedFrom();
+ }
+ if (fromIface == NULL) return -1;
+ w = fromIface->getWidth();
+ }
+ return w;
+}
bool GroupInterface::canConnectTo(AbstractInterface *iface) {