X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/756baf5c8eaf003e8271dab9c395de2b0e704857..eb12792fe5344f4d128b8aba2a7948aa13f6a1ae:/GroupBlock.cpp?ds=inline diff --git a/GroupBlock.cpp b/GroupBlock.cpp index 422cf97..6950b30 100644 --- a/GroupBlock.cpp +++ b/GroupBlock.cpp @@ -10,25 +10,40 @@ int GroupBlock::counter = 1; GroupBlock::GroupBlock(GroupBlock *_parent) throw(Exception) : AbstractBlock() { + GroupInterface* clk = NULL; + GroupInterface* rst = NULL; + // force topGroup to false if this group has a parent if (_parent != NULL) { topGroup = false; name = QString("sub_group")+"_"+QString::number(counter++); + // creating clk/rst interfaces + clk = new GroupInterface(this,"clk", AbstractInterface::Input, AbstractInterface::Clock); + rst = new GroupInterface(this,"reset", AbstractInterface::Input, AbstractInterface::Reset); + addInterface(clk); + addInterface(rst); } else { topGroup = true; name = QString("top_group"); // creating external clk/rst interfaces - GroupInterface* clk = new GroupInterface(this,"ext_clk", AbstractInterface::Input, AbstractInterface::Clock); - GroupInterface* rst = new GroupInterface(this,"ext_reset", AbstractInterface::Input, AbstractInterface::Reset); + clk = new GroupInterface(this,"ext_clk", AbstractInterface::Input, AbstractInterface::Clock); + rst = new GroupInterface(this,"ext_reset", AbstractInterface::Input, AbstractInterface::Reset); addInterface(clk); addInterface(rst); // creating clkrstgen block : done in Dispatcher since this has no access to library } parent = _parent; - if (parent != NULL) { - // adding this to the child blocks of parent - AB_TO_GRP(parent)->addBlock(this); + if (_parent != NULL) { + // adding this to the child blocks of parent + _parent->addBlock(this); + // connect clk/rst ifaces to parent clk/rst or to clkrstgen if parent is top group + if (_parent->isTop()) { + + } + else { + + } } }