cycle accting for negative clock edge

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2021-08-18 12:30:05 -07:00
parent 243d88292f
commit 38a097f8a7
2 changed files with 14 additions and 2 deletions

View File

@ -66,6 +66,7 @@ private:
int tgt_cycle,
float delay,
float req);
int firstCycle(const ClockEdge *clk_edge) const;
const ClockEdge *src_;
const ClockEdge *tgt_;

View File

@ -72,13 +72,13 @@ CycleAccting::findDelays(StaState *sta)
bool tgt_past_src = false;
bool src_past_tgt = false;
int tgt_cycle, src_cycle;
for (tgt_cycle = (tgt_->time() < tgt_period) ? 0 : -1;
for (tgt_cycle = firstCycle(tgt_);
tgt_cycle <= tgt_max_cycle;
tgt_cycle++) {
double tgt_cycle_start = tgt_cycle * tgt_period;
double tgt_time = tgt_cycle_start + tgt_->time();
double tgt_opp_time = tgt_cycle_start + tgt_opp_time1;
for (src_cycle = (src_->time() < src_period) ? 0 : -1;
for (src_cycle = firstCycle(src_);
;
src_cycle++) {
double src_cycle_start = src_cycle * src_period;
@ -205,6 +205,17 @@ CycleAccting::findDelays(StaState *sta)
findDefaultArrivalSrcDelays();
}
int
CycleAccting::firstCycle(const ClockEdge *clk_edge) const
{
if (clk_edge->time() < 0)
return 1;
else if (clk_edge->time() < clk_edge->clock()->period())
return 0;
else
return -1;
}
void
CycleAccting::setSetupAccting(int src_cycle,
int tgt_cycle,