aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/pybindings.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ice40/pybindings.cc')
-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();
+
+}