aboutsummaryrefslogtreecommitdiffstats
path: root/common/pybindings.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-07 12:40:31 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-07 12:40:31 +0200
commita5249da02d2a55d4b838dd8c29e159513dd71418 (patch)
treeb290c203607b8d05a4c10e0febde92c027890a3e /common/pybindings.cc
parente576f71838290ff12b98145fb02af84563fc03c1 (diff)
downloadnextpnr-a5249da02d2a55d4b838dd8c29e159513dd71418.tar.gz
nextpnr-a5249da02d2a55d4b838dd8c29e159513dd71418.tar.bz2
nextpnr-a5249da02d2a55d4b838dd8c29e159513dd71418.zip
Working on global Python design object
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'common/pybindings.cc')
-rw-r--r--common/pybindings.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc
index 04b2fa27..4ae83cb0 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -80,10 +80,17 @@ BOOST_PYTHON_MODULE (MODULE_NAME) {
.def_readwrite("bel", &CellInfo::bel)
.def_readwrite("pins", &CellInfo::pins);
- class_<Design>("Design", no_init)
+ WRAP_MAP(decltype(CellInfo::ports), "IdPortMap");
+ //WRAP_MAP(decltype(CellInfo::pins), "IdIdMap");
+
+ class_<Design, Design*>("Design", no_init)
.def_readwrite("chip", &Design::chip)
.def_readwrite("nets", &Design::nets)
.def_readwrite("cells", &Design::cells);
+
+ WRAP_MAP(decltype(Design::nets), "IdNetMap");
+ WRAP_MAP(decltype(Design::cells), "IdCellMap");
+
arch_wrap_python();
}
@@ -104,6 +111,7 @@ void init_python(const char *executable) {
emb::append_inittab();
Py_SetProgramName(program);
Py_Initialize();
+ PyImport_ImportModule(TOSTRING(MODULE_NAME));
} catch (boost::python::error_already_set const &) {
// Parse and output the exception
std::string perror_str = parse_python_exception();