Skip to content

Commit 6044662

Browse files
committed
Merge branch 'master' into mpl-use-best-result
2 parents a76cb90 + fec01b9 commit 6044662

15 files changed

Lines changed: 178 additions & 29 deletions

.gitignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ debian/openroad
5454
obj-x86_64-linux-gnu/
5555

5656
user.bazelrc
57-
bazel-*
57+
58+
bazel-bin
59+
bazel-out
60+
bazel-testlogs
61+
bazel-OpenROAD
62+
63+
projectview.bazelproject
64+
.bsp/
65+
.bazelbsp/

bazel/tcl_encode_or.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def _tcl_encode_or_impl(ctx):
1313
output_file = ctx.actions.declare_file(outfile_name)
1414

1515
args = ctx.actions.args()
16+
args.add(ctx.executable._encode_script)
1617
args.add_all("--inputs", ctx.files.srcs)
1718
args.add("--output", output_file)
1819
args.add("--varname", ctx.attr.char_array_name)
@@ -22,8 +23,8 @@ def _tcl_encode_or_impl(ctx):
2223
outputs = [output_file],
2324
inputs = ctx.files.srcs,
2425
arguments = [args],
25-
#tools = [ctx.executable._tclsh, ctx.file._encode_script],
26-
executable = ctx.executable._encode_script,
26+
tools = [ctx.executable._encode_script],
27+
executable = ctx.toolchains["@rules_python//python:toolchain_type"].py3_runtime.interpreter,
2728
)
2829
return [DefaultInfo(files = depset([output_file]))]
2930

@@ -53,4 +54,5 @@ tcl_encode = rule(
5354
cfg = "exec",
5455
),
5556
},
57+
toolchains = ["@rules_python//python:toolchain_type"],
5658
)

src/mpl/src/hier_rtlmp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,7 @@ Snapper::LayerDataList Snapper::computeLayerDataList(
33003300
track_grid->getGridY(positions);
33013301
}
33023302
std::sort(pins.begin(), pins.end(), compare_pin_center);
3303-
layers_data.push_back(LayerData{track_grid, positions, pins});
3303+
layers_data.push_back(LayerData{track_grid, std::move(positions), pins});
33043304
}
33053305

33063306
auto compare_layer_number = [](LayerData data1, LayerData data2) {

src/tap/include/tap/tapcell.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct EndcapCellOptions
7878
odb::dbMaster* right_edge = nullptr;
7979

8080
std::string prefix = "PHY_";
81+
bool tapcell_cmd = false;
8182
};
8283

8384
class Tapcell
@@ -219,7 +220,8 @@ class Tapcell
219220

220221
EndcapCellOptions correctEndcapOptions(const Options& options) const;
221222

222-
odb::dbMaster* getMasterByType(const odb::dbMasterType& type) const;
223+
odb::dbMaster* getMasterByType(const odb::dbMasterType& type,
224+
const std::string& option_name) const;
223225
std::set<odb::dbMaster*> findMasterByType(
224226
const odb::dbMasterType& type) const;
225227
odb::dbBlock* getBlock() const;

src/tap/src/tapcell.cpp

Lines changed: 47 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,12 +1307,13 @@ EndcapCellOptions Tapcell::correctEndcapOptions(
13071307
{
13081308
EndcapCellOptions bopts = options;
13091309

1310-
auto set_single_master
1311-
= [this](odb::dbMaster*& master, const odb::dbMasterType& type) {
1312-
if (master == nullptr) {
1313-
master = getMasterByType(type);
1314-
}
1315-
};
1310+
auto set_single_master = [this](odb::dbMaster*& master,
1311+
const odb::dbMasterType& type,
1312+
const std::string& option_name) {
1313+
if (master == nullptr) {
1314+
master = getMasterByType(type, option_name);
1315+
}
1316+
};
13161317

13171318
auto set_multiple_master = [this](std::vector<odb::dbMaster*>& masters,
13181319
const odb::dbMasterType& type) {
@@ -1347,28 +1348,41 @@ EndcapCellOptions Tapcell::correctEndcapOptions(
13471348
}
13481349
};
13491350

1351+
const bool tapcell_cmd = options.tapcell_cmd;
1352+
set_single_master(bopts.left_edge,
1353+
odb::dbMasterType::ENDCAP_LEF58_LEFTEDGE,
1354+
tapcell_cmd ? "endcap_master" : "left_edge/-endcap");
1355+
set_single_master(bopts.right_edge,
1356+
odb::dbMasterType::ENDCAP_LEF58_RIGHTEDGE,
1357+
tapcell_cmd ? "endcap_master" : "right_edge/-endcap");
1358+
set_multiple_master(bopts.top_edge, odb::dbMasterType::ENDCAP_LEF58_TOPEDGE);
1359+
set_multiple_master(bopts.bottom_edge,
1360+
odb::dbMasterType::ENDCAP_LEF58_BOTTOMEDGE);
13501361
set_single_master(bopts.right_top_corner,
1351-
odb::dbMasterType::ENDCAP_LEF58_RIGHTTOPCORNER);
1362+
odb::dbMasterType::ENDCAP_LEF58_RIGHTTOPCORNER,
1363+
tapcell_cmd ? "cnrcap_nwout_master" : "right_top_corner");
13521364
set_single_master(bopts.left_top_corner,
1353-
odb::dbMasterType::ENDCAP_LEF58_LEFTTOPCORNER);
1365+
odb::dbMasterType::ENDCAP_LEF58_LEFTTOPCORNER,
1366+
tapcell_cmd ? "cnrcap_nwout_master" : "left_top_corner");
13541367
set_single_master(bopts.right_bottom_corner,
1355-
odb::dbMasterType::ENDCAP_LEF58_RIGHTBOTTOMCORNER);
1368+
odb::dbMasterType::ENDCAP_LEF58_RIGHTBOTTOMCORNER,
1369+
tapcell_cmd ? "cnrcap_nwin_master" : "right_bottom_corner");
13561370
set_single_master(bopts.left_bottom_corner,
1357-
odb::dbMasterType::ENDCAP_LEF58_LEFTBOTTOMCORNER);
1371+
odb::dbMasterType::ENDCAP_LEF58_LEFTBOTTOMCORNER,
1372+
tapcell_cmd ? "cnrcap_nwin_master" : "left_bottom_corner");
13581373
set_single_master(bopts.right_top_edge,
1359-
odb::dbMasterType::ENDCAP_LEF58_RIGHTTOPEDGE);
1374+
odb::dbMasterType::ENDCAP_LEF58_RIGHTTOPEDGE,
1375+
tapcell_cmd ? "incnrcap_nwin_master" : "right_top_edge");
13601376
set_single_master(bopts.left_top_edge,
1361-
odb::dbMasterType::ENDCAP_LEF58_LEFTTOPEDGE);
1362-
set_single_master(bopts.right_bottom_edge,
1363-
odb::dbMasterType::ENDCAP_LEF58_RIGHTBOTTOMEDGE);
1377+
odb::dbMasterType::ENDCAP_LEF58_LEFTTOPEDGE,
1378+
tapcell_cmd ? "incnrcap_nwin_master" : "left_top_edge");
1379+
set_single_master(
1380+
bopts.right_bottom_edge,
1381+
odb::dbMasterType::ENDCAP_LEF58_RIGHTBOTTOMEDGE,
1382+
tapcell_cmd ? "incnrcap_nwout_master" : "right_bottom_edge");
13641383
set_single_master(bopts.left_bottom_edge,
1365-
odb::dbMasterType::ENDCAP_LEF58_LEFTBOTTOMEDGE);
1366-
set_single_master(bopts.left_edge, odb::dbMasterType::ENDCAP_LEF58_LEFTEDGE);
1367-
set_single_master(bopts.right_edge,
1368-
odb::dbMasterType::ENDCAP_LEF58_RIGHTEDGE);
1369-
set_multiple_master(bopts.top_edge, odb::dbMasterType::ENDCAP_LEF58_TOPEDGE);
1370-
set_multiple_master(bopts.bottom_edge,
1371-
odb::dbMasterType::ENDCAP_LEF58_BOTTOMEDGE);
1384+
odb::dbMasterType::ENDCAP_LEF58_LEFTBOTTOMEDGE,
1385+
tapcell_cmd ? "incnrcap_nwout_master" : "left_bottom_edge");
13721386

13731387
set_corner_master(bopts.right_top_corner,
13741388
bopts.left_top_corner,
@@ -1395,15 +1409,23 @@ EndcapCellOptions Tapcell::correctEndcapOptions(
13951409
return bopts;
13961410
}
13971411

1398-
odb::dbMaster* Tapcell::getMasterByType(const odb::dbMasterType& type) const
1412+
odb::dbMaster* Tapcell::getMasterByType(const odb::dbMasterType& type,
1413+
const std::string& option_name) const
13991414
{
14001415
const std::set<odb::dbMaster*> masters = findMasterByType(type);
14011416

14021417
if (masters.size() > 1) {
1418+
std::string masters_names;
1419+
for (odb::dbMaster* master : masters) {
1420+
masters_names += " " + master->getName();
1421+
}
14031422
logger_->error(utl::TAP,
14041423
104,
1405-
"Unable to find a single master for {}",
1406-
type.getString());
1424+
"Found multiple masters for {}. Use -{} "
1425+
"to specify one of the following cells: {}",
1426+
type.getString(),
1427+
option_name,
1428+
masters_names);
14071429
}
14081430
if (masters.empty()) {
14091431
return nullptr;
@@ -1461,6 +1483,7 @@ EndcapCellOptions Tapcell::correctEndcapOptions(const Options& options) const
14611483
bopts.left_bottom_edge = options.incnrcap_nwout_master;
14621484
bopts.right_top_edge = options.incnrcap_nwin_master;
14631485
bopts.right_bottom_edge = options.incnrcap_nwout_master;
1486+
bopts.tapcell_cmd = true;
14641487

14651488
return bopts;
14661489
}

src/tap/src/tapcell.i

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
options.left_edge = left_edge;
139139
options.right_edge = right_edge;
140140
options.prefix = prefix;
141+
options.tapcell_cmd = false;
141142

142143
getTapcell()->placeEndcaps(options);
143144
}

src/tap/test/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ or_integration_tests(
1313
cut_rows_with_endcaps
1414
disallow_one_site_gaps
1515
disallow_one_site_gaps2
16+
endcap_autoselection_error1
17+
endcap_autoselection_error2
18+
endcap_autoselection_error3
19+
endcap_autoselection_error4
1620
gcd_asap7
1721
gcd_fakeram
1822
gcd_nangate45
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45_tech.lef, created 22 layers, 27 vias
2+
[INFO ODB-0227] LEF file: Nangate45/Nangate45_stdcell.lef, created 135 library cells
3+
[INFO ODB-0227] LEF file: Nangate45_data/endcaps.lef, created 13 library cells
4+
[INFO ODB-0227] LEF file: Nangate45_data/endcaps_symmetric.lef, created 5 library cells
5+
[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells
6+
[INFO ODB-0128] Design: gcd
7+
[INFO ODB-0131] Created 5 components and 160 component-terminals.
8+
[INFO ODB-0303] The initial 479 rows (2081802 sites) were cut with 5 shapes for a total of 699 rows (2014702 sites).
9+
[ERROR TAP-0104] Found multiple masters for ENDCAP RIGHTEDGE. Use -endcap_master to specify one of the following cells: ENDCAP_X4_RIGHTEDGE_Y ENDCAP_X4_RIGHTEDGE
10+
TAP-0104
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
source "helpers.tcl"
2+
read_lef Nangate45/Nangate45_tech.lef
3+
read_lef Nangate45/Nangate45_stdcell.lef
4+
read_lef Nangate45_data/endcaps.lef
5+
read_lef Nangate45_data/endcaps_symmetric.lef
6+
read_lef Nangate45/fakeram45_64x7.lef
7+
read_def Nangate45_data/macros.def
8+
9+
set def_file [make_result_file boundary_macros_tapcell.def]
10+
11+
catch {tapcell -distance "20" \
12+
-tapcell_master "TAPCELL_X1" \
13+
-tap_nwin2_master "ENDCAP_X1_TOPEDGE" \
14+
-tap_nwin3_master "ENDCAP_X1_TOPEDGE" \
15+
-tap_nwout2_master "ENDCAP_X1_BOTTOMEDGE" \
16+
-tap_nwout3_master "ENDCAP_X1_BOTTOMEDGE" \
17+
-tap_nwintie_master "ENDCAP_X1_TOPEDGE" \
18+
-tap_nwouttie_master "ENDCAP_X1_BOTTOMEDGE" \
19+
-cnrcap_nwin_master "ENDCAP_X4_LEFTBOTTOMCORNER_Y" \
20+
-cnrcap_nwout_master "ENDCAP_X4_LEFTTOPCORNER_Y" \
21+
-incnrcap_nwin_master "ENDCAP_X4_LEFTTOPEDGE_Y" \
22+
-incnrcap_nwout_master "ENDCAP_X4_LEFTBOTTOMEDGE_Y"} error
23+
24+
puts $error
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[INFO ODB-0227] LEF file: Nangate45/Nangate45_tech.lef, created 22 layers, 27 vias
2+
[INFO ODB-0227] LEF file: Nangate45/Nangate45_stdcell.lef, created 135 library cells
3+
[INFO ODB-0227] LEF file: Nangate45_data/endcaps.lef, created 13 library cells
4+
[INFO ODB-0227] LEF file: Nangate45_data/endcaps_symmetric.lef, created 5 library cells
5+
[INFO ODB-0227] LEF file: Nangate45/fakeram45_64x7.lef, created 1 library cells
6+
[INFO ODB-0128] Design: gcd
7+
[INFO ODB-0131] Created 5 components and 160 component-terminals.
8+
[ERROR TAP-0104] Found multiple masters for ENDCAP RIGHTEDGE. Use -right_edge/-endcap to specify one of the following cells: ENDCAP_X4_RIGHTEDGE_Y ENDCAP_X4_RIGHTEDGE
9+
TAP-0104

0 commit comments

Comments
 (0)