Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grt/rsz: write spef for estimated parasitics #5656

Merged
merged 18 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/grt/include/grt/GlobalRouter.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class Opendp;

namespace rsz {
class Resizer;
}
class SpefWriter;
} // namespace rsz

namespace sta {
class dbSta;
Expand Down Expand Up @@ -195,7 +196,7 @@ class GlobalRouter : public ant::GlobalRouteSource
bool isCoveringPin(Net* net, GSegment& segment);
std::vector<Net*> initFastRoute(int min_routing_layer, int max_routing_layer);
void initFastRouteIncr(std::vector<Net*>& nets);
void estimateRC();
void estimateRC(rsz::SpefWriter* spef_writer = nullptr);
void estimateRC(odb::dbNet* db_net);
// Return GRT layer lengths in dbu's for db_net's route indexed by routing
// layer.
Expand Down
11 changes: 6 additions & 5 deletions src/grt/src/GlobalRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
#include "odb/db.h"
#include "odb/dbShape.h"
#include "odb/wOrder.h"
#include "rsz/Resizer.hh"
#include "rsz/SpefWriter.hh"
#include "sta/Clock.hh"
#include "sta/MinMax.hh"
#include "sta/Parasitics.hh"
Expand Down Expand Up @@ -447,7 +449,7 @@ NetRouteMap GlobalRouter::findRouting(std::vector<Net*>& nets,
return routes;
}

void GlobalRouter::estimateRC()
void GlobalRouter::estimateRC(rsz::SpefWriter* spef_writer)
{
// Remove any existing parasitics.
sta_->deleteParasitics();
Expand All @@ -457,12 +459,11 @@ void GlobalRouter::estimateRC()

MakeWireParasitics builder(
logger_, resizer_, sta_, db_->getTech(), block_, this);
for (auto& net_route : routes_) {
odb::dbNet* db_net = net_route.first;
GRoute& route = net_route.second;

for (auto& [db_net, route] : routes_) {
if (!route.empty()) {
Net* net = getNet(db_net);
builder.estimateParasitcs(db_net, net->getPins(), route);
builder.estimateParasitcs(db_net, net->getPins(), route, spef_writer);
}
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/grt/src/MakeWireParasitics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "db_sta/dbNetwork.hh"
#include "db_sta/dbSta.hh"
#include "rsz/Resizer.hh"
#include "rsz/SpefWriter.hh"
#include "sta/ArcDelayCalc.hh"
#include "sta/Corner.hh"
#include "sta/Parasitics.hh"
Expand Down Expand Up @@ -76,7 +77,8 @@ MakeWireParasitics::MakeWireParasitics(utl::Logger* logger,

void MakeWireParasitics::estimateParasitcs(odb::dbNet* net,
std::vector<Pin>& pins,
GRoute& route)
GRoute& route,
rsz::SpefWriter* spef_writer)
{
debugPrint(logger_, GRT, "est_rc", 1, "net {}", net->getConstName());
if (logger_->debugCheck(GRT, "est_rc", 2)) {
Expand Down Expand Up @@ -105,6 +107,11 @@ void MakeWireParasitics::estimateParasitcs(odb::dbNet* net,
makeRouteParasitics(
net, route, sta_net, corner, analysis_point, parasitic, node_map);
makeParasiticsToPins(pins, node_map, corner, analysis_point, parasitic);

if (spef_writer) {
spef_writer->writeNet(corner, sta_net, parasitic);
}

arc_delay_calc_->reduceParasitic(
parasitic, sta_net, corner, sta::MinMaxAll::all());
}
Expand Down
6 changes: 4 additions & 2 deletions src/grt/src/MakeWireParasitics.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ class Logger;

namespace rsz {
class Resizer;
}
class SpefWriter;
} // namespace rsz

namespace grt {

Expand All @@ -80,7 +81,8 @@ class MakeWireParasitics : public AbstractMakeWireParasitics
GlobalRouter* grouter);
void estimateParasitcs(odb::dbNet* net,
std::vector<Pin>& pins,
GRoute& route);
GRoute& route,
rsz::SpefWriter* spef_writer = nullptr);
void estimateParasitcs(odb::dbNet* net, GRoute& route) override;

void clearParasitics() override;
Expand Down
2 changes: 2 additions & 0 deletions src/grt/test/est_rc4.ok
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ Load pins
_891_/CK input (DFF_X1) 0.856-0.950 (36, 26)
_892_/CK input (DFF_X1) 0.856-0.950 (53, 38)

No differences found.
No differences found.
5 changes: 4 additions & 1 deletion src/grt/test/est_rc4.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ set_layer_rc -corner corner1 -layer metal3 -resistance 4 -capacitance 2
set_layer_rc -corner corner1 -layer metal4 -resistance 4 -capacitance 2

set_routing_layers -signal metal2-metal10
estimate_parasitics -global_routing
estimate_parasitics -global_routing -spef_file results/est_rc4.spef

report_net -corner corner0 -digits 3 clk
report_net -corner corner1 -digits 3 clk

diff_file est_rc4_corner0.spefok results/est_rc4_corner0.spef
diff_file est_rc4_corner1.spefok results/est_rc4_corner1.spef
Loading
Loading