X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/1f7784e996c1a8ebe3277aaeeff98490cd6d8a94..561d4f45e60504cc9e041370dd908b002fe776a5:/ReferenceBlock.cpp diff --git a/ReferenceBlock.cpp b/ReferenceBlock.cpp index 93f7c41..a0a8220 100644 --- a/ReferenceBlock.cpp +++ b/ReferenceBlock.cpp @@ -68,6 +68,14 @@ void ReferenceBlock::load(QDomElement &elt) throw(Exception) { try { loadInterfaces(eltInter); } + catch(int err) { + throw(err); + } + + // create interfaces that correspond to a wishbone parameter, if any. + try { + createInterfaceForParameters(); + } catch(int err) { throw(err); } @@ -265,8 +273,27 @@ void ReferenceBlock::loadInterfaces(QDomElement &elt) throw(Exception) { } } -void ReferenceBlock::parametersValidation(QList *checkedBlocks, QList *blocksToConfigure) -{ +void ReferenceBlock::createInterfaceForParameters() throw(Exception){ + ReferenceInterface* iface = NULL; + foreach(BlockParameter* param, params) { + + if (param->isWishboneParameter()) { + BlockParameterWishbone* p = (BlockParameterWishbone*)param; + int orientation = -1; + if (p->getWBAccess() == BlockParameter::Read) { + iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), AbstractInterface::Output, AbstractInterface::Wishbone,1); + outputs.append(iface); + } + else if (p->getWBAccess() == BlockParameter::Write) { + iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), AbstractInterface::Input, AbstractInterface::Wishbone,1); + inputs.append(iface); + } + ReferenceInterface* iface = new ReferenceInterface(this,p->getName(),p->getType(),p->getWidth(), orientation, AbstractInterface::Wishbone,1); + } + } +} + +void ReferenceBlock::parametersValidation(QList *checkedBlocks, QList *blocksToConfigure) { return; }