report_clock_skews include uncertainty

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-05-09 16:56:23 -07:00
parent 51596f8903
commit 2ddd8900a9
3 changed files with 38 additions and 19 deletions

View File

@ -179,6 +179,11 @@ public:
const PathVertex *tgt_clk_path, const PathVertex *tgt_clk_path,
const TimingRole *check_role, const TimingRole *check_role,
const StaState *sta); const StaState *sta);
// Non inter-clock uncertainty.
static float checkTgtClkUncertainty(const PathVertex *tgt_clk_path,
const ClockEdge *tgt_clk_edge,
const TimingRole *check_role,
const StaState *sta);
static float checkSetupMcpAdjustment(const ClockEdge *src_clk_edge, static float checkSetupMcpAdjustment(const ClockEdge *src_clk_edge,
const ClockEdge *tgt_clk_edge, const ClockEdge *tgt_clk_edge,
const MultiCyclePath *mcp, const MultiCyclePath *mcp,
@ -187,10 +192,6 @@ public:
protected: protected:
PathEnd(Path *path); PathEnd(Path *path);
static float checkNonInterClkUncertainty(const PathVertex *tgt_clk_path,
const ClockEdge *tgt_clk_edge,
const TimingRole *check_role,
const StaState *sta);
static void checkInterClkUncertainty(const ClockEdge *src_clk_edge, static void checkInterClkUncertainty(const ClockEdge *src_clk_edge,
const ClockEdge *tgt_clk_edge, const ClockEdge *tgt_clk_edge,
const TimingRole *check_role, const TimingRole *check_role,

View File

@ -34,6 +34,7 @@
#include "SearchPred.hh" #include "SearchPred.hh"
#include "Search.hh" #include "Search.hh"
#include "Crpr.hh" #include "Crpr.hh"
#include "PathEnd.hh"
namespace sta { namespace sta {
@ -56,6 +57,7 @@ public:
float srcClkTreeDelay(StaState *sta); float srcClkTreeDelay(StaState *sta);
float tgtClkTreeDelay(StaState *sta); float tgtClkTreeDelay(StaState *sta);
Crpr crpr(StaState *sta); Crpr crpr(StaState *sta);
float uncertainty(StaState *sta);
float skew() const { return skew_; } float skew() const { return skew_; }
private: private:
@ -78,7 +80,10 @@ ClkSkew::ClkSkew(PathVertex *src_path,
{ {
src_path_ = src_path; src_path_ = src_path;
tgt_path_ = tgt_path; tgt_path_ = tgt_path;
skew_ = srcLatency(sta) - tgtLatency(sta) - delayAsFloat(crpr(sta)); skew_ = srcLatency(sta)
- tgtLatency(sta)
- delayAsFloat(crpr(sta))
+ uncertainty(sta);
} }
ClkSkew::ClkSkew(const ClkSkew &clk_skew) ClkSkew::ClkSkew(const ClkSkew &clk_skew)
@ -144,6 +149,17 @@ ClkSkew::crpr(StaState *sta)
return check_crpr->checkCrpr(&src_path_, &tgt_path_); return check_crpr->checkCrpr(&src_path_, &tgt_path_);
} }
float
ClkSkew::uncertainty(StaState *sta)
{
TimingRole *check_role = (src_path_.minMax(sta) == SetupHold::max())
? TimingRole::setup()
: TimingRole::hold();
// Uncertainty decreases slack, but increases skew.
return -PathEnd::checkTgtClkUncertainty(&tgt_path_, tgt_path_.clkEdge(sta),
check_role, sta);
}
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
ClkSkews::ClkSkews(StaState *sta) : ClkSkews::ClkSkews(StaState *sta) :
@ -187,6 +203,7 @@ ClkSkews::reportClkSkew(ClkSkew &clk_skew,
float tgt_latency = clk_skew.tgtLatency(this); float tgt_latency = clk_skew.tgtLatency(this);
float src_clk_tree_delay = clk_skew.srcClkTreeDelay(this); float src_clk_tree_delay = clk_skew.srcClkTreeDelay(this);
float tgt_clk_tree_delay = clk_skew.tgtClkTreeDelay(this); float tgt_clk_tree_delay = clk_skew.tgtClkTreeDelay(this);
float uncertainty = clk_skew.uncertainty(this);
if (src_clk_tree_delay != 0.0) if (src_clk_tree_delay != 0.0)
src_latency -= src_clk_tree_delay; src_latency -= src_clk_tree_delay;
@ -195,7 +212,7 @@ ClkSkews::reportClkSkew(ClkSkew &clk_skew,
sdc_network_->pathName(src_path->pin(this)), sdc_network_->pathName(src_path->pin(this)),
src_path->transition(this)->asString()); src_path->transition(this)->asString());
if (src_clk_tree_delay != 0.0) if (src_clk_tree_delay != 0.0)
report_->reportLine("%7s source clock tree delay", report_->reportLine("%7s source internal clock delay",
time_unit->asString(src_clk_tree_delay, digits)); time_unit->asString(src_clk_tree_delay, digits));
if (tgt_clk_tree_delay != 0.0) if (tgt_clk_tree_delay != 0.0)
@ -205,9 +222,11 @@ ClkSkews::reportClkSkew(ClkSkew &clk_skew,
sdc_network_->pathName(tgt_path->pin(this)), sdc_network_->pathName(tgt_path->pin(this)),
tgt_path->transition(this)->asString()); tgt_path->transition(this)->asString());
if (tgt_clk_tree_delay != 0.0) if (tgt_clk_tree_delay != 0.0)
report_->reportLine("%7s target clock tree delay", report_->reportLine("%7s target internal clock delay",
time_unit->asString(-tgt_clk_tree_delay, digits)); time_unit->asString(-tgt_clk_tree_delay, digits));
if (uncertainty != 0.0)
report_->reportLine("%7s clock uncertainty",
time_unit->asString(uncertainty, digits));
report_->reportLine("%7s CRPR", report_->reportLine("%7s CRPR",
time_unit->asString(delayAsFloat(-clk_skew.crpr(this)), time_unit->asString(delayAsFloat(-clk_skew.crpr(this)),
digits)); digits));

View File

@ -355,12 +355,11 @@ PathEnd::checkClkUncertainty(const ClockEdge *src_clk_edge,
if (inter_exists) if (inter_exists)
return inter_clk; return inter_clk;
else else
return checkNonInterClkUncertainty(tgt_clk_path, tgt_clk_edge, return checkTgtClkUncertainty(tgt_clk_path, tgt_clk_edge, check_role, sta);
check_role, sta);
} }
float float
PathEnd::checkNonInterClkUncertainty(const PathVertex *tgt_clk_path, PathEnd::checkTgtClkUncertainty(const PathVertex *tgt_clk_path,
const ClockEdge *tgt_clk_edge, const ClockEdge *tgt_clk_edge,
const TimingRole *check_role, const TimingRole *check_role,
const StaState *sta) const StaState *sta)
@ -637,8 +636,7 @@ PathEndClkConstrained::targetClkArrivalNoCrpr(const StaState *sta) const
Delay Delay
PathEndClkConstrained::targetClkDelay(const StaState *sta) const PathEndClkConstrained::targetClkDelay(const StaState *sta) const
{ {
return checkTgtClkDelay(targetClkPath(), targetClkEdge(sta), return checkTgtClkDelay(targetClkPath(), targetClkEdge(sta), checkRole(sta), sta);
checkRole(sta), sta);
} }
Delay Delay
@ -666,8 +664,7 @@ PathEndClkConstrained::targetNonInterClkUncertainty(const StaState *sta) const
// This returns non inter-clock uncertainty. // This returns non inter-clock uncertainty.
return 0.0; return 0.0;
else else
return checkNonInterClkUncertainty(targetClkPath(), tgt_clk_edge, return checkTgtClkUncertainty(targetClkPath(), tgt_clk_edge, check_role, sta);
check_role, sta);
} }
float float
@ -1018,7 +1015,9 @@ Delay
PathEndCheck::clkSkew(const StaState *sta) PathEndCheck::clkSkew(const StaState *sta)
{ {
commonClkPessimism(sta); commonClkPessimism(sta);
return sourceClkDelay(sta) - targetClkDelay(sta) - crpr_; return sourceClkDelay(sta) - targetClkDelay(sta) - crpr_
// Uncertainty decreases slack, but increases skew.
- checkTgtClkUncertainty(&clk_path_, clk_path_.clkEdge(sta), checkRole(sta), sta);
} }
Delay Delay