From: stephane Domas Date: Mon, 5 Mar 2018 10:00:46 +0000 (+0100) Subject: after merge X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/commitdiff_plain/c85843afb9bd492b46d6fe87a8287157097483f5?ds=inline after merge --- c85843afb9bd492b46d6fe87a8287157097483f5 diff --cc AbstractBlock.cpp index 90031d9,13adcae..336b677 --- a/AbstractBlock.cpp +++ b/AbstractBlock.cpp @@@ -3,17 -3,20 +3,22 @@@ #include #include "AbstractInterface.h" #include "BlockParameter.h" +#include "Parameters.h" + #include "GroupBlock.h" + #include "ConnectedInterface.h" + + AbstractBlock::AbstractBlock() { name = ""; parent = NULL; } + /* AbstractBlock::AbstractBlock(const QString& _name) { - name = normalizeName(_name); + name = Parameters::normalizeName(_name); parent = NULL; } + */ AbstractBlock::~AbstractBlock() { @@@ -236,6 -239,56 +241,51 @@@ QList AbstractBlock:: return lst; } -QString AbstractBlock::normalizeName(const QString &name) { - QString s = name; - s.replace(QRegularExpression("[^a-zA-Z0-9_]"),"_"); - s.replace(QRegularExpression("[_]+"),"_"); - return s; -} + + 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); + + if ((lstClk.isEmpty()) || (lstRst.isEmpty())) { + throw(Exception(IFACE_GROUP_NOCLKRST,this)); + } + + ConnectedInterface* toClk = AI_TO_CON(lstClk.at(0)); + ConnectedInterface* toRst = AI_TO_CON(lstRst.at(0)); + + ConnectedInterface* fromClk = NULL; + ConnectedInterface* fromRst = NULL; + + if (parentBlock->isTop()) { + AbstractBlock* clkrstgen = parentBlock->getFunctionalBlockByName("clkrstgen"); + if (clkrstgen == NULL) { + throw(Exception(IFACE_TOP_NOCLKRSTGEN,this)); + } + else { + fromClk = AI_TO_CON(clkrstgen->getIfaceFromName("clk")); + fromRst = AI_TO_CON(clkrstgen->getIfaceFromName("reset")); + } + } + else { + fromClk = AI_TO_CON(parentBlock->getIfaceFromName("clk")); + fromRst = AI_TO_CON(parentBlock->getIfaceFromName("reset")); + } + if ((fromClk == NULL) || (fromRst == NULL)) { + throw(Exception(IFACE_GROUP_NOCLKRST,parentBlock)); + } + else { + fromClk->connectTo(toClk); + fromRst->connectTo(toRst); + } + + + } + + diff --cc AbstractBlock.h index ebb1560,616682d..3e811e9 --- a/AbstractBlock.h +++ b/AbstractBlock.h @@@ -56,7 -56,9 +56,9 @@@ public bool isWBConfigurable(); // others - static QString normalizeName(const QString& name); + void connectClkReset() throw(Exception); + + virtual void parametersValidation(QList* checkedBlocks, QList* blocksToConfigure) = 0; // ugly but usefull void addParameter(BlockParameter *param); diff --cc blast.creator.user index 2d89560,f58f194..0000000 deleted file mode 100755,100755 --- a/blast.creator.user +++ /dev/null @@@ -1,198 -1,198 +1,0 @@@ -- -- - - -- -- -- EnvironmentId - {94112477-caab-4897-8f75-5f412f2c883a} - {c8006d66-d34f-42be-ad10-d0207752286d} -- -- -- ProjectExplorer.Project.ActiveTarget -- 0 -- -- -- ProjectExplorer.Project.EditorSettings -- -- true -- false -- true -- -- Cpp -- -- CppGlobal -- -- -- -- QmlJS -- -- QmlJSGlobal -- -- -- 2 -- UTF-8 -- false -- 4 -- false -- 80 -- true -- true -- 1 -- true -- false -- 0 -- true -- true -- 0 -- 8 -- true -- 1 -- true -- true -- true -- false -- -- -- -- ProjectExplorer.Project.PluginSettings -- -- -- -- ProjectExplorer.Project.Target.0 -- -- Desktop -- Desktop - {c934e180-ebc6-41ed-be82-502cc94f41f6} - {2c9bf876-3476-44eb-8065-1f0844704dda} -- 0 -- 0 -- 0 -- -- /home/sdomas/Projet/Blast/code/blast -- -- -- -- all -- -- false -- -- -- true -- Make -- -- GenericProjectManager.GenericMakeStep -- -- 1 -- Compiler -- -- ProjectExplorer.BuildSteps.Build -- -- -- -- -- clean -- -- true -- -- -- true -- Make -- -- GenericProjectManager.GenericMakeStep -- -- 1 -- Nettoyer -- -- ProjectExplorer.BuildSteps.Clean -- -- 2 -- false -- -- Défaut -- Défaut -- GenericProjectManager.GenericBuildConfiguration -- -- 1 -- -- -- 0 -- Déploiement -- -- ProjectExplorer.BuildSteps.Deploy -- -- 1 -- Déployer localement -- -- ProjectExplorer.DefaultDeployConfiguration -- -- 1 -- -- -- false -- false -- 1000 -- -- true -- -- false -- false -- false -- false -- true -- 0.01 -- 10 -- true -- 1 -- 25 -- -- 1 -- true -- false -- true -- valgrind -- -- 0 -- 1 -- 2 -- 3 -- 4 -- 5 -- 6 -- 7 -- 8 -- 9 -- 10 -- 11 -- 12 -- 13 -- 14 -- -- 2 -- -- -- -- %{buildDir} -- Custom Executable -- -- ProjectExplorer.CustomExecutableRunConfiguration -- 3768 -- false -- true -- false -- false -- true -- -- 1 -- -- -- -- ProjectExplorer.Project.TargetCount -- 1 -- -- -- ProjectExplorer.Project.Updater.FileVersion -- 18 -- -- -- Version -- 18 -- -- diff --cc lib/implementations/impls.bmf index 1d8c695,8384e85..0000000 deleted file mode 100644,100644 Binary files differ diff --cc lib/references/references.bmf index 2c93c03,a34f592..0000000 deleted file mode 100644,100644 Binary files differ