timing: Multiple clock analysis

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2018-11-02 17:26:14 +00:00
parent 9687f7d1da
commit 143abc6034
2 changed files with 31 additions and 9 deletions

View File

@ -416,6 +416,12 @@ struct TimingConstraint
std::unordered_set<TimingConstrObjectId> to; std::unordered_set<TimingConstrObjectId> to;
}; };
inline bool operator==(const std::pair<const TimingConstrObjectId, TimingConstraint *> &a,
const std::pair<TimingConstrObjectId, TimingConstraint *> &b)
{
return a.first == b.first && a.second == b.second;
}
struct DeterministicRNG struct DeterministicRNG
{ {
uint64_t rngstate; uint64_t rngstate;

View File

@ -35,11 +35,15 @@ struct ClockEvent
{ {
IdString clock; IdString clock;
ClockEdge edge; ClockEdge edge;
bool operator==(const ClockEvent &other) const { return clock == other.clock && edge == other.edge; }
}; };
struct ClockPair struct ClockPair
{ {
ClockEvent start, end; ClockEvent start, end;
bool operator==(const ClockPair &other) const { return start == other.start && end == other.end; }
}; };
} // namespace } // namespace
@ -353,10 +357,15 @@ struct Timing
bool is_path = ctx->getCellDelay(usr.cell, usr.port, port.first, comb_delay); bool is_path = ctx->getCellDelay(usr.cell, usr.port, port.first, comb_delay);
if (!is_path) if (!is_path)
continue; continue;
auto path_budget = net_data.at(port.second.net).at(startdomain.first).min_remaining_budget; if (net_data.count(port.second.net) &&
net_data.at(port.second.net).count(startdomain.first)) {
auto path_budget =
net_data.at(port.second.net).at(startdomain.first).min_remaining_budget;
auto budget_share = budget_override ? 0 : path_budget / net_length_plus_one; auto budget_share = budget_override ? 0 : path_budget / net_length_plus_one;
usr.budget = std::min(usr.budget, net_delay + budget_share); usr.budget = std::min(usr.budget, net_delay + budget_share);
net_min_remaining_budget = std::min(net_min_remaining_budget, path_budget - budget_share); net_min_remaining_budget =
std::min(net_min_remaining_budget, path_budget - budget_share);
}
} }
} }
} }
@ -390,6 +399,7 @@ struct Timing
continue; continue;
// And find the fanin net with the latest arrival time // And find the fanin net with the latest arrival time
if (net_data.at(port.second.net).count(crit_pair.first.start)) {
const auto net_arrival = net_data.at(port.second.net).at(crit_pair.first.start).max_arrival; const auto net_arrival = net_data.at(port.second.net).at(crit_pair.first.start).max_arrival;
if (net_arrival > max_arrival) { if (net_arrival > max_arrival) {
max_arrival = net_arrival; max_arrival = net_arrival;
@ -397,6 +407,8 @@ struct Timing
} }
} }
}
if (!crit_ipin) if (!crit_ipin)
break; break;
@ -539,14 +551,18 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_path)
} }
} }
log_break(); log_break();
}
log_break();
for (auto &clock : clock_reports) {
double Fmax; double Fmax;
if (clock.second.first.start.edge == clock.second.first.end.edge) if (clock.second.first.start.edge == clock.second.first.end.edge)
Fmax = 1000 / ctx->getDelayNS(clock.second.second.path_delay); Fmax = 1000 / ctx->getDelayNS(clock.second.second.path_delay);
else else
Fmax = 500 / ctx->getDelayNS(clock.second.second.path_delay); Fmax = 500 / ctx->getDelayNS(clock.second.second.path_delay);
log_info("Max frequency for clock '%s': %.02f MHz\n", clock.first.c_str(ctx), Fmax); log_info("Max frequency for clock '%s': %.02f MHz\n", clock.first.c_str(ctx), Fmax);
log_break();
} }
log_break();
} }
} }