Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Szymon Gizler <sgizler@antmicro.com>
  • Loading branch information
sgizler committed Nov 28, 2024
1 parent 3b19727 commit 6798309
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 30 deletions.
2 changes: 1 addition & 1 deletion src/drt/src/db/infra/frPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Point3D : public Point
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, hash_value(((Point) p)));
boost::hash_combine(seed, p.getZ());
return seed;
}
Expand Down
17 changes: 11 additions & 6 deletions src/drt/src/gc/FlexGC_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@

#pragma once

#include <boost/unordered/unordered_flat_set.hpp>
#include <memory>

#include "db/gcObj/gcNet.h"
#include "dr/FlexDR.h"
#include "frDesign.h"
#include "gc/FlexGC.h"
#include <boost/unordered/unordered_flat_set.hpp>

namespace odb {
class dbTechLayerCutSpacingTableDefRule;
Expand Down Expand Up @@ -192,31 +192,36 @@ class FlexGCWorker::Impl
void initNet_pins_polygonEdges(gcNet* net);
void initNet_pins_polygonEdges_getFixedPolygonEdges(
gcNet* net,
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedPolygonEdges);
void initNet_pins_polygonEdges_helper_outer(
gcNet* net,
gcPin* pin,
gcPolygon* poly,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedPolygonEdges);
void initNet_pins_polygonEdges_helper_inner(
gcNet* net,
gcPin* pin,
const gtl::polygon_90_data<frCoord>& hole_poly,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges);
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
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<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles);
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedMaxRectangles);
void initNet_pins_maxRectangles_helper(
gcNet* net,
gcPin* pin,
const gtl::rectangle_data<frCoord>& rect,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles);
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedMaxRectangles);

void initRegionQuery();

Expand Down
21 changes: 14 additions & 7 deletions src/drt/src/gc/FlexGC_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ void FlexGCWorker::Impl::initNet_pins_polygon(gcNet* net)

void FlexGCWorker::Impl::initNet_pins_polygonEdges_getFixedPolygonEdges(
gcNet* net,
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedPolygonEdges)
{
int numLayers = getTech()->getLayers().size();
std::vector<gtl::polygon_90_with_holes_data<frCoord>> polys;
Expand Down Expand Up @@ -552,7 +553,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_outer(
gcPin* pin,
gcPolygon* poly,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedPolygonEdges)
{
Point bp, ep, firstPt;
gtl::point_data<frCoord> bp1, ep1, firstPt1;
Expand Down Expand Up @@ -626,7 +628,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonEdges_helper_inner(
gcPin* pin,
const gtl::polygon_90_data<frCoord>& hole_poly,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedPolygonEdges)
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedPolygonEdges)
{
Point bp, ep, firstPt;
gtl::point_data<frCoord> bp1, ep1, firstPt1;
Expand Down Expand Up @@ -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<boost::unordered_flat_set<std::pair<Point, Point>>> fixedPolygonEdges(numLayers);
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>
fixedPolygonEdges(numLayers);
// get all fixed polygon edges
initNet_pins_polygonEdges_getFixedPolygonEdges(net, fixedPolygonEdges);

Expand Down Expand Up @@ -852,7 +856,8 @@ void FlexGCWorker::Impl::initNet_pins_polygonCorners(gcNet* net)

void FlexGCWorker::Impl::initNet_pins_maxRectangles_getFixedMaxRectangles(
gcNet* net,
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles)
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedMaxRectangles)
{
int numLayers = getTech()->getLayers().size();
std::vector<gtl::rectangle_data<frCoord>> rects;
Expand All @@ -878,7 +883,8 @@ void FlexGCWorker::Impl::initNet_pins_maxRectangles_helper(
gcPin* pin,
const gtl::rectangle_data<frCoord>& rect,
frLayerNum i,
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>& fixedMaxRectangles)
const std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>&
fixedMaxRectangles)
{
auto rectangle = std::make_unique<gcRect>();
rectangle->setRect(rect);
Expand Down Expand Up @@ -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<boost::unordered_flat_set<std::pair<Point, Point>>> fixedMaxRectangles(numLayers);
std::vector<boost::unordered_flat_set<std::pair<Point, Point>>>
fixedMaxRectangles(numLayers);
// get all fixed max rectangles
initNet_pins_maxRectangles_getFixedMaxRectangles(net, fixedMaxRectangles);

Expand Down
24 changes: 13 additions & 11 deletions src/drt/src/io/GuideProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class GuideProcessor
: design_(designIn),
logger_(loggerIn),
db_(dbIn),
router_cfg_(router_cfg){};
router_cfg_(router_cfg) {};
/**
* @brief Reads guides from odb and fill the tmp_guides_ list of unprocessed
* guides
Expand Down Expand Up @@ -176,11 +176,12 @@ class GuideProcessor
* guides only.
*
*/
void genGuides_split(std::vector<frRect>& rects,
const TrackIntervalsByLayer& intvs,
const boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
frBlockObjectMap<std::set<Point3D>>& pin_gcell_map,
bool via_access_only) const;
void genGuides_split(
std::vector<frRect>& rects,
const TrackIntervalsByLayer& intvs,
const boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
frBlockObjectMap<std::set<Point3D>>& pin_gcell_map,
bool via_access_only) const;
/**
* Initializes a map of gcell location to set of pins
*
Expand All @@ -191,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,
boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map) const;
void initGCellPinMap(const frNet* net,
boost::unordered_flat_map<Point3D, frBlockObjectSet>&
gcell_pin_map) const;
/**
* Populates gcell_pin_map with the values associated with the passed term
* based on pin shapes.
Expand All @@ -205,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(boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
frBlockObject* term) const;
void mapPinShapesToGCells(
boost::unordered_flat_map<Point3D, frBlockObjectSet>& gcell_pin_map,
frBlockObject* term) const;
/**
* Populates gcell_pin_map with the values associated with the passed pin
* based on access points.
Expand Down
11 changes: 6 additions & 5 deletions src/odb/include/odb/geom.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
#pragma once

#include <algorithm>
#include <boost/functional/hash.hpp>
#include <iosfwd>
#include <tuple>
#include <vector>

#include "isotropy.h"
#include "odb.h"
#include "utl/Logger.h"
#include <boost/functional/hash.hpp>

namespace odb {

Expand Down Expand Up @@ -94,10 +94,11 @@ class Point
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 {
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());
}
Expand Down

0 comments on commit 6798309

Please sign in to comment.