ref1->connectTo(ref2);
ok1 = true;
}
- // if the frist one did not work, test ref2->ref1
+ // if the first one did not work, test ref2->ref1
if ((ok1 == false) && (ref2->canConnectTo(ref1)) && (ref1->canConnectFrom(ref2))) {
ref2->connectTo(ref1);
ok2 = true;
// creating the clkrstgen block
ReferenceBlock* ref = params->getHiddenReferenceBlock("clkrstgen");
FunctionalBlock* newOne = params->getGraph()->createFunctionalBlock(topBlock, ref, true);
- ConnectedInterface* fromIface = AI_TO_CON(topBlock->getIfaceFromName("ext_clk"));
- ConnectedInterface* toIface = AI_TO_CON(newOne->getIfaceFromName("ext_clk"));
- fromIface->connectTo(toIface);
- fromIface = AI_TO_CON(topBlock->getIfaceFromName("ext_reset"));
- toIface = AI_TO_CON(newOne->getIfaceFromName("ext_reset"));
- fromIface->connectTo(toIface);
- // create the clkrstgen boxitem
- BoxItem* item = scene->createBoxItem(newOne, GroupScene::Left, GroupScene::Top, AbstractBoxItem::Position, BoxItem::HSpan);
- params->blockToItem.insert(newOne,item);
+ // creating the clkrstgen item
+ BoxItem* clkResetItem = scene->createBoxItem(newOne, BoxItem::TopLeft, AbstractBoxItem::Position | AbstractBoxItem::Dimension, BoxItem::NoSpan);
+ params->blockToItem.insert(newOne,clkResetItem);
+ // creating top group ext_clk iface item
+ ConnectedInterface* fromIfaceClk = AI_TO_CON(topBlock->getIfaceFromName("ext_clk"));
+ InterfaceItem* fromIfaceItemClk = new InterfaceItem(0.5 , Parameters::West, fromIfaceClk, group, params, true);
+ group->addInterfaceItem(fromIfaceItemClk,true);
+ // creating top group ext_reset iface item
+ ConnectedInterface* fromIfaceReset = AI_TO_CON(topBlock->getIfaceFromName("ext_reset"));
+ InterfaceItem* fromIfaceItemReset = new InterfaceItem(0.5 , Parameters::West, fromIfaceReset, group, params, false);
+ group->addInterfaceItem(fromIfaceItemReset,true);
+ // connecting ext_clk iface items
+ InterfaceItem* toIfaceItemClk = clkResetItem->searchInterfaceItemByName("ext_clk");
+ if (toIfaceItemClk == NULL) {
+ cerr << "Abnormal case while connecting top group ext_clk to clkrstgen" << endl;
+ }
+ createConnection(context,fromIfaceItemClk, toIfaceItemClk, false);
+ // connecting ext_reset iface items
+ InterfaceItem* toIfaceItemReset = clkResetItem->searchInterfaceItemByName("ext_reset");
+ if (toIfaceItemReset == NULL) {
+ cerr << "Abnormal case while connecting top group ext_reset to clkrstgen" << endl;
+ }
+ createConnection(context,fromIfaceItemReset, toIfaceItemReset, false);
}