diff options
Diffstat (limited to 'common/pybindings.cc')
-rw-r--r-- | common/pybindings.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc index b15a6c79..e776e33a 100644 --- a/common/pybindings.cc +++ b/common/pybindings.cc @@ -63,6 +63,8 @@ Context *load_design_shim(std::string filename, ArchArgs args) BOOST_PYTHON_MODULE(MODULE_NAME) { + using namespace PythonConversion; + class_<GraphicElement>("GraphicElement") .def_readwrite("type", &GraphicElement::type) .def_readwrite("x1", &GraphicElement::x1) @@ -95,14 +97,14 @@ BOOST_PYTHON_MODULE(MODULE_NAME) .def_readwrite("net", &PortInfo::net) .def_readwrite("type", &PortInfo::type); - class_<CellInfo, CellInfo *>("CellInfo") + /*class_<CellInfo, CellInfo *>("CellInfo") .def_readwrite("name", &CellInfo::name) .def_readwrite("type", &CellInfo::type) .def_readwrite("ports", &CellInfo::ports) .def_readwrite("attrs", &CellInfo::attrs) .def_readwrite("params", &CellInfo::params) .def_readwrite("bel", &CellInfo::bel) - .def_readwrite("pins", &CellInfo::pins); + .def_readwrite("pins", &CellInfo::pins);*/ // WRAP_MAP(decltype(CellInfo::ports), "IdPortMap"); // WRAP_MAP(decltype(CellInfo::pins), "IdIdMap"); @@ -114,6 +116,10 @@ BOOST_PYTHON_MODULE(MODULE_NAME) // WRAP_MAP_UPTR(decltype(Context::nets), "IdNetMap"); // WRAP_MAP_UPTR(decltype(Context::cells), "IdCellMap"); + auto ci_cls = class_<ContextualWrapper<CellInfo&>>("CellInfo", no_init); + readonly_wrapper<CellInfo&, typeof(&CellInfo::type), &CellInfo::type, conv_to_str<IdString>>::def_wrap(ci_cls, + "type"); + def("parse_json", parse_json_shim); def("load_design", load_design_shim, return_value_policy<manage_new_object>()); |