aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pybindings.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-07 14:36:35 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-07 14:36:35 +0200
commit547d4fe3ee192ca96280626cefdbe6d180d0ef75 (patch)
treed170afb8dfe1065fa820eb623552eaa868ca143e /ice40/pybindings.cc
parentefd8722fd96147a286b79fef8d9bf22d137f720d (diff)
downloadnextpnr-547d4fe3ee192ca96280626cefdbe6d180d0ef75.tar.gz
nextpnr-547d4fe3ee192ca96280626cefdbe6d180d0ef75.tar.bz2
nextpnr-547d4fe3ee192ca96280626cefdbe6d180d0ef75.zip
ice40: Refactor PortPin and add Python binding
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/pybindings.cc')
-rw-r--r--ice40/pybindings.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/ice40/pybindings.cc b/ice40/pybindings.cc
index daf0be84..fb5d7763 100644
--- a/ice40/pybindings.cc
+++ b/ice40/pybindings.cc
@@ -46,6 +46,20 @@ void arch_wrap_python()
.def_readwrite("index", &WireId::index)
.def("nil", &WireId::nil);
+ class_<PipId>("PipId")
+ .def_readwrite("index", &PipId::index)
+ .def("nil", &WireId::nil);
+
+ class_<BelPin>("BelPin")
+ .def_readwrite("bel", &BelPin::bel)
+ .def_readwrite("pin", &BelPin::pin);
+
+ enum_<PortPin>("PortPin")
+#define X(t) .value("PIN_" #t, PIN_##t)
+#include "portpins.inc"
+ ;
+#undef X
+
class_<Chip>("Chip", init<ChipArgs>())
.def("getBelByName", &Chip::getBelByName)
.def("getWireByName", &Chip::getWireByName)