# Running times in detailed routing as a function of design parameters Tool: Detailed Routing Subcategory: Performance analysis ## Conversation ### oharboe mock-array-big has 3 essential parameters that can be adjusted: array area(number of elements), element size (area) and data width (bits). I thought it would be interesting to see how detailed routing (TritonRoute) varies across these parameters, so I made a python snippet(https://github.com/Pinata-Consulting/OpenROAD-flow-scripts/commits/plot-running-times) to gather some data and plot them The graph below is interactive(measured on a machine with 16 threads and 64gByte of RAM, where memory consumption appears to peak at 20gByte), which helps in terms of understanding the 4 dimensions being represented: Video: https://drive.google.com/file/d/1pmkIZh6tUOrWhAkVRgm0fxCD7yaf766Q/view Snapshot: ![image](https://user-images.githubusercontent.com/2798822/236807617-6c48df46-609a-4614-937e-539cbf7c5ce7.png) **8 x 8 64 bit array detailed route times plotted against threads** ![image](https://user-images.githubusercontent.com/2798822/236921035-c2ac6218-b515-4c83-b342-0c3d2f677f99.png) **Conclusion so far** Detailed routing is surprisingly slow when the area is large, but everything else is the same. This run takes 40 minutes or so, `APTOS_MOCK_PITCH_SCALE=20 make FLOW_VARIANT=scale-20 route DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk` whereas `APTOS_MOCK_PITCH_SCALE=2 make FLOW_VARIANT=scale-2 DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk` completes in a few minutes **Detailed of testing...** It looks like the performance of detailed routing is sensitive to area: ``` MOCK_ARRAY_PITCH_SCALE=2 make OPENROAD_EXE="perf record -o perf.data ~/OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad" DESIGN_CONFIG=designs/asap7/mock-array-big/config.mk FLOW_VARIANT=scale-2 route ``` ``` Samples: 15M of event 'cycles', Event count (approx.): 14285585618565 Overhead Command Shared Object Symbol 16,94% openroad openroad [.] fr::FlexGridGraph::initEdges 8,38% openroad openroad [.] fr::FlexGridGraph::outOfDieVia 7,46% openroad openroad [.] fr::FlexDRWorker::modMinSpacingCostVia 5,92% openroad openroad [.] fr::FlexGCWorker::Impl::isCornerOverlap 4,62% openroad libstdc++.so.6.0.30 [.] std::_Rb_tree_increment 4,23% openroad [unknown] [k] 0xffffffffa7b87f27 4,20% openroad openroad [.] fr::FlexDRWorker::modMinSpacingCostPlanar 3,31% openroad openroad [.] fr::frLayer::getMinSpacingValue 3,22% openroad openroad [.] fr::FlexGridGraph::getIdx 2,93% openroad openroad [.] fr::FlexGCWorker::Impl::initNet_pins_polygonCorners_helper 2,48% openroad openroad [.] fr::FlexDRWorker::modMinSpacingCostVia_eol 2,46% openroad openroad [.] box2boxDistSquareNew 2,37% openroad openroad [.] fr::FlexDRWorker::modBlockedPlanar 2,17% openroad openroad [.] fr::FlexGridGraph::addFixedShapeCostVia 1,71% openroad openroad [.] odb::dbTransform::apply 1,45% openroad openroad [.] fr::FlexGridGraph::isEdgeInBox 1,43% openroad openroad [.] odb::dbTransform::apply 1,28% openroad openroad [.] fr::FlexDRWorker::modBlockedVia 1,25% openroad openroad [.] std::vector