aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-01 15:18:18 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-02 13:48:28 +0200
commitf353453a7faa8c7fa87acfac161cdcbebfae04d1 (patch)
tree9d3a92c9b1dfdc8f983b4075b7585c08e9025630 /ice40
parenta7415bfbc34d1c0aae6ca0843600e88cded23b1c (diff)
downloadnextpnr-f353453a7faa8c7fa87acfac161cdcbebfae04d1.tar.gz
nextpnr-f353453a7faa8c7fa87acfac161cdcbebfae04d1.tar.bz2
nextpnr-f353453a7faa8c7fa87acfac161cdcbebfae04d1.zip
Add architecture specific Python defs
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r--ice40/pybindings.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/ice40/pybindings.cc b/ice40/pybindings.cc
new file mode 100644
index 00000000..4f409194
--- /dev/null
+++ b/ice40/pybindings.cc
@@ -0,0 +1,27 @@
+#include "design.h"
+#include "chip.h"
+#include <utility>
+#include <stdexcept>
+#include <boost/python.hpp>
+#include <boost/python/enum.hpp>
+#include <boost/python/suite/indexing/vector_indexing_suite.hpp>
+#include <boost/python/suite/indexing/map_indexing_suite.hpp>
+#include <boost/python/suite/indexing/map_indexing_suite.hpp>
+
+using namespace boost::python;
+
+void arch_wrap_python() {
+ class_<ChipArgs>("ChipArgs")
+ .def_readwrite("type", &ChipArgs::type);
+
+ enum_<decltype(std::declval<ChipArgs>().type)>("iCE40Type")
+ .value("NONE", ChipArgs::NONE)
+ .value("LP384", ChipArgs::LP384)
+ .value("LP1K", ChipArgs::LP1K)
+ .value("LP8K", ChipArgs::LP8K)
+ .value("HX1K", ChipArgs::HX1K)
+ .value("HX8K", ChipArgs::HX8K)
+ .value("UP5K", ChipArgs::UP5K)
+ .export_values();
+
+}