Skip to content

Commit 97bd1d3

Browse files
author
osamahammad21
committed
Merge remote-tracking branch 'origin/master' into odb-new-unfolded-structuree
Signed-off-by: osamahammad21 <osama@precisioninno.com>
2 parents 01900ec + af39e7f commit 97bd1d3

51 files changed

Lines changed: 633 additions & 421 deletions

Some content is hidden

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

etc/DependencyInstaller.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,19 +865,35 @@ _install_bazel() {
865865
chmod +x bazelisk
866866
_execute "Installing bazelisk..." mv bazelisk "${bazel_prefix}/bin/bazelisk"
867867
)
868+
if _command_exists "apt-get"; then
869+
_execute "Installing bazel required libraries..." \
870+
apt-get -y install --no-install-recommends \
871+
libc6-dev libxml2 libtinfo6 zlib1g libstdc++6
872+
elif _command_exists "yum"; then
873+
_execute "Installing bazel required libraries..." \
874+
yum install -y \
875+
glibc-devel libxml2 ncurses-libs zlib libstdc++
876+
fi
868877
if [[ "${NO_GUI}" != "yes" ]]; then
869878
# Install xcb libraries needed for GUI support with Bazel builds
870879
if _command_exists "apt-get"; then
871880
_execute "Installing xcb libraries for GUI support..." \
872881
apt-get -y install --no-install-recommends \
873882
libxcb1-dev libxcb-util-dev libxcb-icccm4-dev libxcb-image0-dev \
874883
libxcb-keysyms1-dev libxcb-randr0-dev libxcb-render-util0-dev \
875-
libxcb-xinerama0-dev libxcb-xkb-dev
884+
libxcb-xinerama0-dev libxcb-xkb-dev \
885+
libx11-xcb1 libx11-6 libsm6 libice6 \
886+
libxcb-cursor0 libxcb-shape0 libxcb-sync1 libxcb-xfixes0 \
887+
libdbus-1-3 libfontconfig1 libxkbcommon0 libxkbcommon-x11-0
876888
elif _command_exists "yum"; then
877889
_execute "Installing xcb libraries for GUI support..." \
878890
yum install -y \
879891
libxcb-devel xcb-util-devel xcb-util-image-devel \
880-
xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel
892+
xcb-util-keysyms-devel xcb-util-renderutil-devel xcb-util-wm-devel \
893+
libX11-xcb libX11 libSM libICE \
894+
xcb-util-cursor libxcb \
895+
dbus-libs fontconfig \
896+
libxkbcommon libxkbcommon-x11
881897
fi
882898
fi
883899
fi

src/dbSta/src/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ target_include_directories(dbSta_lib
1717
PUBLIC
1818
../include
1919
${PROJECT_SOURCE_DIR}/include
20-
PRIVATE
21-
# Needed for search/Levelize.hh and the unprefixed transitive
22-
# OpenSTA headers it includes (e.g. Graph.hh) which are not part of
23-
# OpenSTA's public include.
24-
${OPENSTA_HOME}
25-
${OPENSTA_HOME}/include/sta
2620
)
2721

2822

src/dbSta/src/IpChecker.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ void IpChecker::checkPinMinDimensions(odb::dbMaster* master)
660660
void IpChecker::checkPinMinArea(odb::dbMaster* master)
661661
{
662662
std::string master_name = master->getName();
663-
int dbu_per_micron = db_->getTech()->getDbUnitsPerMicron();
664663

665664
for (odb::dbMTerm* mterm : master->getMTerms()) {
666665
for (odb::dbMPin* mpin : mterm->getMPins()) {
@@ -670,10 +669,8 @@ void IpChecker::checkPinMinArea(odb::dbMaster* master)
670669
continue;
671670
}
672671

673-
// getArea() returns microns^2, convert to DBU^2
674-
double min_area_um2 = layer->getArea();
675-
int64_t min_area_dbu2 = static_cast<int64_t>(
676-
min_area_um2 * dbu_per_micron * dbu_per_micron);
672+
// getArea() returns DBU^2
673+
const int64_t min_area_dbu2 = layer->getArea();
677674

678675
odb::Rect rect = box->getBox();
679676
int64_t shape_area

src/dbSta/src/dbSta.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@
3737
#include "odb/dbBlockCallBackObj.h"
3838
#include "odb/dbObject.h"
3939
#include "odb/dbTypes.h"
40-
#include "search/Levelize.hh"
4140
#include "sta/ArcDelayCalc.hh"
4241
#include "sta/Clock.hh"
4342
#include "sta/Delay.hh"
4443
#include "sta/EquivCells.hh"
4544
#include "sta/Graph.hh"
4645
#include "sta/GraphCmp.hh"
4746
#include "sta/GraphDelayCalc.hh"
47+
#include "sta/LevelizeObserver.hh"
4848
#include "sta/Liberty.hh"
4949
#include "sta/MinMax.hh"
5050
#include "sta/Mode.hh"
@@ -297,24 +297,23 @@ void dbSta::makeSdcNetwork()
297297
sdc_network_ = new dbSdcNetwork(network_);
298298
}
299299

300-
// Levelize::setObserver takes ownership and deletes the prior observer,
301-
// so this composite must replicate the StaLevelizeObserver behavior that
302-
// Sta::makeObservers installs (forwarding to Search and GraphDelayCalc)
303-
// in addition to invalidating dbSta's cache.
304-
class DbStaLevelizeObserver : public LevelizeObserver
300+
// Extend the default StaLevelizeObserver (Search + GraphDelayCalc forwarding)
301+
// to also invalidate dbSta's driver-vertex cache.
302+
class DbStaLevelizeObserver : public StaLevelizeObserver
305303
{
306304
public:
307-
explicit DbStaLevelizeObserver(dbSta* sta) : sta_(sta) {}
305+
DbStaLevelizeObserver(dbSta* sta, Search* search, GraphDelayCalc* gdc)
306+
: StaLevelizeObserver(search, gdc), sta_(sta)
307+
{
308+
}
308309
void levelsChangedBefore() override
309310
{
310-
sta_->search()->levelsChangedBefore();
311-
sta_->graphDelayCalc()->levelsChangedBefore();
311+
StaLevelizeObserver::levelsChangedBefore();
312312
sta_->invalidateLevelizedDrvrVertices();
313313
}
314314
void levelChangedBefore(Vertex* vertex) override
315315
{
316-
sta_->search()->levelChangedBefore(vertex);
317-
sta_->graphDelayCalc()->levelChangedBefore(vertex);
316+
StaLevelizeObserver::levelChangedBefore(vertex);
318317
sta_->invalidateLevelizedDrvrVertices();
319318
}
320319

@@ -325,7 +324,8 @@ class DbStaLevelizeObserver : public LevelizeObserver
325324
void dbSta::makeObservers()
326325
{
327326
Sta::makeObservers();
328-
levelize_->setObserver(new DbStaLevelizeObserver(this));
327+
setLevelizeObserver(
328+
new DbStaLevelizeObserver(this, search_, graph_delay_calc_));
329329
}
330330

331331
void dbSta::invalidateLevelizedDrvrVertices()

src/drt/src/io/io.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2167,8 +2167,7 @@ void io::Parser::addRoutingLayer(odb::dbTechLayer* layer)
21672167
setRoutingLayerProperties(layer, tmpLayer);
21682168
// read minArea rule
21692169
if (layer->hasArea()) {
2170-
frCoord minArea = frCoord(round(layer->getArea() * getTech()->getDBUPerUU()
2171-
* getTech()->getDBUPerUU()));
2170+
frCoord minArea = frCoord(layer->getArea());
21722171
std::unique_ptr<frConstraint> uCon
21732172
= std::make_unique<frAreaConstraint>(minArea);
21742173
auto rptr = static_cast<frAreaConstraint*>(uCon.get());
@@ -2226,7 +2225,7 @@ void io::Parser::addRoutingLayer(odb::dbTechLayer* layer)
22262225
"minEnclosedArea constraint with width is not supported, skipped.");
22272226
continue;
22282227
}
2229-
frUInt4 _minEnclosedArea;
2228+
int64_t _minEnclosedArea;
22302229
rule->getEnclosure(_minEnclosedArea);
22312230
frCoord minEnclosedArea = _minEnclosedArea;
22322231
auto minEnclosedAreaConstraint

src/drt/src/ta/FlexTA_assign.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,12 @@ void FlexTAWorker::modMinSpacingCostPlanar(const odb::Rect& box,
8383
lNum,
8484
idx1,
8585
idx2);
86-
87-
odb::Rect box2(-halfwidth2, -halfwidth2, halfwidth2, halfwidth2);
8886
frCoord dx, dy;
8987
auto& trackLocs = getTrackLocs(lNum);
9088
auto& workerRegionQuery = getWorkerRegionQuery();
9189
for (int i = idx1; i <= idx2; i++) {
9290
auto trackLoc = trackLocs[i];
91+
odb::Rect box2(-halfwidth2, -halfwidth2, halfwidth2, halfwidth2);
9392
odb::dbTransform xform(odb::Point(boxLeft, trackLoc));
9493
xform.apply(box2);
9594
box2boxDistSquare(box1, box2, dx, dy);

src/drt/test/fixture.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,17 @@ void Fixture::makeSpacingConstraint(frLayerNum layer_num)
286286
tech->addUConstraint(std::move(con));
287287
}
288288

289+
void Fixture::makeSimpleSpacingConstraint(frLayerNum layer_num,
290+
const frCoord spacing_value)
291+
{
292+
auto con = std::make_unique<frSpacingConstraint>(spacing_value);
293+
294+
frTechObject* tech = design->getTech();
295+
frLayer* layer = tech->getLayer(layer_num);
296+
layer->setMinSpacing(con.get());
297+
tech->addUConstraint(std::move(con));
298+
}
299+
289300
void Fixture::makeMinStepConstraint(frLayerNum layer_num)
290301
{
291302
auto con = std::make_unique<frMinStepConstraint>();

src/drt/test/fixture.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ class Fixture : public ::testing::Test
7676

7777
void makeSpacingConstraint(frLayerNum layer_num);
7878

79+
void makeSimpleSpacingConstraint(frLayerNum layer_num, frCoord spacing_value);
80+
7981
void makeMetalWidthViaMap(frLayerNum layer_num,
8082
odb::dbMetalWidthViaMap* rule);
8183

src/drt/test/taTest.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,21 @@ struct TAFixture : public Fixture
8484
initRegionQuery();
8585
design->getRegionQuery()->initGuide();
8686
}
87+
88+
void runHorizontalInitTA()
89+
{
90+
FlexTAWorker worker(design.get(),
91+
logger.get(),
92+
router_cfg.get(),
93+
/*save_updates=*/false);
94+
worker.setRouteBox(design->getTopBlock()->getDieBox());
95+
worker.setExtBox(design->getTopBlock()->getDieBox());
96+
worker.setDir(odb::dbTechLayerDir::HORIZONTAL);
97+
worker.setTAIter(0);
98+
worker.main_mt();
99+
worker.end();
100+
EXPECT_EQ(worker.getNumAssigned(), 2);
101+
}
87102
};
88103

89104
// A single guide on a horizontal routing layer should be assigned to one of
@@ -139,4 +154,30 @@ TEST_F(TAFixture, single_horizontal_iroute_assigned)
139154
EXPECT_EQ(bp.y(), expected_tracks[2]);
140155
}
141156

157+
TEST_F(TAFixture, two_parallel_no_coupling)
158+
{
159+
setDieArea(0, 0, 21000, 2000);
160+
createGCellPattern(1000, 1000);
161+
addTrackPattern(/*layer_num=*/2,
162+
/*is_horizontal_pattern=*/false,
163+
/*start_coord=*/100,
164+
/*num_tracks=*/19,
165+
/*spacing=*/100);
166+
makeSimpleSpacingConstraint(2, 100);
167+
168+
frGuide* g1
169+
= makeGuide(makeNet("n1"), /*layer_num=*/2, {500, 500}, {5500, 500});
170+
frGuide* g2
171+
= makeGuide(makeNet("n2"), /*layer_num=*/2, {500, 500}, {5500, 500});
172+
initTAQueries();
173+
174+
runHorizontalInitTA();
175+
const auto* path_seg1
176+
= static_cast<frPathSeg*>(g1->getRoutes().front().get());
177+
const auto* path_seg2
178+
= static_cast<frPathSeg*>(g2->getRoutes().front().get());
179+
EXPECT_EQ(path_seg1->getPoints().first.y(), 500);
180+
EXPECT_EQ(path_seg2->getPoints().first.y(), 700);
181+
}
182+
142183
} // namespace drt

src/grt/src/cugr/src/Layers.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,8 @@ MetalLayer::MetalLayer(odb::dbTechLayer* tech_layer,
2626

2727
// Design rules not parsed thoroughly
2828
// Min area
29-
const int database_unit = tech_layer->getTech()->getDbUnitsPerMicron();
30-
const int min_area = tech_layer->getArea() * database_unit * database_unit;
31-
min_length_ = std::max(min_area / width_ - width_, 0);
29+
const int64_t min_area = tech_layer->getArea();
30+
min_length_ = std::max(static_cast<int>(min_area / width_) - width_, 0);
3231

3332
// Parallel run spacing
3433
std::vector<std::vector<uint32_t>> spacing_table;

0 commit comments

Comments
 (0)