HAL
v4.5.0-124-g47ab54673
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
python_bindings.cpp
Go to the documentation of this file.
1
#include "pybind11/operators.h"
2
#include "pybind11/pybind11.h"
3
#include "pybind11/stl.h"
4
#include "pybind11/stl_bind.h"
5
#include "
hal_core/python_bindings/python_bindings.h
"
6
7
#include "
genlib_writer/plugin_genlib_writer.h
"
8
9
namespace
py
=
pybind11
;
10
11
namespace
hal
12
{
13
14
// the name in PYBIND11_MODULE/PYBIND11_PLUGIN *MUST* match the filename of the output library (without extension),
15
// otherwise you will get "ImportError: dynamic module does not define module export function" when importing the module
16
17
#ifdef PYBIND11_MODULE
18
PYBIND11_MODULE(genlib_writer, m)
19
{
20
m.doc() =
"hal GenlibWriterPlugin python bindings"
;
21
#else
22
PYBIND11_PLUGIN
(genlib_writer)
23
{
24
py::module
m(
"genlib_writer"
,
"hal GenlibWriterPlugin python bindings"
);
25
#endif
// ifdef PYBIND11_MODULE
26
27
py::class_<GenlibWriterPlugin, RawPtrWrapper<GenlibWriterPlugin>,
BasePluginInterface
>(m,
"GenlibWriterPlugin"
)
28
.def_property_readonly(
"name"
, &
GenlibWriterPlugin::get_name
)
29
.def(
"get_name"
, &
GenlibWriterPlugin::get_name
)
30
.def_property_readonly(
"version"
, &
GenlibWriterPlugin::get_version
)
31
.def(
"get_version"
, &
GenlibWriterPlugin::get_version
)
32
;
33
34
#ifndef PYBIND11_MODULE
35
return
m.ptr();
36
#endif
// PYBIND11_MODULE
37
}
38
}
hal::BasePluginInterface
Definition:
plugin_interface_base.h:59
hal::GenlibWriterPlugin::get_version
std::string get_version() const override
Definition:
plugin_genlib_writer.cpp:19
hal::GenlibWriterPlugin::get_name
std::string get_name() const override
Definition:
plugin_genlib_writer.cpp:14
hal::ShortestPath::module
const Module * module(const Gate *g, const NodeBoxes &boxes)
Definition:
graph_graphics_view.cpp:751
hal
Definition:
defines.h:45
hal::PYBIND11_PLUGIN
PYBIND11_PLUGIN(hal_py)
Definition:
python_bindings.cpp:10
pybind11
Definition:
python_bindings.h:250
plugin_genlib_writer.h
python_bindings.h
plugins
genlib_writer
python
python_bindings.cpp
Generated by
1.9.1