python: Allow querying route delays

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-08-23 20:51:53 +01:00
parent 897a2fccb6
commit de311e052f
2 changed files with 13 additions and 0 deletions

View File

@ -27,6 +27,9 @@ fn_wrapper_2a_v<Context, decltype(&Context::addBelToRegion), &Context::addBelToR
fn_wrapper_2a_v<Context, decltype(&Context::constrainCellToRegion), &Context::constrainCellToRegion, fn_wrapper_2a_v<Context, decltype(&Context::constrainCellToRegion), &Context::constrainCellToRegion,
conv_from_str<IdString>, conv_from_str<IdString>>::def_wrap(ctx_cls, "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>, fn_wrapper_1a<Context, decltype(&Context::createNet), &Context::createNet, deref_and_wrap<NetInfo>,
conv_from_str<IdString>>::def_wrap(ctx_cls, "createNet"); conv_from_str<IdString>>::def_wrap(ctx_cls, "createNet");
fn_wrapper_3a_v<Context, decltype(&Context::connectPort), &Context::connectPort, conv_from_str<IdString>, fn_wrapper_3a_v<Context, decltype(&Context::connectPort), &Context::connectPort, conv_from_str<IdString>,

10
python/delay_vs_fanout.py Normal file
View File

@ -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)