@@ -3551,6 +3551,7 @@ Descriptor::Properties DbModuleDescriptor::getDBProperties(
35513551
35523552 Properties props;
35533553 if (mod_inst != nullptr ) {
3554+ props.push_back ({" ModInst" , gui->makeSelected (mod_inst)});
35543555 auto * parent = mod_inst->getParent ();
35553556 if (parent != nullptr ) {
35563557 props.push_back ({" Parent" , gui->makeSelected (parent)});
@@ -3562,10 +3563,9 @@ Descriptor::Properties DbModuleDescriptor::getDBProperties(
35623563 }
35633564 }
35643565
3565- Descriptor::PropertyList children;
3566+ SelectionSet children;
35663567 for (auto * child : module ->getChildren ()) {
3567- children.push_back (
3568- {gui->makeSelected (child->getMaster ()), gui->makeSelected (child)});
3568+ children.insert (gui->makeSelected (child->getMaster ()));
35693569 }
35703570 if (!children.empty ()) {
35713571 props.push_back ({" Children" , children});
@@ -3721,7 +3721,20 @@ void DbModBTermDescriptor::visitAllObjects(
37213721 return ;
37223722 }
37233723
3724- // getModules(block->getTopModule(), func);
3724+ getModBTerms (block->getTopModule (), func);
3725+ }
3726+
3727+ void DbModBTermDescriptor::getModBTerms (
3728+ odb::dbModule* module ,
3729+ const std::function<void (const Selected&)>& func) const
3730+ {
3731+ for (auto * modbterm : module ->getModBTerms ()) {
3732+ func ({modbterm, this });
3733+ }
3734+
3735+ for (auto * mod_inst : module ->getChildren ()) {
3736+ getModBTerms (mod_inst->getMaster (), func);
3737+ }
37253738}
37263739
37273740// ////////////////////////////////////////////////
@@ -3795,7 +3808,23 @@ void DbModITermDescriptor::visitAllObjects(
37953808 return ;
37963809 }
37973810
3798- // getModules(block->getTopModule(), func);
3811+ getModITerms (block->getTopModule (), func);
3812+ }
3813+
3814+ void DbModITermDescriptor::getModITerms (
3815+ odb::dbModule* module ,
3816+ const std::function<void (const Selected&)>& func) const
3817+ {
3818+ auto mod_inst = module ->getModInst ();
3819+ if (mod_inst) {
3820+ for (auto * modbterm : mod_inst->getModITerms ()) {
3821+ func ({modbterm, this });
3822+ }
3823+ }
3824+
3825+ for (auto * mod_inst : module ->getChildren ()) {
3826+ getModITerms (mod_inst->getMaster (), func);
3827+ }
37993828}
38003829
38013830// ////////////////////////////////////////////////
@@ -3874,9 +3903,22 @@ void DbModInstDescriptor::visitAllObjects(
38743903 return ;
38753904 }
38763905
3877- // getModules (block->getTopModule(), func);
3906+ getModInsts (block->getTopModule (), func);
38783907}
38793908
3909+ void DbModInstDescriptor::getModInsts (
3910+ odb::dbModule* module ,
3911+ const std::function<void (const Selected&)>& func) const
3912+ {
3913+ auto mod_inst = module ->getModInst ();
3914+ if (mod_inst) {
3915+ func ({mod_inst, this });
3916+ }
3917+
3918+ for (auto * mod_inst : module ->getChildren ()) {
3919+ getModInsts (mod_inst->getMaster (), func);
3920+ }
3921+ }
38803922// ////////////////////////////////////////////////
38813923
38823924DbModNetDescriptor::DbModNetDescriptor (odb::dbDatabase* db)
@@ -3961,7 +4003,20 @@ void DbModNetDescriptor::visitAllObjects(
39614003 return ;
39624004 }
39634005
3964- // getModules(block->getTopModule(), func);
4006+ getModNets (block->getTopModule (), func);
4007+ }
4008+
4009+ void DbModNetDescriptor::getModNets (
4010+ odb::dbModule* module ,
4011+ const std::function<void (const Selected&)>& func) const
4012+ {
4013+ for (auto * modnet : module ->getModNets ()) {
4014+ func ({modnet, this });
4015+ }
4016+
4017+ for (auto * mod_inst : module ->getChildren ()) {
4018+ getModNets (mod_inst->getMaster (), func);
4019+ }
39654020}
39664021
39674022// ////////////////////////////////////////////////
0 commit comments