aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/pybindings.cc9
-rw-r--r--common/pywrappers.h2
-rw-r--r--common/router1.cc24
3 files changed, 25 insertions, 10 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc
index 3b2a3744..51da00e9 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -129,6 +129,15 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
.value("PORT_INOUT", PORT_INOUT)
.export_values();
+ enum_<PlaceStrength>("PlaceStrength")
+ .value("STRENGTH_NONE", STRENGTH_NONE)
+ .value("STRENGTH_WEAK", STRENGTH_WEAK)
+ .value("STRENGTH_STRONG", STRENGTH_STRONG)
+ .value("STRENGTH_FIXED", STRENGTH_FIXED)
+ .value("STRENGTH_LOCKED", STRENGTH_LOCKED)
+ .value("STRENGTH_USER", STRENGTH_USER)
+ .export_values();
+
typedef std::unordered_map<IdString, Property> AttrMap;
typedef std::unordered_map<IdString, PortInfo> PortMap;
typedef std::unordered_map<IdString, IdString> IdIdMap;
diff --git a/common/pywrappers.h b/common/pywrappers.h
index 1d970985..d50af4c3 100644
--- a/common/pywrappers.h
+++ b/common/pywrappers.h
@@ -274,7 +274,7 @@ template <typename Class, typename FuncT, FuncT fn, typename arg1_conv> struct f
}
};
-// Two parameters, one return
+// Two parameters, no return
template <typename Class, typename FuncT, FuncT fn, typename arg1_conv, typename arg2_conv> struct fn_wrapper_2a_v
{
using class_type = typename WrapIfNotContext<Class>::maybe_wrapped_t;
diff --git a/common/router1.cc b/common/router1.cc
index f97cb89b..ef788fc2 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -793,14 +793,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();
@@ -824,12 +829,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());