Skip to content

Commit a790073

Browse files
committed
Merge branch 'master' of github.com:The-OpenROAD-Project-private/OpenROAD into grt-estimate-resistance
2 parents 6193a4a + 43f41e4 commit a790073

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1832
-291
lines changed

src/OpenRoad.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ void OpenRoad::read3Dbx(const std::string& filename)
495495
{
496496
odb::ThreeDBlox parser(logger_, db_, sta_);
497497
parser.readDbx(filename);
498+
parser.check();
498499
}
499500

500501
void OpenRoad::read3DBloxBMap(const std::string& filename)

src/OpenRoad.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ proc place_inst { args } {
430430
}
431431

432432
if { [info exists keys(-name)] } {
433-
set inst_name [lindex $keys(-name) 0]
433+
set inst_name $keys(-name)
434434
} else {
435435
utl::error ORD 57 "-name is a required argument to the place_cell command."
436436
}

src/cts/src/TechChar.cpp

Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -942,18 +942,23 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
942942
// can be placed and...
943943
//...the number of topologies (combinations of buffers, considering only 1
944944
// drive) that can exist.
945+
945946
const unsigned numberOfNodes
946947
= setupWirelength / options_->getWireSegmentUnit();
947948
const unsigned numberOfTopologies = 1 << numberOfNodes;
948949
std::vector<SolutionData> topologiesVector;
949950
odb::dbNet* net = nullptr;
950951
// clang-format off
951-
debugPrint(logger_, CTS, "tech char", 1, "createPatterns WL:{} #nodes:{}"
952-
"#topo:{}", setupWirelength, numberOfNodes, numberOfTopologies);
952+
debugPrint(logger_, CTS, "tech char", 1, "*createPatterns for #nodes = {}"
953+
" #topologies = {}", setupWirelength, numberOfNodes, numberOfTopologies);
953954
// clang-format on
954955
// For each possible topology...
955956
for (unsigned solutionCounterInt = 0; solutionCounterInt < numberOfTopologies;
956957
solutionCounterInt++) {
958+
debugPrint(
959+
logger_, CTS, "tech char", 1, "**topology {}", solutionCounterInt + 1);
960+
std::stringstream tmp;
961+
tmp << "***IN ";
957962
// Creates a bitset that represents the buffer locations.
958963
const std::bitset<5> solutionCounter(solutionCounterInt);
959964
int wireCounter = 0;
@@ -983,20 +988,24 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
983988
// Not a buffer, only a wire segment.
984989
nodesWithoutBuf++;
985990
// clang-format off
986-
debugPrint(logger_, CTS, "tech char", 1, " wire at node:{} topo:{}",
991+
debugPrint(logger_, CTS, "tech char", 2, "***wire at node : {}",
987992
nodeIndex, solutionCounterInt);
988993
// clang-format on
989994
} else {
990995
// Buffer, need to create the instance and a new net.
991996
nodesWithoutBuf++;
997+
for (int i = 0; i < nodesWithoutBuf - 1; i++) {
998+
tmp << "-- ";
999+
}
1000+
tmp << "-> ";
9921001
// Creates a new buffer instance.
9931002
const std::string bufName = fmt::format("buf_{}_{}_{}",
9941003
setupWirelength,
9951004
solutionCounter.to_string(),
9961005
wireCounter);
9971006
// clang-format off
998-
debugPrint(logger_, CTS, "tech char", 1, " buffer {} at node:{} "
999-
"topo:{}", bufName, nodeIndex, solutionCounterInt);
1007+
debugPrint(logger_, CTS, "tech char", 2, "***buffer {} at node : {}"
1008+
, bufName, nodeIndex, solutionCounterInt);
10001009
// clang-format on
10011010
odb::dbInst* bufInstance
10021011
= odb::dbInst::create(charBlock_, charBuf_, bufName.c_str());
@@ -1020,11 +1029,6 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
10201029
// Updates the topology wih the new instance and the current topology
10211030
// (as a vector of strings).
10221031
topology.instVector.push_back(bufInstance);
1023-
// clang-format off
1024-
debugPrint(logger_, CTS, "tech char", 1, " topo instVector size:{} "
1025-
"node:{} topo:{}", topology.instVector.size(), nodeIndex,
1026-
solutionCounterInt);
1027-
// clang-format on
10281032
topology.topologyDescriptor.push_back(
10291033
std::to_string(nodesWithoutBuf * options_->getWireSegmentUnit()));
10301034
topology.topologyDescriptor.push_back(charBuf_->getName());
@@ -1041,6 +1045,11 @@ std::vector<TechChar::SolutionData> TechChar::createPatterns(
10411045
odb::dbBPin* outPortPin = odb::dbBPin::create(outPort);
10421046
// Updates the topology with the output port, old new, possible instances
10431047
// and other attributes.
1048+
for (int i = 0; i < nodesWithoutBuf; i++) {
1049+
tmp << "-- ";
1050+
}
1051+
tmp << "OUT";
1052+
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
10441053
topology.outPort = outPortPin;
10451054
if (isPureWire) {
10461055
topology.instVector.push_back(nullptr);
@@ -1194,7 +1203,7 @@ TechChar::ResultData TechChar::computeTopologyResults(
11941203
const float pinArrival = openStaChar_->vertexArrival(
11951204
outPinVert, sta::RiseFall::fall(), charPathAnalysis_);
11961205
results.pinArrival = pinArrival;
1197-
// Computations for output slew.
1206+
// Computations for output slew. Avg of rise and fall slew.
11981207
const float pinRise = openStaChar_->vertexSlew(
11991208
outPinVert, sta::RiseFall::rise(), sta::MinMax::max());
12001209
const float pinFall = openStaChar_->vertexSlew(
@@ -1333,7 +1342,7 @@ void TechChar::updateBufferTopologies(TechChar::SolutionData& solution)
13331342
odb::dbInst* inst = solution.instVector[nodeIndex];
13341343
inst->swapMaster(newMaster);
13351344
// clang-format off
1336-
debugPrint(logger_, CTS, "tech char", 1, "**updateBufferTopologies swap "
1345+
debugPrint(logger_, CTS, "tech char", 1, "***updateBufferTopologies swap "
13371346
"from {} to {}, index:{}", oldMaster->getName(),
13381347
newMaster->getName(), nodeIndex);
13391348
// clang-format on
@@ -1344,6 +1353,10 @@ void TechChar::updateBufferTopologies(TechChar::SolutionData& solution)
13441353

13451354
std::vector<size_t> TechChar::getCurrConfig(const SolutionData& solution)
13461355
{
1356+
if (solution.isPureWire) {
1357+
debugPrint(logger_, CTS, "tech char", 1, "**currConfig is a pure wire");
1358+
return {};
1359+
}
13471360
std::vector<size_t> config;
13481361
for (auto inst : solution.instVector) {
13491362
size_t masterID = cellNameToID(inst->getMaster()->getName());
@@ -1352,11 +1365,11 @@ std::vector<size_t> TechChar::getCurrConfig(const SolutionData& solution)
13521365

13531366
if (logger_->debugCheck(CTS, "tech char", 1)) {
13541367
std::stringstream tmp;
1355-
tmp << "currConfig: ";
1368+
tmp << "**currConfig: ";
13561369
for (unsigned i : config) {
13571370
tmp << i << " ";
13581371
}
1359-
logger_->report(tmp.str());
1372+
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
13601373
}
13611374
return config;
13621375
}
@@ -1368,7 +1381,7 @@ size_t TechChar::cellNameToID(const std::string& masterName)
13681381
return std::distance(masterNames_.begin(), masterIter);
13691382
}
13701383

1371-
// Find a buffer config that is monotonic from current buffer config
1384+
// Find a buffer config that is monotonic from current buffer config.
13721385
std::vector<size_t> TechChar::getNextConfig(
13731386
const std::vector<size_t>& currConfig)
13741387
{
@@ -1392,11 +1405,11 @@ std::vector<size_t> TechChar::getNextConfig(
13921405

13931406
if (logger_->debugCheck(CTS, "tech char", 1)) {
13941407
std::stringstream tmp;
1395-
tmp << "nextConfig: ";
1408+
tmp << "**nextConfig: ";
13961409
for (unsigned i : nextConfig) {
13971410
tmp << i << " ";
13981411
}
1399-
logger_->report(tmp.str());
1412+
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
14001413
}
14011414

14021415
return nextConfig;
@@ -1426,15 +1439,15 @@ void TechChar::swapTopologyBuffer(SolutionData& solution,
14261439
topologyIndex++) {
14271440
const std::string topologyS = solution.topologyDescriptor[topologyIndex];
14281441
// clang-format off
1429-
debugPrint(logger_, CTS, "tech char", 1, "**topo:{} topoIdx:{}",
1442+
debugPrint(logger_, CTS, "tech char", 1, "***topo:{} topoIdx:{}",
14301443
topologyS, topologyIndex);
14311444
// clang-format on
14321445
if (!(std::find(masterNames_.begin(), masterNames_.end(), topologyS)
14331446
== masterNames_.end())) {
14341447
if (topologyCounter == nodeIndex) {
14351448
solution.topologyDescriptor[topologyIndex] = newMasterName;
14361449
// clang-format off
1437-
debugPrint(logger_, CTS, "tech char", 1, "**soln topo descript at "
1450+
debugPrint(logger_, CTS, "tech char", 1, "***soln topo descript at "
14381451
"{} set to {}", topologyIndex, newMasterName);
14391452
// clang-format on
14401453
break;
@@ -1561,6 +1574,8 @@ void TechChar::create()
15611574
int64_t topologiesCreated = 0;
15621575
for (unsigned setupWirelength : wirelengthsToTest_) {
15631576
// Creates the topologies for the current wirelength.
1577+
debugPrint(
1578+
logger_, CTS, "tech char", 1, "Wirelength = {}", setupWirelength);
15641579
std::vector<SolutionData> topologiesVector
15651580
= createPatterns(setupWirelength);
15661581
// Creates an OpenSTA instance.
@@ -1572,9 +1587,8 @@ void TechChar::create()
15721587
int topoIndex = 0;
15731588
for (SolutionData solution : topologiesVector) {
15741589
// clang-format off
1575-
debugPrint(logger_, CTS, "tech char", 1, "create WL:{} of {}, "
1576-
"topo:{} of {}", setupWirelength, wirelengthsToTest_.size(),
1577-
topoIndex, topologiesVector.size());
1590+
debugPrint(logger_, CTS, "tech char", 1, "*genrate combinations for "
1591+
"topology: {} of {}", topoIndex + 1, topologiesVector.size());
15781592
// clang-format on
15791593
topoIndex++;
15801594
// Gets the input and output port (as terms, pins and vertices).
@@ -1610,15 +1624,15 @@ void TechChar::create()
16101624
r1,
16111625
c1,
16121626
piExists);
1627+
1628+
// clang-format off
1629+
debugPrint(logger_, CTS, "tech char", 1, "*# bufs = {}; "
1630+
"# nodes with buf = {}",
1631+
masterNames_.size(), solution.instVector.size());
1632+
// clang-format on
16131633
// For each possible buffer combination (different sizes).
16141634
unsigned buffersUpdate
16151635
= getBufferingCombo(masterNames_.size(), solution.instVector.size());
1616-
// clang-format off
1617-
debugPrint(logger_, CTS, "tech char", 1, "create #bufs={} "
1618-
"#soln.instVector.size={}, #bufUpdate={}, #topo={}",
1619-
masterNames_.size(), solution.instVector.size(),
1620-
buffersUpdate, topologiesCreated);
1621-
// clang-format on
16221636

16231637
if (buffersUpdate == 0) {
16241638
continue;
@@ -1737,14 +1751,15 @@ void TechChar::create()
17371751
unsigned TechChar::getBufferingCombo(size_t numBuffers, size_t numNodes)
17381752
{
17391753
// check if this has been computed already
1740-
std::stringstream tmp;
17411754
std::pair iPair(numBuffers, numNodes);
17421755
auto iter = bufferingComboTable_.find(iPair);
17431756
if (iter != bufferingComboTable_.end()) {
1744-
if (logger_->debugCheck(CTS, "tech char", 1)) {
1745-
tmp << "Monotonic entries (hashed): " << iter->second << '\n';
1746-
logger_->report(tmp.str());
1747-
}
1757+
debugPrint(logger_,
1758+
CTS,
1759+
"tech char",
1760+
1,
1761+
"**Monotonic entries are already hashed: {}",
1762+
iter->second);
17481763
return iter->second;
17491764
}
17501765

@@ -1762,6 +1777,8 @@ unsigned TechChar::getBufferingCombo(size_t numBuffers, size_t numNodes)
17621777

17631778
unsigned numMonotonic = 0;
17641779
for (const auto& row : matrix) {
1780+
std::stringstream tmp;
1781+
tmp << "**";
17651782
for (size_t val : row) {
17661783
if (logger_->debugCheck(CTS, "tech char", 1)) {
17671784
tmp << val << " ";
@@ -1773,15 +1790,10 @@ unsigned TechChar::getBufferingCombo(size_t numBuffers, size_t numNodes)
17731790
}
17741791
numMonotonic++;
17751792
}
1776-
if (logger_->debugCheck(CTS, "tech char", 1)) {
1777-
logger_->report(tmp.str());
1778-
}
1779-
}
1780-
if (logger_->debugCheck(CTS, "tech char", 1)) {
1781-
tmp << "Monotonic entries: " << numMonotonic;
1782-
logger_->report(tmp.str());
1793+
debugPrint(logger_, CTS, "tech char", 1, tmp.str());
17831794
}
1784-
1795+
debugPrint(
1796+
logger_, CTS, "tech char", 1, "**Monotonic entries: {}", numMonotonic);
17851797
// insert new result into hash table
17861798
bufferingComboTable_[iPair] = numMonotonic;
17871799
return numMonotonic;

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,26 @@ class dbNetwork : public ConcreteNetwork
251251
Instance* instance(const Pin* pin) const override;
252252
Net* net(const Pin* pin) const override;
253253
void net(const Pin* pin, dbNet*& db_net, dbModNet*& db_modnet) const;
254+
255+
///
256+
/// Get a dbNet connected to the input pin.
257+
/// - If both dbNet and dbModNet are connected to the input pin,
258+
/// this function returns the dbNet.
259+
/// - NOTE: If only dbModNet is connected to the input pin, this
260+
/// function returns nullptr. If you need to get the dbNet corresponding to
261+
/// the dbModNet, use findFlatDbNet() instead.
262+
///
254263
dbNet* flatNet(const Pin* pin) const;
264+
265+
///
266+
/// Get a dbModNet connected to the input pin.
267+
/// - If both dbNet and dbModNet are connected to the input pin,
268+
/// this function returns the dbModNet.
269+
/// - If only dbNet is connected to the input pin, this function returns
270+
/// nullptr.
271+
///
255272
dbModNet* hierNet(const Pin* pin) const;
273+
256274
dbITerm* flatPin(const Pin* pin) const;
257275
dbModITerm* hierPin(const Pin* pin) const;
258276
dbBlock* getBlockOf(const Pin* pin) const;

src/grt/src/GlobalRouter.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ GlobalRouter::GlobalRouter(utl::Logger* logger,
8080
grid_origin_(0, 0),
8181
groute_renderer_(nullptr),
8282
grid_(new Grid),
83+
is_incremental_(false),
8384
adjustment_(0.0),
8485
congestion_report_iter_step_(0),
8586
allow_congestion_(false),
@@ -2331,8 +2332,7 @@ void GlobalRouter::loadGuidesFromDB()
23312332
void GlobalRouter::ensurePinsPositions(odb::dbNet* db_net)
23322333
{
23332334
std::string pins_not_covered;
2334-
netIsCovered(db_net, pins_not_covered);
2335-
if (!pins_not_covered.empty()) {
2335+
if (!netIsCovered(db_net, pins_not_covered)) {
23362336
Net* net = db_net_map_[db_net];
23372337
for (Pin& pin : net->getPins()) {
23382338
if (pins_not_covered.find(pin.getName()) != std::string::npos) {
@@ -2487,6 +2487,12 @@ void GlobalRouter::computeGCellGridPatternFromGuides(
24872487

24882488
grid_->setXGrids(x_grids);
24892489
grid_->setYGrids(y_grids);
2490+
2491+
// update fastroute grid info with grid pattern calculated from guides
2492+
fastroute_->setTileSize(std::min(tile_size_x, tile_size_y));
2493+
fastroute_->setGridsAndLayers(
2494+
grid_->getXGrids(), grid_->getYGrids(), grid_->getNumLayers());
2495+
fastroute_->init3DEdges();
24902496
}
24912497

24922498
void GlobalRouter::fillTileSizeMaps(
@@ -5681,6 +5687,8 @@ std::vector<Net*> GlobalRouter::updateDirtyRoutes(bool save_guides)
56815687
}
56825688
}
56835689

5690+
fastroute_->setIncrementalGrt(false);
5691+
56845692
return dirty_nets;
56855693
}
56865694

@@ -5720,6 +5728,7 @@ void GlobalRouter::initFastRouteIncr(std::vector<Net*>& nets)
57205728
{
57215729
initNetlist(nets);
57225730
fastroute_->initAuxVar();
5731+
fastroute_->setIncrementalGrt(true);
57235732
}
57245733

57255734
GRouteDbCbk::GRouteDbCbk(GlobalRouter* grouter) : grouter_(grouter)

src/grt/src/RepairAntennas.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ RepairAntennas::RepairAntennas(GlobalRouter* grouter,
4141
unique_diode_index_(1),
4242
illegal_diode_placement_count_(0),
4343
has_new_violations_(false),
44-
routing_source_(RoutingSource::None)
44+
routing_source_(RoutingSource::None),
45+
tile_size_(0),
46+
jumper_size_(0),
47+
smaller_seg_size_(0)
4548
{
4649
block_ = db_->getChip()->getBlock();
4750
while (block_->findInst(

src/grt/src/Rudy.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ Rudy::Rudy(odb::dbBlock* block, grt::GlobalRouter* grouter)
4747
}
4848
pitch_terms += 1.0 / pitch;
4949
}
50-
wire_width_ = (1 / pitch_terms) * 1.25; // = harm. mean / num_routing_layers
50+
51+
if (pitch_terms != 0) {
52+
wire_width_
53+
= (1 / pitch_terms) * 1.25; // = harm. mean / num_routing_layers
54+
}
5155

5256
int x_grids, y_grids;
5357
grouter_->getGridSize(x_grids, y_grids);

src/grt/src/cugr/src/GridGraph.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@ AccessPointSet GridGraph::selectAccessPoints(const GRNet* net) const
405405
if (bestAccessDist.first == 0) {
406406
logger_->warn(utl::GRT, 274, "pin is hard to access.");
407407
}
408+
409+
if (bestIndex == -1) {
410+
logger_->error(utl::GRT,
411+
283,
412+
"No preferred access point found for pin on net {}.",
413+
net->getName());
414+
}
415+
408416
const PointT selectedPoint = accessPoints[bestIndex];
409417
const AccessPoint ap{selectedPoint, {}};
410418
auto it = selected_access_points.emplace(ap).first;

0 commit comments

Comments
 (0)