X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/015e6979cd7d336f6bbebfbdb7916af3ba23c096..a7299f808c1906872b76aa62fb6d8276096c4ff5:/AbstractBlock.cpp diff --git a/AbstractBlock.cpp b/AbstractBlock.cpp index b78a1e1..c1c3c38 100644 --- a/AbstractBlock.cpp +++ b/AbstractBlock.cpp @@ -249,7 +249,7 @@ void AbstractBlock::connectClkReset() throw(Exception) { GroupBlock* parentBlock = AB_TO_GRP(parent); - cout << "connecting clk/rst for child " << qPrintable(name) << " of " << qPrintable(parentBlock->getName()) << endl; + QList lstClk = getInterfaces(AbstractInterface::Input,AbstractInterface::Clock); QList lstRst = getInterfaces(AbstractInterface::Input,AbstractInterface::Reset); @@ -273,10 +273,12 @@ void AbstractBlock::connectClkReset() throw(Exception) { fromClk = AI_TO_CON(clkrstgen->getIfaceFromName("clk")); fromRst = AI_TO_CON(clkrstgen->getIfaceFromName("reset")); } + cout << "connecting clk/rst for " << qPrintable(name) << " to clkrstgen" << endl; } else { fromClk = AI_TO_CON(parentBlock->getIfaceFromName("clk")); fromRst = AI_TO_CON(parentBlock->getIfaceFromName("reset")); + cout << "connecting clk/rst for child " << qPrintable(name) << " of " << qPrintable(parentBlock->getName()) << endl; } if ((fromClk == NULL) || (fromRst == NULL)) { throw(Exception(IFACE_GROUP_NOCLKRST,parentBlock)); @@ -284,10 +286,33 @@ void AbstractBlock::connectClkReset() throw(Exception) { else { fromClk->connectTo(toClk); fromRst->connectTo(toRst); + cout << "connection done between " << qPrintable(toClk->getConnectedFrom()->getOwner()->getName()) << "/" << qPrintable(toClk->getConnectedFrom()->getName()); + cout << " and " << qPrintable(toClk->getOwner()->getName()) << "/" << qPrintable(toClk->getName()) << endl; } +} +void AbstractBlock::generateEntity(QTextStream& out, bool hasController) throw(Exception) { + out << "entity " << name << " is" << endl; + try { + generateEntityOrComponentBody(out, 0, hasController); + } + catch(Exception e) { + throw(e); + } + out << "end entity " << name << ";" << endl << endl; } +void AbstractBlock::generateComponent(QTextStream& out, bool hasController) throw(Exception) { + + out << " component " << name << " is" << endl; + try { + generateEntityOrComponentBody(out, 2, hasController); + } + catch(Exception e) { + throw(e); + } + out << " end component; " << endl << endl; +}