X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/6e2b3026c6a496e81642c373796bd39dad33d2a6..1b7818e18ed7bcf3464e307b97c6e0e6d72cc69b:/AbstractInterface.cpp?ds=sidebyside diff --git a/AbstractInterface.cpp b/AbstractInterface.cpp index 6c51907..6b3d009 100644 --- a/AbstractInterface.cpp +++ b/AbstractInterface.cpp @@ -288,7 +288,7 @@ int AbstractInterface::typeFromString(const QString &_type) { return ret; } -QString AbstractInterface::toVHDL(int context, int flags) throw(Exception) { +QString AbstractInterface::toVHDL(IfaceVHDLContext context, int flags) throw(Exception) { if (isReferenceInterface()) throw(Exception(IFACE_INVALID_TYPE)); @@ -298,7 +298,17 @@ QString AbstractInterface::toVHDL(int context, int flags) throw(Exception) { QString ret=""; bool ok; - cout << "iface " << qPrintable(name) << " must be evaluated to vhdl :" << qPrintable(width) << " with type = " << qPrintable(getTypeString()) << endl; + //cout << "iface " << qPrintable(name) << " must be evaluated to vhdl :" << qPrintable(width) << " with type = " << qPrintable(getTypeString()) << endl; + + if (context == Instance) { + if (direction == Output) { + ret = "from_"+owner->getName()+"_"+name; + } + else if (direction == InOut) { + ret = "fromto_"+owner->getName()+"_"+name; + } + return ret; + } // create the width part QString widthStr = ""; @@ -411,10 +421,15 @@ QString AbstractInterface::toVHDL(int context, int flags) throw(Exception) { ret += widthStr; } else if (context == Signal) { - ret = widthStr; - } - else if (context == Architecture) { - + if (direction == Output) { + ret = "from_"+owner->getName()+"_"+name+" : "+widthStr; + } + else if (direction == InOut) { + ret = "fromto_"+owner->getName()+"_"+name+" : "+widthStr; + } + else if (direction == Input) { + ret = owner->getName()+"_"+name+" : "+widthStr; + } } return ret;