X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/56f7c4239666506c59af42885f0bf0141d21a614..9bfa0c13066918f440ac2b5461fb3f8847f43fd6:/ReferenceBlock.cpp?ds=inline diff --git a/ReferenceBlock.cpp b/ReferenceBlock.cpp index 037c644..70677df 100644 --- a/ReferenceBlock.cpp +++ b/ReferenceBlock.cpp @@ -6,6 +6,7 @@ #include "BlockParameterGeneric.h" #include "BlockParameterPort.h" #include "BlockParameterWishbone.h" +#include "Parameters.h" ReferenceBlock::ReferenceBlock(const QString _xmlFile) : AbstractBlock() { xmlFile = _xmlFile; @@ -94,7 +95,7 @@ void ReferenceBlock::loadInformations(QDomElement &elt) throw(Exception) { } else { QDomText txtName = nodeNameTxt.toText(); - name = txtName.data().trimmed(); + name = Parameters::normalizeName(txtName.data().trimmed()); cout<< "block name : " << qPrintable(name) << endl; } @@ -104,11 +105,16 @@ void ReferenceBlock::loadInformations(QDomElement &elt) throw(Exception) { QString idsStr = eltCat.attribute("ids","none"); if (idsStr == "none") throw (Exception(BLOCKFILE_CORRUPTED)); - QStringList listCat = idsStr.split(","); - foreach(QString str, listCat) - { - int idCat = str.toInt(&ok); - categories.append(idCat); + if (idsStr.isEmpty()) { + categories.append(99); + } + else { + QStringList listCat = idsStr.split(","); + foreach(QString str, listCat) + { + int idCat = str.toInt(&ok); + categories.append(idCat); + } } // getting description @@ -417,6 +423,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i)); if (iface->getPurpose() == AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -428,6 +435,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.inputs.at(i)); if (iface->getPurpose() != AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -440,6 +448,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i)); if (iface->getPurpose() == AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -451,6 +460,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { ReferenceInterface *iface = (ReferenceInterface *)(b.outputs.at(i)); if (iface->getPurpose() != AbstractInterface::Control) { toWrite << iface->getName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -461,6 +471,7 @@ QDataStream& operator<<(QDataStream &out, const ReferenceBlock &b) { for(int i=0; igetName(); + toWrite << iface->getType(); toWrite << iface->getWidth(); toWrite << iface->getPurpose(); toWrite << iface->getDirection(); @@ -535,6 +546,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -561,6 +575,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -587,6 +604,9 @@ QDataStream& operator>>(QDataStream &in, ReferenceBlock &b) { iface = new ReferenceInterface(&b); in >> txt; iface->setName(txt); + int type; + in >> type; + iface->setType(type); in >> txt; iface->setWidth(txt); in >> val; @@ -609,3 +629,34 @@ void ReferenceBlock::computeOutputPattern(int nbExec) throw(Exception) { // does strictly nothing throw(Exception(INVALID_REFBLOCK_USE)); } + +void ReferenceBlock::computeAdmittanceDelays() throw(Exception) { + // does strictly nothing + throw(Exception(INVALID_REFBLOCK_USE)); +} + + +void ReferenceBlock::generateVHDL(const QString& path) throw(Exception){ + throw(Exception(INVALID_REFBLOCK_USE)); +} + +void ReferenceBlock::generateComments(QTextStream& out, QDomElement &elt, QString coreFile) throw(Exception) { + throw(Exception(INVALID_REFBLOCK_USE)); +} + +void ReferenceBlock::generateLibraries(QTextStream& out, QDomElement &elt) throw(Exception) { + throw(Exception(INVALID_REFBLOCK_USE)); +} + +void ReferenceBlock::generateEntity(QTextStream& out, bool hasController) throw(Exception) { + throw(Exception(INVALID_REFBLOCK_USE)); +} + +void ReferenceBlock::generateArchitecture(QTextStream& out, QDomElement &elt ) throw(Exception) { + throw(Exception(INVALID_REFBLOCK_USE)); +} + +void ReferenceBlock::generateController(QTextStream& out) throw(Exception) { + throw(Exception(INVALID_REFBLOCK_USE)); +} +