A
lgorithmique
N
umérique
D
istribuée
Private GIT Repository
projects
/
blast.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
after merge
[blast.git]
/
FunctionalInterface.cpp
diff --git
a/FunctionalInterface.cpp
b/FunctionalInterface.cpp
index cc9f7658c7ab083b8fe2bfbb87cea71012e6d2c5..23fd4820129f5e0a5d920bc9768f078d33109cc4 100644
(file)
--- a/
FunctionalInterface.cpp
+++ b/
FunctionalInterface.cpp
@@
-17,11
+17,12
@@
FunctionalInterface::FunctionalInterface(AbstractBlock* _owner, ReferenceInterfa
reference = _reference;
\r
\r
name = reference->getName();
\r
reference = _reference;
\r
\r
name = reference->getName();
\r
+ type = reference->getType();
\r
+ endianess = reference->getEndianess();
\r
width = reference->getWidth();
\r
direction = reference->getDirection();
\r
width = reference->getWidth();
\r
direction = reference->getDirection();
\r
- purpose = reference->getPurpose();
\r
- level = reference->getLevel();
\r
- connectedFrom = NULL;
\r
+ purpose = reference->getPurpose();
\r
+ connectedFrom = NULL;
\r
}
\r
\r
bool FunctionalInterface::isFunctionalInterface() {
\r
}
\r
\r
bool FunctionalInterface::isFunctionalInterface() {
\r
@@
-65,10
+66,10
@@
int FunctionalInterface::getInterfaceMultiplicity() {
return -1;
\r
}
\r
else if ( reference->getMultiplicity() == -1) {
\r
return -1;
\r
}
\r
else if ( reference->getMultiplicity() == -1) {
\r
- return ifaceCount
+1
;
\r
+ return ifaceCount;
\r
}
\r
}
\r
- else if (
reference->getMultiplicity() > ifaceCount
) {
\r
- return ifaceCount
+1
;
\r
+ else if (
ifaceCount < reference->getMultiplicity()
) {
\r
+ return ifaceCount;
\r
}
\r
return -1;
\r
}
\r
}
\r
return -1;
\r
}
\r
@@
-77,12
+78,8
@@
AbstractInterface *FunctionalInterface::clone() {
int id = getInterfaceMultiplicity();
\r
if (id < 0) return NULL;
\r
FunctionalInterface *inter = new FunctionalInterface(owner, reference);
\r
int id = getInterfaceMultiplicity();
\r
if (id < 0) return NULL;
\r
FunctionalInterface *inter = new FunctionalInterface(owner, reference);
\r
- inter->setWidth(width);
\r
- inter->setDirection(direction);
\r
- inter->setPurpose(purpose);
\r
- inter->setLevel(level);
\r
- inter->connectFrom(NULL);
\r
- inter->setName(reference->getName()+"_"+QString::number(id));
\r
+ inter->setWidth(width);
\r
+ inter->setName(reference->getName()+"_"+QString::number(id+1));
\r
return inter;
\r
}
\r
\r
return inter;
\r
}
\r
\r
@@
-101,21
+98,27
@@
bool FunctionalInterface::canConnectTo(AbstractInterface *iface) {
2 - iface is owned by the parent group of the block that owns this
\r
2.1 - this is an output, iface is an output of the group
\r
2.2 - both are inout
\r
2 - iface is owned by the parent group of the block that owns this
\r
2.1 - this is an output, iface is an output of the group
\r
2.2 - both are inout
\r
+ 3 - this is owned by a source block and iface is owned by the top group
\r
\r
*/
\r
if (direction == Input) return false;
\r
if (iface->isReferenceInterface()) return false;
\r
\r
*/
\r
if (direction == Input) return false;
\r
if (iface->isReferenceInterface()) return false;
\r
- if (iface->getConnectedFrom() != NULL) return false;
\r
-
\r
+ ConnectedInterface* connIface = AI_TO_CON(iface);
\r
+ if (connIface->getConnectedFrom() != NULL) return false;
\r
+ // first case: interface of blocks within the same group
\r
if (getOwner()->getParent() == iface->getOwner()->getParent()) {
\r
\r
if ((direction == Output) && (iface->getDirection() == Input)) return true;
\r
if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
\r
}
\r
if (getOwner()->getParent() == iface->getOwner()->getParent()) {
\r
\r
if ((direction == Output) && (iface->getDirection() == Input)) return true;
\r
if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
\r
}
\r
+ // second case: iface = interface of the group that contains owner of this
\r
else if (getOwner()->getParent() == iface->getOwner()) {
\r
if ((direction == Output) && (iface->getDirection() == Output)) return true;
\r
if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
\r
}
\r
else if (getOwner()->getParent() == iface->getOwner()) {
\r
if ((direction == Output) && (iface->getDirection() == Output)) return true;
\r
if ((direction == InOut) && (iface->getDirection() == InOut)) return true;
\r
}
\r
+ else if ((getOwner()->isSourceBlock()) && (iface->getOwner()->isTopGroupBlock())) {
\r
+ if ((direction == Output) && (iface->getDirection() == Input)) return true;
\r
+ }
\r
\r
return false;
\r
\r
\r
return false;
\r
\r