From fd3ad755988ee185427479595a8c368c3f1b9519 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 31 Mar 2019 17:44:44 +0100 Subject: generic: Python bindings for arch construction Signed-off-by: David Shah --- generic/arch_pybindings.cc | 56 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'generic/arch_pybindings.cc') diff --git a/generic/arch_pybindings.cc b/generic/arch_pybindings.cc index 04620cd5..407dc4d4 100644 --- a/generic/arch_pybindings.cc +++ b/generic/arch_pybindings.cc @@ -125,6 +125,62 @@ void arch_wrap_python() fn_wrapper_2a_v, pass_through>::def_wrap(ctx_cls, "addClock"); + // Generic arch construction API + fn_wrapper_4a_v, + conv_from_str, pass_through, pass_through>::def_wrap(ctx_cls, "addWire", + (arg("name"), "type", "x", + "y")); + fn_wrapper_6a_v, + conv_from_str, conv_from_str, conv_from_str, pass_through, + pass_through>::def_wrap(ctx_cls, "addPip", + (arg("name"), "type", "srcWire", "dstWire", "delay", "loc")); + fn_wrapper_5a_v, + conv_from_str, conv_from_str, conv_from_str, + pass_through>::def_wrap(ctx_cls, "addAlias", + (arg("name"), "type", "srcWire", "dstWire", "delay")); + + fn_wrapper_4a_v, + conv_from_str, pass_through, pass_through>::def_wrap(ctx_cls, "addBel", + (arg("name"), "type", + "loc", "gb")); + fn_wrapper_3a_v, + conv_from_str, conv_from_str>::def_wrap(ctx_cls, "addBelInput", + (arg("bel"), "name", "wire")); + fn_wrapper_3a_v, + conv_from_str, conv_from_str>::def_wrap(ctx_cls, "addBelOutput", + (arg("bel"), "name", "wire")); + fn_wrapper_3a_v, + conv_from_str, conv_from_str>::def_wrap(ctx_cls, "addBelInout", + (arg("bel"), "name", "wire")); + + fn_wrapper_2a_v, + conv_from_str>::def_wrap(ctx_cls, "addGroupBel", (arg("group"), "bel")); + fn_wrapper_2a_v, + conv_from_str>::def_wrap(ctx_cls, "addGroupWire", (arg("group"), "wire")); + fn_wrapper_2a_v, + conv_from_str>::def_wrap(ctx_cls, "addGroupPip", (arg("group"), "pip")); + fn_wrapper_2a_v, + conv_from_str>::def_wrap(ctx_cls, "addGroupGroup", (arg("group"), "grp")); + + fn_wrapper_2a_v, + pass_through>::def_wrap(ctx_cls, "addDecalGraphic", (arg("decal"), "graphic")); + fn_wrapper_2a_v, + pass_through>::def_wrap(ctx_cls, "setWireDecal", (arg("wire"), "decalxy")); + fn_wrapper_2a_v, + pass_through>::def_wrap(ctx_cls, "setPipDecal", (arg("pip"), "decalxy")); + fn_wrapper_2a_v, + pass_through>::def_wrap(ctx_cls, "setBelDecal", (arg("bel"), "decalxy")); + fn_wrapper_2a_v, + pass_through>::def_wrap(ctx_cls, "setGroupDecal", (arg("group"), "decalxy")); + + fn_wrapper_3a_v, + conv_from_str, pass_through>::def_wrap(ctx_cls, "setWireAttr", (arg("wire"), "key", "value")); + fn_wrapper_3a_v, + conv_from_str, pass_through>::def_wrap(ctx_cls, "setBelAttr", (arg("bel"), "key", "value")); + fn_wrapper_3a_v, + conv_from_str, pass_through>::def_wrap(ctx_cls, "setPipAttr", (arg("pip"), "key", "value")); + + WRAP_MAP_UPTR(CellMap, "IdCellMap"); WRAP_MAP_UPTR(NetMap, "IdNetMap"); } -- cgit v1.2.3