Skip to content

Commit f224909

Browse files
committed
Merge branch 'odb-gen-objtype' into odb-prop
2 parents 95b09f3 + 6bf131c commit f224909

File tree

201 files changed

+119126
-3890
lines changed

Some content is hidden

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

201 files changed

+119126
-3890
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,8 @@ if(BUILD_MAN)
176176
install(DIRECTORY ${OPENROAD_HOME}/docs/cat DESTINATION ${OPENROAD_SHARE}/man)
177177
install(DIRECTORY ${OPENROAD_HOME}/docs/html DESTINATION ${OPENROAD_SHARE}/man)
178178
endif()
179+
180+
####################################################################
181+
# Add a configuration for ReleaseWithAsserts
182+
set(CMAKE_CXX_FLAGS_RELEASEWITHASSERTS "${CMAKE_CXX_FLAGS_RELEASE} -UNDEBUG" CACHE STRING "" FORCE)
183+
set(CMAKE_C_FLAGS_RELEASEWITHASSERTS "${CMAKE_C_FLAGS_RELEASE} -UNDEBUG" CACHE STRING "" FORCE)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Handling breaking changes between OpenROAD and ORFS
2+
3+
ORFS occasionally requires an update when OpenROAD has changed in some breaking way(such as when retiring a feature), but it is not common.
4+
5+
Normally a new feature is added to OpenROAD, then ORFS afterwards can be updated to use the new feature, or if ORFS has a breaking change for bazel-orfs, ORFS and bazel-orfs can be updated together in OpenROAD.
6+
7+
## Add interim conditional code to ORFS
8+
9+
One way to handle this is to add conditional code to ORFS and clean up the conditional code when it is no longer needed.
10+
11+
```tcl
12+
try {
13+
new_command -option value
14+
} trap {ANY} {e} {
15+
puts "new_command failed, falling back to old_command"
16+
old_command -option value
17+
}
18+
```
19+
20+
## Publish a Docker image with the changes
21+
22+
To update MODULE.bazel to point to a new ORFS docker image and bazel-orfs in OpenROAD, run [bazelisk run //bazel-orfs:bump](../../test/orfs/README.md#updating-orfs-and-bazel-orfs), then use `git add -p .` to pick what you want to commit.
23+
24+
Then, to create an OpenROAD PR which uses an interim ORFS Docker image:
25+
26+
1. publish a docker image of ORFS with the changes and the old broken OpenROAD, but don't update ORFS master. OpenROAD uses the ORFS docker image, with the bazel compiled OpenROAD
27+
2. point MODULE.bazel to this docker image
28+
3. create a PR for OpenROAD. This PR will run with HEAD from OpenROAD and the ORFS image you published in 1.
29+
4. Upgrade the OpenROAD submodule in ORFS and publish a new Docker image
30+
5. Run `bazelisk run //bazel-orfs:bump` again

src/OpenRoad.cc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,12 @@ void OpenRoad::readDb(const char* filename, bool hierarchy)
462462
}
463463
// treat this as a hierarchical network.
464464
if (hierarchy) {
465+
logger_->warn(
466+
ORD,
467+
12,
468+
"Hierarchical flow (-hier) is currently in development and may cause "
469+
"multiple issues. Do not use in production environments.");
470+
465471
sta::dbSta* sta = getSta();
466472
// After streaming in the last thing we do is build the hashes
467473
// we cannot rely on orders to do this during stream in
@@ -523,6 +529,12 @@ void OpenRoad::linkDesign(const char* design_name,
523529
}
524530

525531
if (hierarchy) {
532+
logger_->warn(
533+
ORD,
534+
11,
535+
"Hierarchical flow (-hier) is currently in development and may cause "
536+
"multiple issues. Do not use in production environments.");
537+
526538
sta::dbSta* sta = getSta();
527539
sta->getDbNetwork()->setHierarchy();
528540
}

src/cts/test/hier_insertion_delay.ok

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
22
[INFO ODB-0227] LEF file: array_tile_ins_delay.lef, created 1 library cells
3+
[WARNING ORD-0011] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
34
[INFO IFP-0001] Added 857 rows of 210 site FreePDK45_38x28_10R_NP_162NW_34O.
5+
[INFO GPL-0005] Execute conjugate gradient initial placement.
46
[INFO GPL-0002] DBU: 2000
57
[INFO GPL-0003] SiteSize: ( 0.190 1.400 ) um
68
[INFO GPL-0004] CoreBBox: ( 0.000 0.000 ) ( 39.900 1199.800 ) um

src/cts/test/simple_test_hier.ok

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[WARNING ORD-0011] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
23
[INFO IFP-0001] Added 857 rows of 210 site FreePDK45_38x28_10R_NP_162NW_34O.
4+
[INFO GPL-0005] Execute conjugate gradient initial placement.
35
[INFO GPL-0002] DBU: 2000
46
[INFO GPL-0003] SiteSize: ( 0.190 1.400 ) um
57
[INFO GPL-0004] CoreBBox: ( 0.000 0.000 ) ( 39.900 1199.800 ) um

src/dbSta/include/db_sta/dbNetwork.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ class dbNetwork : public ConcreteNetwork
291291
const Net* highestConnectedNet(Net* net) const override;
292292
bool isSpecial(Net* net);
293293
dbNet* flatNet(const Net* net) const;
294+
Net* getFlatNet(Net* net) const;
294295

295296
////////////////////////////////////////////////////////////////
296297
// Edit functions

src/dbSta/src/dbNetwork.cc

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,9 @@ void dbNetwork::staToDb(const Instance* instance,
26352635

26362636
dbNet* dbNetwork::staToDb(const Net* net) const
26372637
{
2638-
return reinterpret_cast<dbNet*>(const_cast<Net*>(net));
2638+
dbNet* db_net = reinterpret_cast<dbNet*>(const_cast<Net*>(net));
2639+
assert(!db_net || db_net->getObjectType() == odb::dbNetObj);
2640+
return db_net;
26392641
}
26402642

26412643
dbNet* dbNetwork::flatNet(const Net* net) const
@@ -2732,7 +2734,9 @@ void dbNetwork::staToDb(const Pin* pin,
27322734

27332735
dbBTerm* dbNetwork::staToDb(const Term* term) const
27342736
{
2735-
return reinterpret_cast<dbBTerm*>(const_cast<Term*>(term));
2737+
dbBTerm* bterm = reinterpret_cast<dbBTerm*>(const_cast<Term*>(term));
2738+
assert(!bterm || bterm->getObjectType() == odb::dbBTermObj);
2739+
return bterm;
27362740
}
27372741

27382742
void dbNetwork::staToDb(const Term* term,
@@ -2780,20 +2784,26 @@ void dbNetwork::staToDb(const Cell* cell,
27802784
dbMaster* dbNetwork::staToDb(const Cell* cell) const
27812785
{
27822786
const ConcreteCell* ccell = reinterpret_cast<const ConcreteCell*>(cell);
2783-
return reinterpret_cast<dbMaster*>(ccell->extCell());
2787+
auto master = reinterpret_cast<dbMaster*>(ccell->extCell());
2788+
assert(!master || master->getObjectType() == odb::dbMasterObj);
2789+
return master;
27842790
}
27852791

27862792
// called only on db cells.
27872793
dbMaster* dbNetwork::staToDb(const LibertyCell* cell) const
27882794
{
27892795
const ConcreteCell* ccell = cell;
2790-
return reinterpret_cast<dbMaster*>(ccell->extCell());
2796+
auto master = reinterpret_cast<dbMaster*>(ccell->extCell());
2797+
assert(!master || master->getObjectType() == odb::dbMasterObj);
2798+
return master;
27912799
}
27922800

27932801
dbMTerm* dbNetwork::staToDb(const Port* port) const
27942802
{
27952803
const ConcretePort* cport = reinterpret_cast<const ConcretePort*>(port);
2796-
return reinterpret_cast<dbMTerm*>(cport->extPort());
2804+
auto mterm = reinterpret_cast<dbMTerm*>(cport->extPort());
2805+
assert(!mterm || mterm->getObjectType() == odb::dbMTermObj);
2806+
return mterm;
27972807
}
27982808

27992809
dbBTerm* dbNetwork::isTopPort(const Port* port) const
@@ -2841,7 +2851,9 @@ void dbNetwork::staToDb(const Port* port,
28412851

28422852
dbMTerm* dbNetwork::staToDb(const LibertyPort* port) const
28432853
{
2844-
return reinterpret_cast<dbMTerm*>(port->extPort());
2854+
auto mterm = reinterpret_cast<dbMTerm*>(port->extPort());
2855+
assert(!mterm || mterm->getObjectType() == odb::dbMTermObj);
2856+
return mterm;
28452857
}
28462858

28472859
void dbNetwork::staToDb(PortDirection* dir,
@@ -4159,4 +4171,19 @@ void dbNetwork::AxiomCheck()
41594171
}
41604172
}
41614173

4174+
Net* dbNetwork::getFlatNet(Net* net) const
4175+
{
4176+
if (!net) {
4177+
return nullptr;
4178+
}
4179+
// Convert net to a flat net, if not already
4180+
dbNet* db_net;
4181+
dbModNet* db_mod_net;
4182+
staToDb(net, db_net, db_mod_net);
4183+
if (db_mod_net) {
4184+
db_net = findRelatedDbNet(db_mod_net);
4185+
}
4186+
return dbToSta(db_net);
4187+
}
4188+
41624189
} // namespace sta

src/dbSta/test/hier2.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[INFO ODB-0227] LEF file: example1.lef, created 2 layers, 6 library cells
2+
[WARNING ORD-0011] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
23
No differences found.

src/dbSta/test/hierclock.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[WARNING ORD-0011] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
23
Startpoint: U2/_66_ (rising edge-triggered flip-flop clocked by clk1)
34
Endpoint: U2/_66_ (rising edge-triggered flip-flop clocked by clk1)
45
Path Group: clk1

src/dbSta/test/hierwrite.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
2+
[WARNING ORD-0012] Hierarchical flow (-hier) is currently in development and may cause multiple issues. Do not use in production environments.
23
No differences found.

0 commit comments

Comments
 (0)