# Inserting PDN takes a lot of time Tool: Power Distribution Network Generator Subcategory: Performance issue ## Conversation ### oharboe Is it expected that inserting PDN (last part of make floorplan) should take a lot of time for designs that start to approach 1mm^2 in ASAP7? It would be helpful if "make floorplan" was faster, because then it is quicker to iterate on the floorplan, after which the build can normally be left alone without human interaction for longer runs. I ran it in the debugger and it looks like a lot of time is spent building this ShapeTree: https://github.com/The-OpenROAD-Project/OpenROAD/blob/b99d7d2c3db8b72a3fc35da9bd6c3a203c3b8306/src/pdn/src/shape.cpp#L637 Afterwards, this line seems to almost always return false https://github.com/The-OpenROAD-Project/OpenROAD/blob/b99d7d2c3db8b72a3fc35da9bd6c3a203c3b8306/src/pdn/src/shape.cpp#L640) I made a few fleeting vain attempts to rewrite the code, such that the common case, https://github.com/The-OpenROAD-Project/OpenROAD/blob/b99d7d2c3db8b72a3fc35da9bd6c3a203c3b8306/src/pdn/src/shape.cpp#L627, returning false, would not require building the ShapeTree. ### maliberty There could be a lot of factors. Are you using the asap7 default pdn? @gadfort ### oharboe Still running, 1 hr 35 minutes... ``` 01:35:49 /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad -exit -no_init ./scripts/pdn.tcl -metrics ./logs/asap7/doohickey/base/2_6_pdn.json ``` ### maliberty In asap7 the m1/m2 stripes introduce a ton of vias. @gadfort could help skip the add_pdn_connect for M1/M2 or would that produce an error. It wouldn't matter much for prototyping whether we have the vias or not. ### gadfort @oharboe @maliberty it shouldn't take that long, there has always been some inefficiency when building those obstruction sets and maybe it's a good idea to revisit how that is done and find a better solution that is faster. ### oharboe @maliberty @gadfort Example of ```[INFO PDN-0001] Inserting grid: top``` taking at least 12 hours, after which I stopped it. https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/pull/779 ### oharboe PDN insertion is MUCH faster than it used to be, but it can still be an issue.