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 {
+
+ }
}
}