From de311e052fdb749d4acfd6608f6b416a4206e6ae Mon Sep 17 00:00:00 2001 From: gatecat Date: Mon, 23 Aug 2021 20:51:53 +0100 Subject: [PATCH] python: Allow querying route delays Signed-off-by: gatecat --- common/arch_pybindings_shared.h | 3 +++ python/delay_vs_fanout.py | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 python/delay_vs_fanout.py 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, conv_from_str>::def_wrap(ctx_cls, "constrainCellToRegion"); +fn_wrapper_2a, + addr_and_unwrap, unwrap_context>::def_wrap(ctx_cls, "getNetinfoRouteDelay"); + fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "createNet"); fn_wrapper_3a_v, 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) +