Skip to content

Commit 94d3e38

Browse files
committed
Merge branch 'master' into mpl-new-blockages
2 parents b953cc8 + 76688e7 commit 94d3e38

118 files changed

Lines changed: 1239 additions & 806 deletions

File tree

Some content is hidden

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

Jenkinsfile

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,28 +217,33 @@ def bazelTest = {
217217
checkout scm;
218218
sh label: 'Setup Docker Image', script: 'docker build -f docker/Dockerfile.bazel -t openroad/bazel-ci .';
219219
}
220-
withDockerContainer(args: '-u root -v /var/run/docker.sock:/var/run/docker.sock', image: 'openroad/bazel-ci:latest') {
221-
stage('bazelisk test ...') {
222-
withCredentials([string(credentialsId: 'bazel-auth-token-b64', variable: 'BAZEL_AUTH_TOKEN_B64')]) {
223-
timeout(time: 120, unit: 'MINUTES') {
224-
def cmd = 'bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic --remote_header="Authorization=Basic $BAZEL_AUTH_TOKEN_B64" --profile=build.profile'
225-
try {
226-
try {
227-
sh label: 'Test, using cached results and building a minimum of dependencies', script: cmd + ' ...';
228-
} finally {
229-
sh label: 'Analyze build times', script: 'bazelisk analyze-profile build.profile';
230-
}
231-
} catch (e) {
232-
currentBuild.result = 'FAILURE';
220+
try {
221+
withDockerContainer(args: '-u root -v /var/run/docker.sock:/var/run/docker.sock', image: 'openroad/bazel-ci:latest') {
222+
stage('bazelisk test ...') {
223+
withCredentials([string(credentialsId: 'bazel-auth-token-b64', variable: 'BAZEL_AUTH_TOKEN_B64')]) {
224+
timeout(time: 120, unit: 'MINUTES') {
225+
def cmd = 'bazelisk test --config=ci --show_timestamps --test_output=errors --curses=no --force_pic --remote_header="Authorization=Basic $BAZEL_AUTH_TOKEN_B64" --profile=build.profile'
233226
try {
234-
sh label: 'Test (keep_going)', script: cmd + ' --keep_going ...';
235-
} finally {
236-
sh label: 'Analyze build times', script: 'bazelisk analyze-profile build.profile';
227+
try {
228+
sh label: 'Test, using cached results and building a minimum of dependencies', script: cmd + ' ...';
229+
} finally {
230+
sh label: 'Analyze build times', script: 'bazelisk analyze-profile build.profile';
231+
}
232+
} catch (e) {
233+
try {
234+
sh label: 'Test (keep_going)', script: cmd + ' --keep_going ...';
235+
} catch (e2) {
236+
currentBuild.result = 'FAILURE';
237+
} finally {
238+
sh label: 'Analyze build times', script: 'bazelisk analyze-profile build.profile';
239+
}
237240
}
238241
}
239242
}
240243
}
241244
}
245+
} catch (IOException e) {
246+
echo "Caught: ${e}";
242247
}
243248
}
244249
}

src/cut/src/abc_library_factory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "db_sta/dbNetwork.hh"
1515
#include "db_sta/dbSta.hh"
1616
#include "sta/TimingModel.hh"
17+
#include "utl/Logger.h"
1718
// Poor include definitions in ABC
1819
// clang-format off
1920
#include "misc/st/st.h"

src/cut/src/logic_extractor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "sta/NetworkClass.hh"
2121
#include "sta/PortDirection.hh"
2222
#include "sta/SearchPred.hh"
23+
#include "utl/Logger.h"
2324

2425
namespace cut {
2526

src/dft/src/cells/ScanCellFactory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "sta/Liberty.hh"
2020
#include "sta/NetworkClass.hh"
2121
#include "sta/Sequential.hh"
22+
#include "utl/Logger.h"
2223

2324
namespace dft {
2425

src/dft/src/utils/Utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "sta/Liberty.hh"
1818
#include "sta/NetworkClass.hh"
1919
#include "sta/SdcClass.hh"
20+
#include "utl/Logger.h"
2021

2122
namespace dft::utils {
2223

src/dpl/include/dpl/Opendp.h

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ namespace dpl {
2929

3030
using utl::Logger;
3131

32-
using odb::dbDatabase;
33-
using odb::dbMaster;
34-
using odb::dbMasterType;
35-
using odb::dbTechLayer;
36-
3732
class Node;
3833
class Group;
3934
class Master;
@@ -73,7 +68,7 @@ struct GridPt;
7368
struct DbuPt;
7469
struct DbuRect;
7570

76-
using dbMasterSeq = std::vector<dbMaster*>;
71+
using dbMasterSeq = std::vector<odb::dbMaster*>;
7772

7873
using IRDropByPoint = std::map<odb::Point, double>;
7974
struct GapInfo;
@@ -84,7 +79,7 @@ struct IRDrop;
8479
class Opendp
8580
{
8681
public:
87-
Opendp(dbDatabase* db, Logger* logger);
82+
Opendp(odb::dbDatabase* db, Logger* logger);
8883
~Opendp();
8984

9085
Opendp(const Opendp&) = delete;
@@ -101,7 +96,7 @@ class Opendp
10196
void reportLegalizationStats() const;
10297

10398
void setPaddingGlobal(int left, int right);
104-
void setPadding(dbMaster* master, int left, int right);
99+
void setPadding(odb::dbMaster* master, int left, int right);
105100
void setPadding(odb::dbInst* inst, int left, int right);
106101
void setDebug(std::unique_ptr<dpl::DplObserver>& observer);
107102

@@ -120,7 +115,7 @@ class Opendp
120115
void optimizeMirroring();
121116

122117
// Place decap cells
123-
void addDecapMaster(dbMaster* decap_master, double decap_cap);
118+
void addDecapMaster(odb::dbMaster* decap_master, double decap_cap);
124119
void insertDecapCells(double target, IRDropByPoint& psm_ir_drops);
125120

126121
// Get the instance adjacent to the left or right of a given instance
@@ -150,7 +145,7 @@ class Opendp
150145
// gap -> sequence of masters to fill the gap
151146
using GapFillers = std::vector<dbMasterSeq>;
152147

153-
using MasterByImplant = std::map<dbTechLayer*, dbMasterSeq>;
148+
using MasterByImplant = std::map<odb::dbTechLayer*, dbMasterSeq>;
154149

155150
using YCoordToGap = std::map<DbuY, std::vector<GapInfo*>>;
156151

@@ -278,7 +273,7 @@ class Opendp
278273
dbMasterSeq filterFillerMasters(const dbMasterSeq& filler_masters) const;
279274
MasterByImplant splitByImplant(const dbMasterSeq& filler_masters);
280275
void setGridCells();
281-
dbMasterSeq& gapFillers(dbTechLayer* implant,
276+
dbMasterSeq& gapFillers(odb::dbTechLayer* implant,
282277
GridX gap,
283278
const MasterByImplant& filler_masters_by_implant);
284279
void placeRowFillers(GridY row,
@@ -292,7 +287,9 @@ class Opendp
292287
std::vector<int> findDecapCellIndices(const DbuX& gap_width,
293288
const double& current,
294289
const double& target);
295-
void insertDecapInPos(dbMaster* master, const DbuX& pos_x, const DbuY& pos_y);
290+
void insertDecapInPos(odb::dbMaster* master,
291+
const DbuX& pos_x,
292+
const DbuY& pos_y);
296293
void insertDecapInRow(const std::vector<GapInfo*>& gaps,
297294
DbuY gap_y,
298295
DbuX irdrop_x,
@@ -309,7 +306,7 @@ class Opendp
309306
void setGridLoc(Node* cell, GridX x, GridY y);
310307

311308
Logger* logger_ = nullptr;
312-
dbDatabase* db_ = nullptr;
309+
odb::dbDatabase* db_ = nullptr;
313310
odb::dbBlock* block_ = nullptr;
314311
odb::Rect core_;
315312

@@ -331,8 +328,8 @@ class Opendp
331328

332329
// Filler placement.
333330
// gap (in sites) -> seq of masters by implant
334-
std::map<dbTechLayer*, GapFillers> gap_fillers_;
335-
std::map<dbMaster*, int> filler_count_;
331+
std::map<odb::dbTechLayer*, GapFillers> gap_fillers_;
332+
std::map<odb::dbMaster*, int> filler_count_;
336333
bool have_fillers_ = false;
337334

338335
// Decap placement.

src/dpl/src/FillerPlacement.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "infrastructure/Grid.h"
1010
#include "infrastructure/Objects.h"
1111
#include "infrastructure/network.h"
12+
#include "odb/db.h"
1213
#include "odb/dbTypes.h"
1314
#include "utl/Logger.h"
1415

@@ -23,7 +24,7 @@ using odb::dbPlacementStatus;
2324

2425
using utl::format_as;
2526

26-
static dbTechLayer* getImplant(dbMaster* master)
27+
static odb::dbTechLayer* getImplant(dbMaster* master)
2728
{
2829
if (!master) {
2930
return nullptr;
@@ -180,7 +181,7 @@ void Opendp::placeRowFillers(GridY row,
180181
k++;
181182
}
182183

183-
dbTechLayer* implant = nullptr;
184+
odb::dbTechLayer* implant = nullptr;
184185
if (j > 0) {
185186
auto pixel = grid_->gridPixel(j - 1, row);
186187
if (pixel->cell && pixel->cell->getDbInst()) {
@@ -252,7 +253,7 @@ const char* Opendp::gridInstName(GridY row, GridX col)
252253

253254
// Return list of masters to fill gap (in site width units).
254255
dbMasterSeq& Opendp::gapFillers(
255-
dbTechLayer* implant,
256+
odb::dbTechLayer* implant,
256257
GridX gap,
257258
const MasterByImplant& filler_masters_by_implant)
258259
{

src/dpl/src/Opendp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ bool Opendp::isMultiRow(const Node* cell) const
4545

4646
////////////////////////////////////////////////////////////////
4747

48-
Opendp::Opendp(dbDatabase* db, Logger* logger) : logger_(logger), db_(db)
48+
Opendp::Opendp(odb::dbDatabase* db, Logger* logger) : logger_(logger), db_(db)
4949
{
5050
dummy_cell_ = std::make_unique<Node>();
5151
dummy_cell_->setPlaced(true);
@@ -68,7 +68,7 @@ void Opendp::setPadding(odb::dbInst* inst, const int left, const int right)
6868
padding_->setPadding(inst, GridX{left}, GridX{right});
6969
}
7070

71-
void Opendp::setPadding(dbMaster* master, const int left, const int right)
71+
void Opendp::setPadding(odb::dbMaster* master, const int left, const int right)
7272
{
7373
padding_->setPadding(master, GridX{left}, GridX{right});
7474
}
@@ -271,7 +271,7 @@ void Opendp::setFixedGridCells()
271271
if (cell->getType() == Node::CELL && cell->isFixed()) {
272272
grid_->visitCellPixels(*cell, true, [&](Pixel* pixel, bool padded) {
273273
if (padded) {
274-
pixel->padding_reserved_by.insert(cell.get());
274+
pixel->padding_reserved_by = cell.get();
275275
} else {
276276
setGridCell(*cell, pixel);
277277
}

src/dpl/src/Place.cpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,23 @@ bool Opendp::swapCells(Node* cell1, Node* cell2)
641641
+ distChange(cell2, cell1->getLeft(), cell1->getBottom());
642642

643643
if (dist_change < 0) {
644+
Journal journal(grid_.get(), nullptr);
645+
MoveCellAction action1(cell1,
646+
cell1->getLeft(),
647+
cell1->getBottom(),
648+
cell2->getLeft(),
649+
cell2->getBottom(),
650+
cell1->isPlaced());
651+
journal.addAction(action1);
652+
653+
MoveCellAction action2(cell2,
654+
cell2->getLeft(),
655+
cell2->getBottom(),
656+
cell1->getLeft(),
657+
cell1->getBottom(),
658+
cell2->isPlaced());
659+
journal.addAction(action2);
660+
644661
const GridX grid_x1 = grid_->gridX(cell2);
645662
const GridY grid_y1 = grid_->gridSnapDownY(cell2);
646663
const GridX grid_x2 = grid_->gridX(cell1);
@@ -650,7 +667,11 @@ bool Opendp::swapCells(Node* cell1, Node* cell2)
650667
unplaceCell(cell2);
651668
placeCell(cell1, grid_x1, grid_y1);
652669
placeCell(cell2, grid_x2, grid_y2);
653-
return true;
670+
// Check if placement is valid
671+
if (drc_engine_->checkDRC(cell1) && drc_engine_->checkDRC(cell2)) {
672+
return true;
673+
}
674+
journal.undo();
654675
}
655676
}
656677
return false;
@@ -873,7 +894,7 @@ bool Opendp::checkPixels(const Node* cell,
873894
return false;
874895
}
875896

876-
dbSite* site = cell->getSite();
897+
odb::dbSite* site = cell->getSite();
877898
for (GridY y1 = y; y1 < y_end; y1++) {
878899
const bool first_row = (y1 == y);
879900
for (GridX x1 = x; x1 < x_end; x1++) {
@@ -1208,7 +1229,7 @@ void Opendp::placeCell(Node* cell, const GridX x, const GridY y)
12081229
setGridLoc(cell, x, y);
12091230
grid_->paintPixel(cell);
12101231
cell->setPlaced(true);
1211-
dbSite* site = cell->getDbInst()->getMaster()->getSite();
1232+
odb::dbSite* site = cell->getDbInst()->getMaster()->getSite();
12121233
cell->setOrient(grid_->getSiteOrientation(x, y, site).value());
12131234
if (journal_) {
12141235
MoveCellAction action(cell,

src/dpl/src/PlacementDRC.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "infrastructure/Padding.h"
1212
#include "odb/db.h"
1313
#include "odb/dbTransform.h"
14+
#include "odb/dbTypes.h"
1415
#include "odb/geom.h"
1516

1617
namespace dpl {
@@ -194,6 +195,8 @@ bool PlacementDRC::checkDRC(const Node* cell,
194195
namespace {
195196
bool isCrWtBlClass(const Node* cell)
196197
{
198+
using odb::dbMasterType;
199+
197200
dbMasterType type = cell->getDbInst()->getMaster()->getType();
198201
// Use switch so if new types are added we get a compiler warning.
199202
switch (type.getValue()) {
@@ -245,8 +248,8 @@ bool isCrWtBlClass(const Node* cell)
245248

246249
bool isWellTap(const Node* cell)
247250
{
248-
dbMasterType type = cell->getDbInst()->getMaster()->getType();
249-
return type == dbMasterType::CORE_WELLTAP;
251+
odb::dbMasterType type = cell->getDbInst()->getMaster()->getType();
252+
return type == odb::dbMasterType::CORE_WELLTAP;
250253
}
251254

252255
bool allowOverlap(const Node* cell1, const Node* cell2)
@@ -312,10 +315,8 @@ bool PlacementDRC::checkPadding(const Node* cell,
312315
if (hasPaddingConflict(cell, pixel->cell)) {
313316
return false;
314317
}
315-
for (auto padding_cell : pixel->padding_reserved_by) {
316-
if (hasPaddingConflict(cell, padding_cell)) {
317-
return false;
318-
}
318+
if (hasPaddingConflict(cell, pixel->padding_reserved_by)) {
319+
return false;
319320
}
320321
}
321322
}

0 commit comments

Comments
 (0)