Skip to content

Commit

Permalink
Merge branch 'The-OpenROAD-Project:master' into hier_connect_with_test
Browse files Browse the repository at this point in the history
  • Loading branch information
andyfox-rushc authored Dec 13, 2024
2 parents 409d165 + 6bd2ccb commit afa998a
Show file tree
Hide file tree
Showing 12 changed files with 2,813 additions and 82 deletions.
1 change: 1 addition & 0 deletions src/dbSta/include/db_sta/dbNetwork.hh
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class dbNetwork : public ConcreteNetwork
dbBTerm* isTopPort(const Port*) const;
void setTopPortDirection(dbBTerm* bterm, const dbIoType& io_type);
ObjectId id(const Port* port) const override;
ObjectId id(const Cell* cell) const override;

// hierarchical support functions
dbModule* getNetDriverParentModule(Net* net);
Expand Down
23 changes: 23 additions & 0 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,29 @@ ObjectId dbNetwork::id(const Port* port) const
return ConcreteNetwork::id(port);
}

// Note:
// This api call is subtly used by the sta/verilog/VerilogWriter in sta.
// The verilog writer in sta a hash of modules written out, cells.hasKey, which
// uses the cell id as index and will land here (before it defaulted to the
// concrete network api, which is ok for flat networks but wont work with
// hierarchy).
//

ObjectId dbNetwork::id(const Cell* cell) const
{
// in hierarchical flow we use the object id for the index
if (hierarchy_) {
if (!isConcreteCell(cell)) {
dbObject* obj = reinterpret_cast<dbObject*>(const_cast<Cell*>(cell));
dbObjectType type = obj->getObjectType();
return getDbNwkObjectId(type, obj->getId());
}
}
// default behaviour use the concrete cell.
const ConcreteCell* ccell = reinterpret_cast<const ConcreteCell*>(cell);
return ccell->id();
}

////////////////////////////////////////////////////////////////

ObjectId dbNetwork::id(const Instance* instance) const
Expand Down
Binary file added src/dbSta/test/hierwrite.odb
Binary file not shown.
2 changes: 2 additions & 0 deletions src/dbSta/test/hierwrite.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[INFO ODB-0227] LEF file: Nangate45/Nangate45.lef, created 22 layers, 27 vias, 135 library cells
No differences found.
7 changes: 7 additions & 0 deletions src/dbSta/test/hierwrite.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source "helpers.tcl"
read_lef Nangate45/Nangate45.lef
read_liberty Nangate45/Nangate45_typ.lib
read_db hierwrite.odb -hier
set v_file [make_result_file hierwrite.v]
write_verilog $v_file
diff_files $v_file hierwrite.vok
Loading

0 comments on commit afa998a

Please sign in to comment.