Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions include/ord/OpenRoad.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

#pragma once

#include <memory>
#include <set>
#include <string>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion src/OpenRoad.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
#include "rsz/MakeResizer.hh"
#include "rsz/Resizer.hh"
#include "sta/VerilogReader.hh"
#include "sta/VerilogWriter.hh"
#include "stt/MakeSteinerTreeBuilder.h"
#include "tap/MakeTapcell.h"
#include "tap/tapcell.h"
Expand Down
1 change: 0 additions & 1 deletion src/dbSta/test/read_verilog6.ok
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
[WARNING STA-0198] read_verilog6.v line 11, module AND2_X10 not found. Creating black box for u2.
[WARNING ORD-2011] LEF master BUF_X10 has no liberty cell.
[ERROR ORD-2013] instance u2 LEF master AND2_X10 not found.
Error: read_verilog6.tcl, 9 ORD-2013
2 changes: 1 addition & 1 deletion src/dbSta/test/read_verilog6.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ read_lef read_verilog6.lef
read_liberty Nangate45/Nangate45_typ.lib
# uses BUF_X10 (no liberty) and AND2_X10 (no lef or liberty)
read_verilog read_verilog6.v
link_design top
catch { link_design top }
13 changes: 10 additions & 3 deletions src/drt/src/db/drObj/drNet.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "db/infra/frPoint.h"
#include "db/infra/frSegStyle.h"
#include "db/obj/frAccess.h"
#include "db/obj/frBlockObject.h"
#include "frBaseTypes.h"
#include "global.h"

Expand Down Expand Up @@ -59,7 +60,10 @@ class drNet : public drBlockObject
void clearRouteConnFigs() { routeConnFigs_.clear(); }
frNet* getFrNet() const { return fNet_; }
void setFrNet(frNet* net) { fNet_ = net; }
const std::set<frBlockObject*>& getFrNetTerms() const { return fNetTerms_; }
const frOrderedIdSet<frBlockObject*>& getFrNetTerms() const
{
return fNetTerms_;
}
bool isModified() const { return modified_; }
int getNumMarkers() const { return numMarkers_; }
int getNumPinsIn() const { return numPinsIn_; }
Expand Down Expand Up @@ -117,7 +121,10 @@ class drNet : public drBlockObject
// TODO;
return false;
}
void setFrNetTerms(const std::set<frBlockObject*>& in) { fNetTerms_ = in; }
void setFrNetTerms(const frOrderedIdSet<frBlockObject*>& in)
{
fNetTerms_ = in;
}
void addFrNetTerm(frBlockObject* in) { fNetTerms_.insert(in); }
void setModified(bool in) { modified_ = in; }

Expand Down Expand Up @@ -207,7 +214,7 @@ class drNet : public drBlockObject
std::vector<std::unique_ptr<drConnFig>> extConnFigs_;
std::vector<std::unique_ptr<drConnFig>> routeConnFigs_;
std::vector<std::unique_ptr<drConnFig>> bestRouteConnFigs_;
std::set<frBlockObject*> fNetTerms_;
frOrderedIdSet<frBlockObject*> fNetTerms_;
frNet* fNet_{nullptr};
// old
bool modified_{false};
Expand Down
14 changes: 13 additions & 1 deletion src/drt/src/db/obj/frBlockObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,19 @@ struct frBlockObjectComp
{
bool operator()(const frBlockObject* lhs, const frBlockObject* rhs) const
{
return *lhs < *rhs;
if (lhs == rhs) {
return false;
}
if (lhs == nullptr || rhs == nullptr) {
return lhs < rhs;
}
if (lhs->typeId() != rhs->typeId()) {
return lhs->typeId() < rhs->typeId();
}
if (lhs->getId() != rhs->getId()) {
return lhs->getId() < rhs->getId();
}
return lhs < rhs;
}
};
} // namespace internal
Expand Down
6 changes: 3 additions & 3 deletions src/drt/src/db/obj/frMarker.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ class frMarker : public frFig
odb::Rect getBBox() const override { return bbox_; }
frLayerNum getLayerNum() const { return layerNum_; }

const std::set<frBlockObject*>& getSrcs() const { return srcs_; }
const frOrderedIdSet<frBlockObject*>& getSrcs() const { return srcs_; }

void setSrcs(const std::set<frBlockObject*>& srcs) { srcs_ = srcs; }
void setSrcs(const frOrderedIdSet<frBlockObject*>& srcs) { srcs_ = srcs; }

std::vector<
std::pair<frBlockObject*, std::tuple<frLayerNum, odb::Rect, bool>>>&
Expand Down Expand Up @@ -104,7 +104,7 @@ class frMarker : public frFig
frConstraint* constraint_{nullptr};
odb::Rect bbox_;
frLayerNum layerNum_{0};
std::set<frBlockObject*> srcs_;
frOrderedIdSet<frBlockObject*> srcs_;
std::vector<
std::pair<frBlockObject*, std::tuple<frLayerNum, odb::Rect, bool>>>
victims_; // obj, isFixed
Expand Down
8 changes: 4 additions & 4 deletions src/drt/src/dr/FlexDR.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ class FlexDRWorker
void initMazeCost_planarTerm(const frDesign* design);
void initMazeCost_pin(drNet* net, bool isAddPathCost);
void initMazeCost_fixedObj(const frDesign* design);
void initMazeCost_terms(const std::set<frBlockObject*>& objs,
void initMazeCost_terms(const frOrderedIdSet<frBlockObject*>& objs,
bool isAddPathCost,
bool isSkipVia = false);
void modBlockedEdgesForMacroPin(frInstTerm* instTerm,
Expand Down Expand Up @@ -810,13 +810,13 @@ class FlexDRWorker
void route_queue_init_queue(std::queue<RouteQueueEntry>& rerouteQueue);
void route_queue_update_from_marker(
frMarker* marker,
std::set<frBlockObject*>& uniqueVictims,
std::set<frBlockObject*>& uniqueAggressors,
frOrderedIdSet<frBlockObject*>& uniqueVictims,
frOrderedIdSet<frBlockObject*>& uniqueAggressors,
std::vector<RouteQueueEntry>& checks,
std::vector<RouteQueueEntry>& routes,
frBlockObject* checkingObj);
void getRipUpNetsFromMarker(frMarker* marker,
std::set<drNet*>& nets,
frOrderedIdSet<drNet*>& nets,
frCoord bloatDist = 0);
void route_queue_update_queue(const std::vector<RouteQueueEntry>& checks,
const std::vector<RouteQueueEntry>& routes,
Expand Down
51 changes: 29 additions & 22 deletions src/drt/src/dr/FlexDR_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1533,7 +1533,7 @@ void FlexDRWorker::initNets_boundaryArea()

void FlexDRWorker::initRipUpNetsFromMarkers()
{
std::set<drNet*> ripUpNets;
frOrderedIdSet<drNet*> ripUpNets;
for (auto& marker : markers_) {
const auto bloatDist
= getTech()->getLayer(marker.getLayerNum())->getWidth() * 2;
Expand Down Expand Up @@ -2052,8 +2052,8 @@ void FlexDRWorker::initMazeCost_ap()
void FlexDRWorker::initMazeCost_marker_route_queue_addHistoryCost(
const frMarker& marker)
{
std::set<drNet*> vioNets; // for self-violation, only add cost for one side
// (experiment with self cut spacing)
frOrderedIdSet<drNet*> vioNets; // for self-violation, only add cost for one
// side (experiment with self cut spacing)

const odb::Rect mBox = marker.getBBox();
const auto lNum = marker.getLayerNum();
Expand Down Expand Up @@ -2284,8 +2284,8 @@ void FlexDRWorker::route_queue_addMarkerCost()
void FlexDRWorker::route_queue_init_queue(
std::queue<RouteQueueEntry>& rerouteQueue)
{
std::set<frBlockObject*> uniqueVictims;
std::set<frBlockObject*> uniqueAggressors;
frOrderedIdSet<frBlockObject*> uniqueVictims;
frOrderedIdSet<frBlockObject*> uniqueAggressors;
std::vector<RouteQueueEntry> checks;
std::vector<RouteQueueEntry> routes;

Expand Down Expand Up @@ -2324,7 +2324,7 @@ void FlexDRWorker::route_queue_init_queue(
}
}
int currId = ripupNets.size();
std::set<drNet*> addedNets;
frOrderedIdSet<drNet*> addedNets;
for (auto& marker : markers_) {
for (auto net : ripupNets) {
if (marker.getSrcs().find(net->getFrNet()) != marker.getSrcs().end()) {
Expand Down Expand Up @@ -2399,8 +2399,8 @@ void FlexDRWorker::route_queue_update_queue(
//*****************************************************************************************//
void FlexDRWorker::route_queue_update_from_marker(
frMarker* marker,
std::set<frBlockObject*>& uniqueVictims,
std::set<frBlockObject*>& uniqueAggressors,
frOrderedIdSet<frBlockObject*>& uniqueVictims,
frOrderedIdSet<frBlockObject*>& uniqueAggressors,
std::vector<RouteQueueEntry>& checks,
std::vector<RouteQueueEntry>& routes,
frBlockObject* checkingObj)
Expand Down Expand Up @@ -2430,8 +2430,8 @@ void FlexDRWorker::route_queue_update_from_marker(
std::vector<frBlockObject*> uniqueAggressorOwners; // to maintain order

auto& markerAggressors = marker->getAggressors();
std::set<frNet*> movableAggressorNets;
std::set<frBlockObject*> movableAggressorOwners;
frOrderedIdSet<frNet*> movableAggressorNets;
frOrderedIdSet<frBlockObject*> movableAggressorOwners;

for (auto& aggressorPair : markerAggressors) {
auto& aggressor = aggressorPair.first;
Expand Down Expand Up @@ -2475,7 +2475,7 @@ void FlexDRWorker::route_queue_update_from_marker(
}

if (hasRerouteNet) {
std::set<frBlockObject*> checkDRCOwners;
frOrderedIdSet<frBlockObject*> checkDRCOwners;
for (auto& src : marker->getSrcs()) {
if (movableAggressorOwners.find(src) == movableAggressorOwners.end()) {
if (src) {
Expand All @@ -2493,7 +2493,7 @@ void FlexDRWorker::route_queue_update_from_marker(
}
}
} else {
std::set<frBlockObject*> owners, otherOwners, routeOwners;
frOrderedIdSet<frBlockObject*> owners, otherOwners, routeOwners;
auto& srcs = marker->getSrcs();
for (auto& src : srcs) {
if (src) {
Expand Down Expand Up @@ -2525,7 +2525,7 @@ void FlexDRWorker::route_queue_update_from_marker(
}
}
if (hasRerouteNet) {
std::set<frBlockObject*> checkDRCOwners;
frOrderedIdSet<frBlockObject*> checkDRCOwners;
for (auto& src : marker->getSrcs()) {
if (routeOwners.find(src) == routeOwners.end()) {
if (src) {
Expand Down Expand Up @@ -2585,7 +2585,7 @@ void FlexDRWorker::route_queue_update_from_marker(
}

void FlexDRWorker::getRipUpNetsFromMarker(frMarker* marker,
std::set<drNet*>& nets,
frOrderedIdSet<drNet*>& nets,
const frCoord bloatDist)
{
// if shapes don't overlap routeBox, ignore violation
Expand Down Expand Up @@ -2633,8 +2633,8 @@ void FlexDRWorker::route_queue_update_queue(
std::queue<RouteQueueEntry>& rerouteQueue,
frBlockObject* checkingObj)
{
std::set<frBlockObject*> uniqueVictims;
std::set<frBlockObject*> uniqueAggressors;
frOrderedIdSet<frBlockObject*> uniqueVictims;
frOrderedIdSet<frBlockObject*> uniqueAggressors;
std::vector<RouteQueueEntry> checks;
std::vector<RouteQueueEntry> routes;
if (checkingObj != nullptr
Expand Down Expand Up @@ -2681,7 +2681,7 @@ void FlexDRWorker::initMazeCost_fixedObj(const frDesign* design)
{
frRegionQuery::Objects<frBlockObject> result;
frMIdx zIdx = 0;
std::map<frNet*, std::set<frBlockObject*>> frNet2Terms;
frOrderedIdMap<frNet*, frOrderedIdSet<frBlockObject*>> frNet2Terms;
for (auto layerNum = getTech()->getBottomLayerNum();
layerNum <= getTech()->getTopLayerNum();
++layerNum) {
Expand Down Expand Up @@ -2731,11 +2731,17 @@ void FlexDRWorker::initMazeCost_fixedObj(const frDesign* design)
for (auto& [box, obj] : result) {
switch (obj->typeId()) {
case frcBTerm: { // term no bloat
frNet2Terms[static_cast<frBTerm*>(obj)->getNet()].insert(obj);
auto* net = static_cast<frBTerm*>(obj)->getNet();
if (net != nullptr) {
frNet2Terms[net].insert(obj);
}
break;
}
case frcInstTerm: {
frNet2Terms[static_cast<frInstTerm*>(obj)->getNet()].insert(obj);
auto* net = static_cast<frInstTerm*>(obj)->getNet();
if (net != nullptr) {
frNet2Terms[net].insert(obj);
}
if (isRoutingLayer) {
// unblock planar edge for obs over pin, ap will unblock via edge
// for legal pin access
Expand Down Expand Up @@ -2832,9 +2838,10 @@ void FlexDRWorker::modBlockedEdgesForMacroPin(frInstTerm* instTerm,
}
}

void FlexDRWorker::initMazeCost_terms(const std::set<frBlockObject*>& objs,
const bool isAddPathCost,
const bool isSkipVia)
void FlexDRWorker::initMazeCost_terms(
const frOrderedIdSet<frBlockObject*>& objs,
const bool isAddPathCost,
const bool isSkipVia)
{
for (auto& obj : objs) {
if (obj->typeId() == frcBTerm) {
Expand Down
1 change: 0 additions & 1 deletion src/drt/src/dr/FlexDR_maze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3215,7 +3215,6 @@ bool FlexDRWorker::routeNet(drNet* net, std::vector<FlexMazeIdx>& paths)

// Verify if net has jumpers
const bool route_with_jumpers = net->getFrNet()->hasJumpers();

if (net->getPins().size() <= 1) {
return true;
}
Expand Down
26 changes: 25 additions & 1 deletion src/drt/src/dr/FlexWavefront.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,31 @@ class FlexWavefrontGrid
if (zIdx_ != b.zIdx_) {
return zIdx_ < b.zIdx_; // prefer upper layer
}
return pathCost_ < b.pathCost_; // prefer larger pathcost, DFS-style
if (pathCost_ != b.pathCost_) {
return pathCost_ < b.pathCost_; // prefer larger pathcost, DFS-style
}
if (xIdx_ != b.xIdx_) {
return xIdx_ > b.xIdx_; // prefer smaller x for stable tie-breaking
}
if (yIdx_ != b.yIdx_) {
return yIdx_ > b.yIdx_; // prefer smaller y for stable tie-breaking
}
if (getLastDir() != b.getLastDir()) {
return getLastDir() > b.getLastDir();
}
if (prevViaUp_ != b.prevViaUp_) {
return prevViaUp_ > b.prevViaUp_;
}
if (tLength_ != b.tLength_) {
return tLength_ > b.tLength_;
}
if (vLengthX_ != b.vLengthX_) {
return vLengthX_ > b.vLengthX_;
}
if (vLengthY_ != b.vLengthY_) {
return vLengthY_ > b.vLengthY_;
}
return backTraceBuffer_.to_ulong() > b.backTraceBuffer_.to_ulong();
}
// getters
frMIdx x() const { return xIdx_; }
Expand Down
Loading