issue66 set_min/max_delay -ignore_clock_latency on clock path

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-08-05 16:51:46 -07:00
parent 7b8720985c
commit 128deaa7c0
4 changed files with 27 additions and 7 deletions

View File

@ -144,6 +144,7 @@ public:
virtual const PathVertex *dataClkPath() const { return nullptr; } virtual const PathVertex *dataClkPath() const { return nullptr; }
virtual int setupDefaultCycles() const { return 1; } virtual int setupDefaultCycles() const { return 1; }
virtual Delay clkSkew(const StaState *sta); virtual Delay clkSkew(const StaState *sta);
virtual bool ignoreClkLatency(const StaState * /* sta */) const { return false; }
static bool less(const PathEnd *path_end1, static bool less(const PathEnd *path_end1,
const PathEnd *path_end2, const PathEnd *path_end2,
@ -206,6 +207,9 @@ protected:
PathDelay *path_delay, PathDelay *path_delay,
Arrival src_clk_arrival, Arrival src_clk_arrival,
const StaState *sta); const StaState *sta);
static bool ignoreClkLatency(const PathRef &path,
PathDelay *path_delay,
const StaState *sta);
PathRef path_; PathRef path_;
}; };
@ -569,6 +573,7 @@ public:
virtual int exceptPathCmp(const PathEnd *path_end, virtual int exceptPathCmp(const PathEnd *path_end,
const StaState *sta) const; const StaState *sta) const;
bool hasOutputDelay() const { return output_delay_ != nullptr; } bool hasOutputDelay() const { return output_delay_ != nullptr; }
virtual bool ignoreClkLatency(const StaState *sta) const;
protected: protected:
PathEndPathDelay(PathDelay *path_delay, PathEndPathDelay(PathDelay *path_delay,

View File

@ -1070,7 +1070,7 @@ PathEndLatchCheck::PathEndLatchCheck(Path *path,
clk_path_ = enable_path; clk_path_ = enable_path;
Search *search = sta->search(); Search *search = sta->search();
// Same as PathEndPathDelay::findRequired. // Same as PathEndPathDelay::findRequired.
if (path_delay_ && path_delay_->ignoreClkLatency()) if (path_delay_ && ignoreClkLatency(sta))
src_clk_arrival_ = search->pathClkPathArrival(&path_); src_clk_arrival_ = search->pathClkPathArrival(&path_);
} }
@ -1081,7 +1081,7 @@ PathEndLatchCheck::PathEndLatchCheck(Path *path,
PathVertex *disable_path, PathVertex *disable_path,
MultiCyclePath *mcp, MultiCyclePath *mcp,
PathDelay *path_delay, PathDelay *path_delay,
Delay src_clk_arrival, Delay src_clk_arrival,
Crpr crpr, Crpr crpr,
bool crpr_valid) : bool crpr_valid) :
PathEndCheck(path, check_arc, check_edge, clk_path, mcp, crpr, crpr_valid), PathEndCheck(path, check_arc, check_edge, clk_path, mcp, crpr, crpr_valid),
@ -1221,7 +1221,7 @@ PathEndLatchCheck::latchBorrowInfo(const StaState *sta,
Latches *latches = sta->latches(); Latches *latches = sta->latches();
latches->latchBorrowInfo(path_.path(), targetClkPath(), latchDisable(), latches->latchBorrowInfo(path_.path(), targetClkPath(), latchDisable(),
margin(sta), margin(sta),
path_delay_ && path_delay_->ignoreClkLatency(), path_delay_ && ignoreClkLatency(sta),
nom_pulse_width, open_latency, nom_pulse_width, open_latency,
latency_diff, open_uncertainty, latency_diff, open_uncertainty,
open_crpr, crpr_diff, max_borrow, open_crpr, crpr_diff, max_borrow,
@ -1802,7 +1802,7 @@ PathEndPathDelay::typeName() const
void void
PathEndPathDelay::findSrcClkArrival(const StaState *sta) PathEndPathDelay::findSrcClkArrival(const StaState *sta)
{ {
if (path_delay_->ignoreClkLatency()) { if (ignoreClkLatency(sta)) {
Search *search = sta->search(); Search *search = sta->search();
src_clk_arrival_ = search->pathClkPathArrival(&path_); src_clk_arrival_ = search->pathClkPathArrival(&path_);
} }
@ -1873,7 +1873,7 @@ PathEnd::pathDelaySrcClkOffset(const PathRef &path,
float offset = 0.0; float offset = 0.0;
const ClockEdge *clk_edge = path.clkEdge(sta); const ClockEdge *clk_edge = path.clkEdge(sta);
if (clk_edge) { if (clk_edge) {
if (path_delay->ignoreClkLatency()) if (ignoreClkLatency(path, path_delay, sta))
offset = -delayAsFloat(src_clk_arrival); offset = -delayAsFloat(src_clk_arrival);
else else
// Arrival includes src clock edge time that is not counted in the // Arrival includes src clock edge time that is not counted in the
@ -1883,6 +1883,14 @@ PathEnd::pathDelaySrcClkOffset(const PathRef &path,
return offset; return offset;
} }
bool
PathEnd::ignoreClkLatency(const PathRef &path,
PathDelay *path_delay,
const StaState *sta)
{
return path_delay->ignoreClkLatency() && !path.isClock(sta);
}
const ClockEdge * const ClockEdge *
PathEndPathDelay::targetClkEdge(const StaState *sta) const PathEndPathDelay::targetClkEdge(const StaState *sta) const
{ {
@ -1927,7 +1935,7 @@ Required
PathEndPathDelay::requiredTime(const StaState *sta) const PathEndPathDelay::requiredTime(const StaState *sta) const
{ {
float delay = path_delay_->delay(); float delay = path_delay_->delay();
if (path_delay_->ignoreClkLatency()) { if (ignoreClkLatency(sta)) {
if (minMax(sta) == MinMax::max()) if (minMax(sta) == MinMax::max())
return src_clk_arrival_ + delay - margin(sta); return src_clk_arrival_ + delay - margin(sta);
else else
@ -1943,6 +1951,12 @@ PathEndPathDelay::requiredTime(const StaState *sta) const
} }
} }
bool
PathEndPathDelay::ignoreClkLatency(const StaState *sta) const
{
return PathEnd::ignoreClkLatency(path_, path_delay_, sta);
}
int int
PathEndPathDelay::exceptPathCmp(const PathEnd *path_end, PathEndPathDelay::exceptPathCmp(const PathEnd *path_end,
const StaState *sta) const const StaState *sta) const

View File

@ -686,7 +686,7 @@ ReportPath::reportFull(const PathEndPathDelay *end)
// Based on reportSrcPathArrival. // Based on reportSrcPathArrival.
reportBlankLine(); reportBlankLine();
PathDelay *path_delay = end->pathDelay(); PathDelay *path_delay = end->pathDelay();
if (path_delay->ignoreClkLatency()) { if (end->ignoreClkLatency(this)) {
// Based on reportSrcPath. // Based on reportSrcPath.
reportPathHeader(); reportPathHeader();
reportPath3(end->path(), expanded, false, false, 0.0, reportPath3(end->path(), expanded, false, false, 0.0,

View File

@ -40,6 +40,7 @@
#include "SearchClass.hh" #include "SearchClass.hh"
#include "CircuitSim.hh" #include "CircuitSim.hh"
#include "ArcDelayCalc.hh" #include "ArcDelayCalc.hh"
#include "Property.hh"
#include "Sta.hh" #include "Sta.hh"
namespace sta { namespace sta {