X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/4cf57e6db08da791233d75237f62e74bc88dd427..3fb762e7042d9b4a1cf78556ad9ed7f117cc53ba:/VHDLConverter.cpp diff --git a/VHDLConverter.cpp b/VHDLConverter.cpp index d3938b2..275ceb4 100644 --- a/VHDLConverter.cpp +++ b/VHDLConverter.cpp @@ -359,14 +359,18 @@ void VHDLConverter::readPorts(QTextStream &in) throw(Exception) { void VHDLConverter::readArchitecture(QTextStream &in) throw(Exception) { QString line = ""; - QString endLine = "end "+archName; + QString endLine1 = "end "+archName; + QString endLine2 = "end architecture "+archName; + bool stop = false; - while (!line.startsWith(endLine)) { + while (!stop) { line = in.readLine(); if (!line.isEmpty()) line = line.simplified(); archLines.append(line); - } - + if ((line.startsWith(endLine1)) || (line.startsWith(endLine2)) ) { + stop = true; + } + } } // This function opens a VHDL file and get the informations about the entity : @@ -459,12 +463,12 @@ void VHDLConverter::loadVHDLFile() { else { widthStr = "std_logic_vector("; if (iface->getEndianess() == AbstractInterface::LittleEndian) { - widthStr += iface->getWidth(); + widthStr += iface->getWidthString(); widthStr += " downto 0)"; } else { widthStr += "0 to "; - widthStr += iface->getWidth(); + widthStr += iface->getWidthString(); widthStr += ")"; } } @@ -651,7 +655,7 @@ void VHDLConverter::generateRefXml(QDomDocument& doc) { QDomElement input = doc.createElement("input"); input.setAttribute("name",iface->getName()); input.setAttribute("type",iface->getTypeString()); - input.setAttribute("width",iface->getWidth()); + input.setAttribute("width",iface->getWidthString()); input.setAttribute("multiplicity","1"); input.setAttribute("purpose",iface->getPurposeString()); input.setAttribute("endian",iface->getEndianessString()); @@ -673,7 +677,7 @@ void VHDLConverter::generateRefXml(QDomDocument& doc) { QDomElement output = doc.createElement("output"); output.setAttribute("name",iface->getName()); output.setAttribute("type",iface->getTypeString()); - output.setAttribute("width",iface->getWidth()); + output.setAttribute("width",iface->getWidthString()); output.setAttribute("multiplicity","1"); output.setAttribute("purpose",iface->getPurposeString()); output.setAttribute("endian",iface->getEndianessString()); @@ -695,7 +699,7 @@ void VHDLConverter::generateRefXml(QDomDocument& doc) { QDomElement bidir = doc.createElement("bidir"); bidir.setAttribute("name",iface->getName()); bidir.setAttribute("type",iface->getTypeString()); - bidir.setAttribute("width",iface->getWidth()); + bidir.setAttribute("width",iface->getWidthString()); bidir.setAttribute("multiplicity","1"); bidir.setAttribute("purpose",iface->getPurposeString()); bidir.setAttribute("endian",iface->getEndianessString());