diff options
author | David Shah <davey1576@gmail.com> | 2018-06-07 15:04:07 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-07 15:04:07 +0200 |
commit | 1d39924c1417295c8c24598d362293f0eff2af89 (patch) | |
tree | 57b73c4b044cc5d24de682c58a20c632e1170916 /ice40 | |
parent | 547d4fe3ee192ca96280626cefdbe6d180d0ef75 (diff) | |
download | nextpnr-1d39924c1417295c8c24598d362293f0eff2af89.tar.gz nextpnr-1d39924c1417295c8c24598d362293f0eff2af89.tar.bz2 nextpnr-1d39924c1417295c8c24598d362293f0eff2af89.zip |
ice40: More Python bindings and examples
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40')
-rw-r--r-- | ice40/main.cc | 1 | ||||
-rw-r--r-- | ice40/pybindings.cc | 17 |
2 files changed, 17 insertions, 1 deletions
diff --git a/ice40/main.cc b/ice40/main.cc index d0becdd6..c65013eb 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -161,6 +161,7 @@ int main(int argc, char *argv[]) Design design(chipArgs); init_python(argv[0]); python_export_global("design", design); + python_export_global("chip", design.chip); if (vm.count("test")) { int bel_count = 0, wire_count = 0, pip_count = 0; diff --git a/ice40/pybindings.cc b/ice40/pybindings.cc index fb5d7763..f19afce4 100644 --- a/ice40/pybindings.cc +++ b/ice40/pybindings.cc @@ -66,7 +66,22 @@ void arch_wrap_python() .def("getBelName", &Chip::getBelName) .def("getWireName", &Chip::getWireName) .def("getBels", &Chip::getBels) - .def("getWires", &Chip::getWires); + .def("getBelType", &Chip::getBelType) + .def("getWireBelPin", &Chip::getWireBelPin) + .def("getBelPinUphill", &Chip::getBelPinUphill) + .def("getBelPinsDownhill", &Chip::getBelPinsDownhill) + .def("getWires", &Chip::getWires) + .def("getPipByName", &Chip::getPipByName) + .def("getPipName", &Chip::getPipName) + .def("getPips", &Chip::getPips) + .def("getPipSrcWire", &Chip::getPipSrcWire) + .def("getPipDstWire", &Chip::getPipDstWire) + .def("getPipDelay", &Chip::getPipDelay) + .def("getPipsDownhill", &Chip::getPipsDownhill) + .def("getPipsUphill", &Chip::getPipsUphill) + .def("getWireAliases", &Chip::getWireAliases) + .def("getBelPosition", &Chip::getBelPosition) + .def("getWirePosition", &Chip::getWirePosition); WRAP_RANGE(Bel); WRAP_RANGE(BelPin); |