From a382d906efda9b096c4e841ebcff83be85fa3e5c Mon Sep 17 00:00:00 2001 From: David Shah Date: Tue, 3 Jul 2018 10:55:32 +0200 Subject: python: Developing context wrappers for maps Signed-off-by: David Shah --- ice40/pybindings.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ice40') diff --git a/ice40/pybindings.cc b/ice40/pybindings.cc index c824f822..45307477 100644 --- a/ice40/pybindings.cc +++ b/ice40/pybindings.cc @@ -95,13 +95,28 @@ void arch_wrap_python() conv_from_str>::def_wrap(ctx_cls, "getBelType"); fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "checkBelAvail"); + fn_wrapper_0a>::def_wrap(ctx_cls, "getBels"); fn_wrapper_0a>::def_wrap( ctx_cls, "getWires"); + fn_wrapper_0a>::def_wrap( + ctx_cls, "getPips"); + fn_wrapper_1a, conv_from_str>::def_wrap(ctx_cls, "getPipsDownhill"); + fn_wrapper_1a, + conv_from_str>::def_wrap(ctx_cls, "getPipsUphill"); + + fn_wrapper_1a, + conv_from_str>::def_wrap(ctx_cls, "getPipSrcWire"); + fn_wrapper_1a, + conv_from_str>::def_wrap(ctx_cls, "getPipDstWire"); + + typedef std::unordered_map> CellMap; + readonly_wrapper>::def_wrap(ctx_cls, + "cells"); /* .def("getBelByName", &Arch::getBelByName) .def("getWireByName", &Arch::getWireByName) @@ -130,6 +145,7 @@ void arch_wrap_python() WRAP_RANGE(AllPip, conv_to_str); WRAP_RANGE(Pip, conv_to_str); + WRAP_MAP_UPTR(CellMap, "IdCellMap"); // WRAP_RANGE(BelPin); // WRAP_RANGE(Wire); // WRAP_RANGE(AllPip); -- cgit v1.2.3