#include "BlockParameterGeneric.h"
#include "BlockParameterPort.h"
#include "BlockParameterWishbone.h"
+#include "Parameters.h"
ReferenceBlock::ReferenceBlock(const QString _xmlFile) : AbstractBlock() {
xmlFile = _xmlFile;
}
else {
QDomText txtName = nodeNameTxt.toText();
- name = txtName.data().trimmed();
+ name = Parameters::normalizeName(txtName.data().trimmed());
cout<< "block name : " << qPrintable(name) << endl;
}
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
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();
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();
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();
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();
for(int i=0; i<b.bidirs.size(); i++){
ReferenceInterface *iface = (ReferenceInterface *)(b.bidirs.at(i));
toWrite << iface->getName();
+ toWrite << iface->getType();
toWrite << iface->getWidth();
toWrite << iface->getPurpose();
toWrite << iface->getDirection();
iface = new ReferenceInterface(&b);
in >> txt;
iface->setName(txt);
+ int type;
+ in >> type;
+ iface->setType(type);
in >> txt;
iface->setWidth(txt);
in >> val;
iface = new ReferenceInterface(&b);
in >> txt;
iface->setName(txt);
+ int type;
+ in >> type;
+ iface->setType(type);
in >> txt;
iface->setWidth(txt);
in >> val;
iface = new ReferenceInterface(&b);
in >> txt;
iface->setName(txt);
+ int type;
+ in >> type;
+ iface->setType(type);
in >> txt;
iface->setWidth(txt);
in >> val;
// 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));
+}
+