aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/arch_pybindings_shared.h3
-rw-r--r--python/delay_vs_fanout.py10
2 files changed, 13 insertions, 0 deletions
diff --git a/common/arch_pybindings_shared.h b/common/arch_pybindings_shared.h
index 46f1f9be..f44aa70e 100644
--- a/common/arch_pybindings_shared.h
+++ b/common/arch_pybindings_shared.h
@@ -27,6 +27,9 @@ fn_wrapper_2a_v<Context, decltype(&Context::addBelToRegion), &Context::addBelToR
fn_wrapper_2a_v<Context, decltype(&Context::constrainCellToRegion), &Context::constrainCellToRegion,
conv_from_str<IdString>, conv_from_str<IdString>>::def_wrap(ctx_cls, "constrainCellToRegion");
+fn_wrapper_2a<Context, decltype(&Context::getNetinfoRouteDelay), &Context::getNetinfoRouteDelay, pass_through<delay_t>,
+ addr_and_unwrap<NetInfo>, unwrap_context<PortRef &>>::def_wrap(ctx_cls, "getNetinfoRouteDelay");
+
fn_wrapper_1a<Context, decltype(&Context::createNet), &Context::createNet, deref_and_wrap<NetInfo>,
conv_from_str<IdString>>::def_wrap(ctx_cls, "createNet");
fn_wrapper_3a_v<Context, decltype(&Context::connectPort), &Context::connectPort, conv_from_str<IdString>,
diff --git a/python/delay_vs_fanout.py b/python/delay_vs_fanout.py
new file mode 100644
index 00000000..c417ac78
--- /dev/null
+++ b/python/delay_vs_fanout.py
@@ -0,0 +1,10 @@
+with open("delay_vs_fanout.csv", "w") as f:
+ print("fanout,delay", file=f)
+ for net_name, net in ctx.nets:
+ if net.driver.cell is None:
+ continue
+ if net.driver.cell.type == "DCCA":
+ continue # ignore global clocks
+ for user in net.users:
+ print(f"{len(net.users)},{ctx.getNetinfoRouteDelay(net, user)}", file=f)
+