X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/6e2b3026c6a496e81642c373796bd39dad33d2a6..6ca6321283b9c93a6df9dcd5216bfa01df9ad24b:/AbstractInterface.cpp?ds=sidebyside diff --git a/AbstractInterface.cpp b/AbstractInterface.cpp index 6c51907..39e672d 100644 --- a/AbstractInterface.cpp +++ b/AbstractInterface.cpp @@ -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;