diff --git a/etc/DependencyInstaller.sh b/etc/DependencyInstaller.sh index 42fd1bbb077..81218d9cd9e 100755 --- a/etc/DependencyInstaller.sh +++ b/etc/DependencyInstaller.sh @@ -66,9 +66,9 @@ _installCommonDev() { pcreChecksum="37d2f77cfd411a3ddf1c64e1d72e43f7" swigVersion=4.1.0 swigChecksum="794433378154eb61270a3ac127d9c5f3" - boostVersionBig=1.80 + boostVersionBig=1.86 boostVersionSmall=${boostVersionBig}.0 - boostChecksum="077f074743ea7b0cb49c6ed43953ae95" + boostChecksum="ac857d73bb754b718a039830b07b9624" eigenVersion=3.4 cuddVersion=3.0.0 lemonVersion=1.3.1 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf33b31a136..bcea61b9901 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -172,8 +172,11 @@ if (SWIG_VERSION VERSION_GREATER_EQUAL "4.1.0") endif() include(UseSWIG) -find_package(Boost REQUIRED) +find_package(Boost 1.81.0) message(STATUS "boost: ${Boost_VERSION}") +if(NOT Boost_FOUND) + message(FATAL_ERROR "No suitable version of boost found. Consider (re)running `/etc/DependencyInstaller.sh -common`") +endif() if (ENABLE_TESTS) find_package(GTest REQUIRED) diff --git a/src/drt/src/db/infra/frPoint.h b/src/drt/src/db/infra/frPoint.h index 6443eae96b3..5b8ed13ee14 100644 --- a/src/drt/src/db/infra/frPoint.h +++ b/src/drt/src/db/infra/frPoint.h @@ -65,6 +65,14 @@ class Point3D : public Point return z_ < rhs.z_; } + friend std::size_t hash_value(Point3D const& p) + { + std::size_t seed = 0; + boost::hash_combine(seed, hash_value(((Point) p))); + boost::hash_combine(seed, p.getZ()); + return seed; + } + private: int z_{0}; template diff --git a/src/drt/src/gc/FlexGC_impl.h b/src/drt/src/gc/FlexGC_impl.h index 973f1cd48f8..042ed5503d0 100644 --- a/src/drt/src/gc/FlexGC_impl.h +++ b/src/drt/src/gc/FlexGC_impl.h @@ -28,6 +28,7 @@ #pragma once +#include #include #include "db/gcObj/gcNet.h" @@ -191,31 +192,36 @@ class FlexGCWorker::Impl void initNet_pins_polygonEdges(gcNet* net); void initNet_pins_polygonEdges_getFixedPolygonEdges( gcNet* net, - std::vector>>& fixedPolygonEdges); + std::vector>>& + fixedPolygonEdges); void initNet_pins_polygonEdges_helper_outer( gcNet* net, gcPin* pin, gcPolygon* poly, frLayerNum i, - const std::vector>>& fixedPolygonEdges); + const std::vector>>& + fixedPolygonEdges); void initNet_pins_polygonEdges_helper_inner( gcNet* net, gcPin* pin, const gtl::polygon_90_data& hole_poly, frLayerNum i, - const std::vector>>& fixedPolygonEdges); + const std::vector>>& + fixedPolygonEdges); void initNet_pins_polygonCorners(gcNet* net); void initNet_pins_polygonCorners_helper(gcNet* net, gcPin* pin); void initNet_pins_maxRectangles(gcNet* net); void initNet_pins_maxRectangles_getFixedMaxRectangles( gcNet* net, - std::vector>>& fixedMaxRectangles); + std::vector>>& + fixedMaxRectangles); void initNet_pins_maxRectangles_helper( gcNet* net, gcPin* pin, const gtl::rectangle_data& rect, frLayerNum i, - const std::vector>>& fixedMaxRectangles); + const std::vector>>& + fixedMaxRectangles); void initRegionQuery(); diff --git a/src/drt/src/gc/FlexGC_init.cpp b/src/drt/src/gc/FlexGC_init.cpp index 4575e6a5962..904277fb3c8 100644 --- a/src/drt/src/gc/FlexGC_init.cpp +++ b/src/drt/src/gc/FlexGC_init.cpp @@ -486,7 +486,8 @@ void FlexGCWorker::Impl::initNet_pins_polygon(gcNet* net) void FlexGCWorker::Impl::initNet_pins_polygonEdges_getFixedPolygonEdges( gcNet* net, - std::vector>>& fixedPolygonEdges) + std::vector>>& + fixedPolygonEdges) { int numLayers = getTech()->getLayers().size(); std::vector> polys; @@ -552,7 +553,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_outer( gcPin* pin, gcPolygon* poly, frLayerNum i, - const std::vector>>& fixedPolygonEdges) + const std::vector>>& + fixedPolygonEdges) { Point bp, ep, firstPt; gtl::point_data bp1, ep1, firstPt1; @@ -626,7 +628,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_inner( gcPin* pin, const gtl::polygon_90_data& hole_poly, frLayerNum i, - const std::vector>>& fixedPolygonEdges) + const std::vector>>& + fixedPolygonEdges) { Point bp, ep, firstPt; gtl::point_data bp1, ep1, firstPt1; @@ -698,7 +701,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_inner( void FlexGCWorker::Impl::initNet_pins_polygonEdges(gcNet* net) { int numLayers = getTech()->getLayers().size(); - std::vector>> fixedPolygonEdges(numLayers); + std::vector>> + fixedPolygonEdges(numLayers); // get all fixed polygon edges initNet_pins_polygonEdges_getFixedPolygonEdges(net, fixedPolygonEdges); @@ -852,7 +856,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonCorners(gcNet* net) void FlexGCWorker::Impl::initNet_pins_maxRectangles_getFixedMaxRectangles( gcNet* net, - std::vector>>& fixedMaxRectangles) + std::vector>>& + fixedMaxRectangles) { int numLayers = getTech()->getLayers().size(); std::vector> rects; @@ -878,7 +883,8 @@ void FlexGCWorker::Impl::initNet_pins_maxRectangles_helper( gcPin* pin, const gtl::rectangle_data& rect, frLayerNum i, - const std::vector>>& fixedMaxRectangles) + const std::vector>>& + fixedMaxRectangles) { auto rectangle = std::make_unique(); rectangle->setRect(rect); @@ -916,7 +922,8 @@ void FlexGCWorker::Impl::initNet_pins_maxRectangles_helper( void FlexGCWorker::Impl::initNet_pins_maxRectangles(gcNet* net) { int numLayers = getTech()->getLayers().size(); - std::vector>> fixedMaxRectangles(numLayers); + std::vector>> + fixedMaxRectangles(numLayers); // get all fixed max rectangles initNet_pins_maxRectangles_getFixedMaxRectangles(net, fixedMaxRectangles); diff --git a/src/drt/src/io/GuideProcessor.cpp b/src/drt/src/io/GuideProcessor.cpp index a85ab2d1ff4..10ab0eb768a 100644 --- a/src/drt/src/io/GuideProcessor.cpp +++ b/src/drt/src/io/GuideProcessor.cpp @@ -1159,7 +1159,7 @@ void addSplitRect(const frCoord track_idx, void GuideProcessor::genGuides_split( std::vector& rects, const TrackIntervalsByLayer& intvs, - const std::map& gcell_pin_map, + const boost::unordered_flat_map& gcell_pin_map, frBlockObjectMap>& pin_gcell_map, bool via_access_only) const { @@ -1262,7 +1262,7 @@ void GuideProcessor::genGuides_split( } void GuideProcessor::mapPinShapesToGCells( - std::map& gcell_pin_map, + boost::unordered_flat_map& gcell_pin_map, frBlockObject* term) const { const auto pin_shapes = getPinShapes(term); @@ -1283,7 +1283,7 @@ void GuideProcessor::mapPinShapesToGCells( void GuideProcessor::initGCellPinMap( const frNet* net, - std::map& gcell_pin_map) const + boost::unordered_flat_map& gcell_pin_map) const { for (auto instTerm : net->getInstTerms()) { mapTermAccessPointsToGCells(gcell_pin_map, instTerm); @@ -1294,7 +1294,7 @@ void GuideProcessor::initGCellPinMap( } void GuideProcessor::mapTermAccessPointsToGCells( - std::map& gcell_pin_map, + boost::unordered_flat_map& gcell_pin_map, frBlockObject* pin) const { for (const auto& ap_loc : getAccessPoints(pin)) { @@ -1376,7 +1376,7 @@ std::vector> GuideProcessor::genGuides( } genGuides_prep(rects, intvs); - std::map gcell_pin_map; + boost::unordered_flat_map gcell_pin_map; frBlockObjectMap> pin_gcell_map; initGCellPinMap(net, gcell_pin_map); initPinGCellMap(net, pin_gcell_map); @@ -2024,4 +2024,4 @@ void GuideProcessor::processGuides() } } -} // namespace drt::io \ No newline at end of file +} // namespace drt::io diff --git a/src/drt/src/io/GuideProcessor.h b/src/drt/src/io/GuideProcessor.h index bfd2a175005..5f1cc235496 100644 --- a/src/drt/src/io/GuideProcessor.h +++ b/src/drt/src/io/GuideProcessor.h @@ -32,6 +32,7 @@ /////////////////////////////////////////////////////////////////////////////// #pragma once #include +#include #include "db/tech/frTechObject.h" #include "frDesign.h" @@ -175,11 +176,12 @@ class GuideProcessor * guides only. * */ - void genGuides_split(std::vector& rects, - const TrackIntervalsByLayer& intvs, - const std::map& gcell_pin_map, - frBlockObjectMap>& pin_gcell_map, - bool via_access_only) const; + void genGuides_split( + std::vector& rects, + const TrackIntervalsByLayer& intvs, + const boost::unordered_flat_map& gcell_pin_map, + frBlockObjectMap>& pin_gcell_map, + bool via_access_only) const; /** * Initializes a map of gcell location to set of pins * @@ -190,9 +192,9 @@ class GuideProcessor * considered by this function. * @param gcell_pin_map A map to be populated by the result of this function. */ - void initGCellPinMap( - const frNet* net, - std::map& gcell_pin_map) const; + void initGCellPinMap(const frNet* net, + boost::unordered_flat_map& + gcell_pin_map) const; /** * Populates gcell_pin_map with the values associated with the passed term * based on pin shapes. @@ -204,8 +206,9 @@ class GuideProcessor * @param gcell_pin_map The map to be populated with the results. * @param term The current pin we are processing. */ - void mapPinShapesToGCells(std::map& gcell_pin_map, - frBlockObject* term) const; + void mapPinShapesToGCells( + boost::unordered_flat_map& gcell_pin_map, + frBlockObject* term) const; /** * Populates gcell_pin_map with the values associated with the passed pin * based on access points. @@ -218,7 +221,7 @@ class GuideProcessor * @param term The current pin we are processing. */ void mapTermAccessPointsToGCells( - std::map& gcell_pin_map, + boost::unordered_flat_map& gcell_pin_map, frBlockObject* pin) const; void initPinGCellMap(frNet* net, @@ -441,4 +444,4 @@ class GuidePathFinder frBlockObjectMap> pin_gcell_map_; std::vector rects_; }; -} // namespace drt::io \ No newline at end of file +} // namespace drt::io diff --git a/src/drt/src/pa/FlexPA_unique.h b/src/drt/src/pa/FlexPA_unique.h index ef1d0265e1b..56b7beb016d 100644 --- a/src/drt/src/pa/FlexPA_unique.h +++ b/src/drt/src/pa/FlexPA_unique.h @@ -27,6 +27,8 @@ #pragma once +#include + #include "frDesign.h" namespace drt { @@ -158,7 +160,7 @@ class UniqueInsts // Mapp all instances to their representative unique instance std::map inst_to_unique_; // Maps all instances to the set of instances with the same unique inst - std::unordered_map inst_to_class_; + boost::unordered_flat_map inst_to_class_; // Maps a unique instance to its pin access index std::map unique_to_pa_idx_; // Maps a unique instance to its index in unique_ diff --git a/src/odb/include/odb/geom.h b/src/odb/include/odb/geom.h index 7cff0a8da4c..1d98032950d 100644 --- a/src/odb/include/odb/geom.h +++ b/src/odb/include/odb/geom.h @@ -33,6 +33,7 @@ #pragma once #include +#include #include #include #include @@ -90,6 +91,20 @@ class Point int y_ = 0; }; +inline std::size_t hash_value(Point const& p) +{ + size_t hash = 0; + if constexpr (sizeof(size_t) == 8 && sizeof(size_t) == 2 * sizeof(int)) { + // Use fast identity hash if possible. We don't care about avalanching since + // it will be mixed later by flat_map anyway + return ((size_t) p.getX() << 32) | p.getY(); + } else { + boost::hash_combine(hash, p.x()); + boost::hash_combine(hash, p.y()); + } + return hash; +} + std::ostream& operator<<(std::ostream& os, const Point& pIn); /*