Skip to content

Commit e31ca13

Browse files
committed
odb: read liberty from 3dblox files
Signed-off-by: osamahammad21 <[email protected]>
1 parent a61b45c commit e31ca13

File tree

9 files changed

+20
-13
lines changed

9 files changed

+20
-13
lines changed

src/OpenRoad.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,13 @@ void OpenRoad::writeCdl(const char* out_filename,
479479

480480
void OpenRoad::read3Dbv(const std::string& filename)
481481
{
482-
odb::ThreeDBlox parser(logger_, db_);
482+
odb::ThreeDBlox parser(logger_, db_, sta::Sta::sta());
483483
parser.readDbv(filename);
484484
}
485485

486486
void OpenRoad::read3Dbx(const std::string& filename)
487487
{
488-
odb::ThreeDBlox parser(logger_, db_);
488+
odb::ThreeDBlox parser(logger_, db_, sta::Sta::sta());
489489
parser.readDbx(filename);
490490
}
491491

src/odb/include/odb/3dblox.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
namespace utl {
1010
class Logger;
1111
}
12-
12+
namespace sta {
13+
class Sta;
14+
}
1315
namespace odb {
1416
class dbDatabase;
1517
class ChipletDef;
@@ -24,7 +26,7 @@ class dbChipInst;
2426
class ThreeDBlox
2527
{
2628
public:
27-
ThreeDBlox(utl::Logger* logger, odb::dbDatabase* db);
29+
ThreeDBlox(utl::Logger* logger, odb::dbDatabase* db, sta::Sta* sta = nullptr);
2830
~ThreeDBlox() = default;
2931
void readDbv(const std::string& dbv_file);
3032
void readDbx(const std::string& dbx_file);
@@ -40,5 +42,6 @@ class ThreeDBlox
4042

4143
utl::Logger* logger_ = nullptr;
4244
odb::dbDatabase* db_ = nullptr;
45+
sta::Sta* sta_ = nullptr;
4346
};
4447
} // namespace odb

src/odb/src/3dblox/3dblox.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "odb/defin.h"
1717
#include "odb/geom.h"
1818
#include "odb/lefin.h"
19+
#include "sta/Sta.hh"
1920
#include "utl/Logger.h"
2021

2122
namespace odb {
@@ -30,8 +31,8 @@ static std::map<std::string, std::string> dup_orient_map
3031
{"MZ_MX_R180", "MZ_MY"},
3132
{"MZ_MX_R270", "MZ_MY_R90"}};
3233

33-
ThreeDBlox::ThreeDBlox(utl::Logger* logger, odb::dbDatabase* db)
34-
: logger_(logger), db_(db)
34+
ThreeDBlox::ThreeDBlox(utl::Logger* logger, odb::dbDatabase* db, sta::Sta* sta)
35+
: logger_(logger), db_(db), sta_(sta)
3536
{
3637
}
3738

@@ -138,7 +139,12 @@ void ThreeDBlox::createChiplet(const ChipletDef& chiplet)
138139
odb::lefin lef_reader(db_, logger_, false);
139140
lef_reader.createLib(tech, lib_name.c_str(), lef_file.c_str());
140141
}
141-
// TODO: Read liberty files
142+
if (sta_ != nullptr) {
143+
for (const auto& liberty_file : chiplet.external.lib_files) {
144+
sta_->readLiberty(
145+
liberty_file.c_str(), sta_->cmdCorner(), sta::MinMaxAll::all(), true);
146+
}
147+
}
142148
dbChip* chip = dbChip::create(
143149
db_, tech, chiplet.name, getChipType(chiplet.type, logger_));
144150
// Read DEF file

src/odb/src/3dblox/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ target_link_libraries(3dblox
1515
db
1616
utl_lib
1717
yaml-cpp
18+
OpenSTA
1819
)
1920

2021
target_include_directories(3dblox

src/odb/test/data/example.3dbv

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ ChipletDef:
2929
- [955, 1082]
3030
- [0, 1082]
3131
external:
32-
thermal_name: [N5_1P15M]
3332
APR_tech_file: [NG45_PATH/*_tech.lef]
34-
RC_tech_file: [Collateral/SoC/tech/a.ircx]
35-
liberty_file: [Collateral/SoC/lib/a.lib]
36-
3dbf_file: [Feasibility/SoC.3dbf]
33+
liberty_file: [NG45_PATH/fake_macros.lib]
3734
LEF_file: [NG45_PATH/fake_macros.lef]
3835
DEF_file: ../fake_macros.def

src/odb/test/read_3dbv.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[INFO ODB-0227] LEF file: data/../Nangate45/Nangate45_tech.lef, created 22 layers, 27 vias
22
[INFO ODB-0227] LEF file: data/../Nangate45/fake_macros.lef, created 10 library cells
3+
[WARNING STA-1171] data/../Nangate45/fake_macros.lib line 32, default_max_transition is 0.0.
34
[INFO ODB-0128] Design: fake_macros
45
[INFO ODB-0131] Created 10 components and 32 component-terminals.
56
[INFO ODB-0133] Created 12 nets and 24 connections.

src/odb/test/read_3dbv.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source "helpers.tcl"
22

33
set db [ord::get_db]
4-
set tech [odb::dbTech_create $db "tech"]
54

65
read_3dbv "data/example.3dbv"
76
if { [$db getChip] == "NULL" } {

src/odb/test/read_3dbx.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[INFO ODB-0227] LEF file: data/../Nangate45/Nangate45_tech.lef, created 22 layers, 27 vias
22
[INFO ODB-0227] LEF file: data/../Nangate45/fake_macros.lef, created 10 library cells
3+
[WARNING STA-1171] data/../Nangate45/fake_macros.lib line 32, default_max_transition is 0.0.
34
[INFO ODB-0128] Design: fake_macros
45
[INFO ODB-0131] Created 10 components and 32 component-terminals.
56
[INFO ODB-0133] Created 12 nets and 24 connections.

src/odb/test/read_3dbx.tcl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
source "helpers.tcl"
22

33
set db [ord::get_db]
4-
set tech [odb::dbTech_create $db "tech"]
54

65
read_3dbx "data/example.3dbx"
76
if { [$db getChip] == "NULL" } {

0 commit comments

Comments
 (0)