From 5f3b10bdf26c971565c6e0e043f3fb5eb8c5aad6 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 12 Jun 2019 21:41:33 -0700 Subject: [PATCH] mv GraphDelayCalc1::isDriver to Vertex --- dcalc/GraphDelayCalc1.cc | 22 ++-------------------- dcalc/GraphDelayCalc1.hh | 1 - graph/Graph.cc | 17 +++++++++++++++++ graph/Graph.hh | 1 + tcl/Sdc.tcl | 2 +- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/dcalc/GraphDelayCalc1.cc b/dcalc/GraphDelayCalc1.cc index ba5155ec..efcc58f4 100644 --- a/dcalc/GraphDelayCalc1.cc +++ b/dcalc/GraphDelayCalc1.cc @@ -574,7 +574,7 @@ void GraphDelayCalc1::seedRootSlew(Vertex *vertex, ArcDelayCalc *arc_delay_calc) { - if (isDriver(vertex)) + if (vertex->isDriver(network_)) seedDrvrSlew(vertex, arc_delay_calc); else seedLoadSlew(vertex); @@ -859,7 +859,7 @@ GraphDelayCalc1::findVertexDelay(Vertex *vertex, vertex->name(sdc_network_), network_->cellName(network_->instance(pin))); if (network_->isLeaf(pin)) { - if (isDriver(vertex)) { + if (vertex->isDriver(network_)) { bool delay_changed = findDriverDelays(vertex, arc_delay_calc); if (propagate) { if (network_->direction(pin)->isInternal()) @@ -896,24 +896,6 @@ GraphDelayCalc1::enqueueTimingChecksEdges(Vertex *vertex) } } -bool -GraphDelayCalc1::isDriver(Vertex *vertex) -{ - Pin *pin = vertex->pin(); - PortDirection *dir = network_->direction(pin); - bool top_level_port = network_->isTopLevelPort(pin); - return ((top_level_port - && (dir->isInput() - || (dir->isBidirect() - && vertex->isBidirectDriver()))) - || (!top_level_port - && (dir->isOutput() - || dir->isTristate() - || (dir->isBidirect() - && vertex->isBidirectDriver()) - || dir->isInternal()))); -} - bool GraphDelayCalc1::findDriverDelays(Vertex *drvr_vertex, ArcDelayCalc *arc_delay_calc) diff --git a/dcalc/GraphDelayCalc1.hh b/dcalc/GraphDelayCalc1.hh index e081637f..17b0f269 100644 --- a/dcalc/GraphDelayCalc1.hh +++ b/dcalc/GraphDelayCalc1.hh @@ -213,7 +213,6 @@ protected: Parasitic *drvr_parasitic, const TransRiseFall *tr, const DcalcAnalysisPt *dcalc_ap) const; - bool isDriver(Vertex *vertex); // Observer for edge delay changes. DelayCalcObserver *observer_; diff --git a/graph/Graph.cc b/graph/Graph.cc index 6f0eb1ff..9bd5cabd 100644 --- a/graph/Graph.cc +++ b/graph/Graph.cc @@ -1170,6 +1170,23 @@ Vertex::name(const Network *network) const return network->pathName(pin_); } +bool +Vertex::isDriver(const Network *network) const +{ + PortDirection *dir = network->direction(pin_); + bool top_level_port = network->isTopLevelPort(pin_); + return ((top_level_port + && (dir->isInput() + || (dir->isBidirect() + && is_bidirect_drvr_))) + || (!top_level_port + && (dir->isOutput() + || dir->isTristate() + || (dir->isBidirect() + && is_bidirect_drvr_) + || dir->isInternal()))); +} + void Vertex::setLevel(Level level) { diff --git a/graph/Graph.hh b/graph/Graph.hh index 05f79c87..c230f24f 100644 --- a/graph/Graph.hh +++ b/graph/Graph.hh @@ -266,6 +266,7 @@ public: // Pin path with load/driver suffix for bidirects. const char *name(const Network *network) const; bool isBidirectDriver() const { return is_bidirect_drvr_; } + bool isDriver(const Network *network) const; Level level() const { return level_; } void setLevel(Level level); bool isRoot() const{ return level_ == 0; } diff --git a/tcl/Sdc.tcl b/tcl/Sdc.tcl index 662516a1..4625f2b7 100644 --- a/tcl/Sdc.tcl +++ b/tcl/Sdc.tcl @@ -2365,7 +2365,7 @@ define_cmd_args "set_load" \ proc set_load { args } { parse_key_args "set_load" args keys {-corner} \ - flags {-rise -fall -min -max -subtract_pin_load -pin_load -wire_load}\ + flags {-rise -fall -min -max -subtract_pin_load -pin_load -wire_load}\ check_argc_eq2 "set_load" $args