X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/a13795fc34cd1e74f94695d35253c3d00abec9bc..4327c2b8817b627249d98d889835726217c81a4e:/FunctionalInterface.cpp?ds=inline diff --git a/FunctionalInterface.cpp b/FunctionalInterface.cpp index 7d1217a..55f65ec 100644 --- a/FunctionalInterface.cpp +++ b/FunctionalInterface.cpp @@ -90,7 +90,7 @@ bool FunctionalInterface::canConnectTo(AbstractInterface *iface) { - iface type must be functional or group interface - iface->connectedFrom must be NULL - valid cases: + valid "normal" cases: 1 - iface is owned by a block (group or func) that is within the same group as the block that own this 1.1 - this is output and iface is input 1.2 - both are inout @@ -99,11 +99,21 @@ bool FunctionalInterface::canConnectTo(AbstractInterface *iface) { 2.2 - both are inout 3 - this is owned by a source block and iface is owned by the top group + special case : clk/reset from clkrstgen can connect to stimuli clk/reset + */ if (direction == Input) return false; if (iface->isReferenceInterface()) return false; ConnectedInterface* connIface = AI_TO_CON(iface); if (connIface->getConnectedFrom() != NULL) return false; + // special case + if ((getOwner()->getName().startsWith("clkrstgen")) && (iface->getOwner()->isStimuliBlock())) { + if ((direction == Output) && (iface->getDirection() == Input)) { + if ((purpose == AbstractInterface::Clock) && (iface->getPurpose() == AbstractInterface::Clock)) return true; + else if ((purpose == AbstractInterface::Reset) && (iface->getPurpose() == AbstractInterface::Reset)) return true; + } + } + // first case: interface of blocks within the same group if (getOwner()->getParent() == iface->getOwner()->getParent()) { @@ -138,11 +148,21 @@ bool FunctionalInterface::canConnectFrom(AbstractInterface *iface) { 2 - iface is owned by the parent group of the block that owns this 2.1 - this is an input, iface is an input of the group 2.2 - both are inout + + special case : clk/reset of stimuli can connect from clk/reset of clkrstgen */ if (direction == Output) return false; if (iface->isReferenceInterface()) return false; if (connectedFrom != NULL) return false; + // special case + if ((iface->getOwner()->getName().startsWith("clkrstgen")) && (getOwner()->isStimuliBlock())) { + if ((direction == Input) && (iface->getDirection() == Output)) { + if ((purpose == AbstractInterface::Clock) && (iface->getPurpose() == AbstractInterface::Clock)) return true; + else if ((purpose == AbstractInterface::Reset) && (iface->getPurpose() == AbstractInterface::Reset)) return true; + } + } + if (getOwner()->getParent() == iface->getOwner()->getParent()) { if ((direction == Input) && (iface->getDirection() == Output) && (purpose == iface->getPurpose())) return true;