diff options
author | David Shah <dave@ds0.me> | 2020-02-02 16:21:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-02 16:21:47 +0000 |
commit | aed93a9390dd909111ab4526e7f3df8d24a2ee0a (patch) | |
tree | 9cb4096654bac891aaec9ac5b2fa9a5259798e65 | |
parent | a0091eb44b3b1248409038b43143b049b43d0233 (diff) | |
parent | d5f50070d7b8de8fbddc19a41d145571b7069aa7 (diff) | |
download | nextpnr-aed93a9390dd909111ab4526e7f3df8d24a2ee0a.tar.gz nextpnr-aed93a9390dd909111ab4526e7f3df8d24a2ee0a.tar.bz2 nextpnr-aed93a9390dd909111ab4526e7f3df8d24a2ee0a.zip |
Merge pull request #389 from YosysHQ/mmicko/time_info
Add spent time info to report
-rw-r--r-- | common/router1.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/common/router1.cc b/common/router1.cc index 02c817c7..a89d870d 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -769,14 +769,19 @@ bool router1(Context *ctx, const Router1Cfg &cfg) int last_arcs_with_ripup = 0; int last_arcs_without_ripup = 0; - log_info(" | (re-)routed arcs | delta | remaining\n"); - log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs\n"); + log_info(" | (re-)routed arcs | delta | remaining| time spent |\n"); + log_info(" IterCnt | w/ripup wo/ripup | w/r wo/r | arcs| batch(sec) total(sec)|\n"); + auto prev_time = rstart; while (!router.arc_queue.empty()) { if (++iter_cnt % 1000 == 0) { - log_info("%10d | %8d %10d | %4d %5d | %9d\n", iter_cnt, router.arcs_with_ripup, + auto curr_time = std::chrono::high_resolution_clock::now(); + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f %10.02f|\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, - router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size())); + router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), + std::chrono::duration<float>(curr_time - prev_time).count(), + std::chrono::duration<float>(curr_time - rstart).count()); + prev_time = curr_time; last_arcs_with_ripup = router.arcs_with_ripup; last_arcs_without_ripup = router.arcs_without_ripup; ctx->yield(); @@ -800,12 +805,13 @@ bool router1(Context *ctx, const Router1Cfg &cfg) return false; } } - - log_info("%10d | %8d %10d | %4d %5d | %9d\n", iter_cnt, router.arcs_with_ripup, router.arcs_without_ripup, - router.arcs_with_ripup - last_arcs_with_ripup, router.arcs_without_ripup - last_arcs_without_ripup, - int(router.arc_queue.size())); - log_info("Routing complete.\n"); auto rend = std::chrono::high_resolution_clock::now(); + log_info("%10d | %8d %10d | %4d %5d | %9d| %10.02f %10.02f|\n", iter_cnt, router.arcs_with_ripup, + router.arcs_without_ripup, router.arcs_with_ripup - last_arcs_with_ripup, + router.arcs_without_ripup - last_arcs_without_ripup, int(router.arc_queue.size()), + std::chrono::duration<float>(rend - prev_time).count(), + std::chrono::duration<float>(rend - rstart).count()); + log_info("Routing complete.\n"); ctx->yield(); log_info("Route time %.02fs\n", std::chrono::duration<float>(rend - rstart).count()); |