aboutsummaryrefslogtreecommitdiffstats
path: root/common/pybindings.cc
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2021-07-30 14:29:55 +0100
committerGitHub <noreply@github.com>2021-07-30 14:29:55 +0100
commitef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d (patch)
tree41f9aec86a1d468a0302243c8f6c567d46c666b6 /common/pybindings.cc
parent8466985bc709d6c2e0e6f5f030abec119ae2305a (diff)
parentd2007a386c1a2db7917d7048ea6206ae1218d141 (diff)
downloadnextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.tar.gz
nextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.tar.bz2
nextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.zip
Merge pull request #787 from YosysHQ/gatecat/report
Add JSON utilisation and timing report
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 bdd4f92a..2f672a41 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -285,8 +285,16 @@ PYBIND11_EMBEDDED_MODULE(MODULE_NAME, m)
WRAP_MAP(m, WireMap, wrap_context<PipMap &>, "WireMap");
WRAP_MAP_UPTR(m, RegionMap, "RegionMap");
- WRAP_VECTOR(m, PortRefVector, wrap_context<PortRef &>);
+ typedef dict<IdString, ClockFmax> ClockFmaxMap;
+ WRAP_MAP(m, ClockFmaxMap, pass_through<ClockFmax>, "ClockFmaxMap");
+ auto clk_fmax_cls = py::class_<ClockFmax>(m, "ClockFmax")
+ .def_readonly("achieved", &ClockFmax::achieved)
+ .def_readonly("constraint", &ClockFmax::constraint);
+
+ auto tmg_result_cls = py::class_<ContextualWrapper<TimingResult &>>(m, "TimingResult");
+ readonly_wrapper<TimingResult &, decltype(&TimingResult::clock_fmax), &TimingResult::clock_fmax,
+ wrap_context<ClockFmaxMap &>>::def_wrap(tmg_result_cls, "clock_fmax");
arch_wrap_python(m);
}