Fixing the Python bindings following Context/Arch refactoring

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-06-23 19:51:22 +02:00
parent 3407d76383
commit 37bad1f99e
2 changed files with 6 additions and 4 deletions

View File

@ -108,7 +108,7 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
WRAP_MAP(decltype(CellInfo::ports), "IdPortMap"); WRAP_MAP(decltype(CellInfo::ports), "IdPortMap");
// WRAP_MAP(decltype(CellInfo::pins), "IdIdMap"); // WRAP_MAP(decltype(CellInfo::pins), "IdIdMap");
class_<Context, Context *>("Context", no_init) class_<BaseCtx, BaseCtx *>("BaseCtx", no_init)
.def_readwrite("nets", &Context::nets) .def_readwrite("nets", &Context::nets)
.def_readwrite("cells", &Context::cells); .def_readwrite("cells", &Context::cells);
@ -123,6 +123,8 @@ BOOST_PYTHON_MODULE(MODULE_NAME)
.def(self < self) .def(self < self)
.def(self == self); .def(self == self);
arch_wrap_python(); arch_wrap_python();
class_<Context, Context *, bases<Arch>>("Context", no_init).def("checksum", &Context::checksum);
} }
void arch_appendinittab() { PyImport_AppendInittab(TOSTRING(MODULE_NAME), PYINIT_MODULE_NAME); } void arch_appendinittab() { PyImport_AppendInittab(TOSTRING(MODULE_NAME), PYINIT_MODULE_NAME); }

View File

@ -53,7 +53,7 @@ void arch_wrap_python()
; ;
#undef X #undef X
class_<Arch>("Arch", init<ArchArgs>()) class_<Arch, Arch *, bases<BaseCtx>>("Arch", init<ArchArgs>())
.def("getBelByName", &Arch::getBelByName) .def("getBelByName", &Arch::getBelByName)
.def("getWireByName", &Arch::getWireByName) .def("getWireByName", &Arch::getWireByName)
.def("getBelName", &Arch::getBelName) .def("getBelName", &Arch::getBelName)