Note
Click here to download the full example code
1.9. Merging two instances in the designΒΆ
This example demonstrate how to merge two instance in the design to create a new merged definition
Output1 Merged design Instance
import logging
import spydrnet as sdn
import spydrnet_physical as sdnphy
from spydrnet_physical.composers.svg.composer import SVGComposer
logger = logging.getLogger("spydrnet_logs")
sdn.enable_file_logging(LOG_LEVEL="INFO")
netlist = sdnphy.load_netlist_by_name("nested_hierarchy")
top = netlist.top_instance.reference
inst1 = next(top.get_instances("inst_1_0"))
inst2 = next(top.get_instances("inst_1_1"))
top.merge_instance(
[inst1, inst2],
new_definition_name="merged_module",
new_instance_name="merged_module_instance_0",
)
top.create_unconn_wires()
composer = SVGComposer()
composer.run(netlist, file_out="_merged_design.svg")
Total running time of the script: ( 0 minutes 0.000 seconds)