direction = Input;
purpose = Data;
type = Boolean;
+ associatedIface = NULL;
}
direction = _direction;
purpose = _purpose;
type = typeFromString(_type);
+ associatedIface = NULL;
}
AbstractInterface::AbstractInterface(AbstractInterface* other) {
width = other->width;
direction = other->direction;
purpose = other->purpose;
+ associatedIface = NULL;
}
AbstractInterface::~AbstractInterface() {
}
}
+bool AbstractInterface::setAssociatedIface(AbstractInterface* iface) {
+ if (purpose != Control) return false;
+ if (iface->purpose != Data) return false;
+ associatedIface = iface;
+ iface->associatedIface = this;
+ return true;
+}
+
int AbstractInterface::getIntDirection(QString str) {
if(str == "input") return Input;
if(str == "output") return Output;
- if(str == "inOut") return InOut;
+ if(str == "inout") return InOut;
return -1;
}
+int AbstractInterface::getIntPurpose(QString str) {
+ if(str == "data") return Data;
+ else if(str == "clock") return Clock;
+ else if(str == "reset") return Reset;
+ else if(str == "wishbone") return Wishbone;
+ return -1;
+}
QString AbstractInterface::getTypeString() {
int AbstractInterface::typeFromString(const QString &_type) {
- int ret;
+ int ret = Expression; // default type
if (_type == "expression") {
ret = Expression;
}
else if (_type == "natural") {
ret = Natural;
}
+ else if (_type == "inherited") {
+ ret = Inherited;
+ }
return ret;
}