aboutsummaryrefslogtreecommitdiffstats
path: root/common/timing.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2018-12-01 13:43:12 +0000
committerDavid Shah <dave@ds0.me>2018-12-06 10:53:01 +0000
commit2de506c071b090c18977a594efbd6effd0315bf5 (patch)
tree20565f5f9f84a947641944b37a9bf30708d7c06a /common/timing.cc
parent83e32775775cc06d0f70a18e2a18089c38ff3c35 (diff)
downloadnextpnr-2de506c071b090c18977a594efbd6effd0315bf5.tar.gz
nextpnr-2de506c071b090c18977a594efbd6effd0315bf5.tar.bz2
nextpnr-2de506c071b090c18977a594efbd6effd0315bf5.zip
timing_opt: Functions to calculate arc delay limits
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/timing.cc')
-rw-r--r--common/timing.cc17
1 files changed, 9 insertions, 8 deletions
diff --git a/common/timing.cc b/common/timing.cc
index ebe3a177..1f48261d 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -85,14 +85,7 @@ struct CriticalPath
delay_t path_period;
};
-// Data for the timing optimisation algorithm
-struct NetCriticalityInfo
-{
- // One each per user
- std::vector<delay_t> slack;
- std::vector<float> criticality;
- unsigned max_path_length = 0;
-};
+
typedef std::unordered_map<ClockPair, CriticalPath> CriticalPathMap;
typedef std::unordered_map<IdString, NetCriticalityInfo> NetCriticalityMap;
@@ -599,6 +592,7 @@ struct Timing
nc.criticality.at(i) = std::max(nc.criticality.at(i), criticality);
}
nc.max_path_length = std::max(nc.max_path_length, nd.max_path_length);
+ nc.cd_worst_slack = std::min(nc.cd_worst_slack, worst_slack.at(startdomain.first));
}
}
}
@@ -914,4 +908,11 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
}
}
+void get_criticalities(Context *ctx, NetCriticalityMap *net_crit) {
+ CriticalPathMap crit_paths;
+ net_crit->clear();
+ Timing timing(ctx, true, true, &crit_paths, nullptr, net_crit);
+ timing.walk_paths();
+}
+
NEXTPNR_NAMESPACE_END