MCPcopy Create free account
hub / github.com/PKU-IDEA/OpenPARF / XyToCrIndex

Method XyToCrIndex

openparf/database/placedb.cpp:210–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210PlaceDB::IndexType PlaceDB::XyToCrIndex(const PlaceDB::CoordinateType &x, const PlaceDB::CoordinateType &y) const {
211 openparfAssert(0 <= x && x <= db_->layout().siteMap().width());
212 openparfAssert(0 <= y && y <= db_->layout().siteMap().height());
213 auto ix = std::min(static_cast<IndexType>(x), layout_to_clock_region_map.width() - 1);
214 auto iy = std::min(static_cast<IndexType>(y), layout_to_clock_region_map.height() - 1);
215 return layout_to_clock_region_map.at(ix, iy).ref().get().id();
216}
217
218PlaceDB::IndexType PlaceDB::XyToHcIndex(const PlaceDB::CoordinateType &x, const PlaceDB::CoordinateType &y) const {
219 openparfAssert(0 <= x && x <= db_->layout().siteMap().width());

Callers 6

genSite2CrMapFunction · 0.80
CrCkCounterFunction · 0.80
legalityCheckFunction · 0.80
direct_lg.cppFile · 0.80
MinCostFlowLegalizerFunction · 0.80
ismDetailedPlaceForwardFunction · 0.80

Calls 6

refMethod · 0.80
widthMethod · 0.45
heightMethod · 0.45
idMethod · 0.45
getMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected