STADLS
dumperdone.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "halco/hicann-dls/vx/barrier.h"
4 #include "haldls/cerealization.h"
5 #include "haldls/vx/barrier.h"
6 #include "haldls/vx/timer.h"
7 #include "haldls/vx/v3/container.h"
8 #include "hate/visibility.h"
9 #include "lola/vx/v3/container.h"
10 #include "stadls/vx/genpybind.h"
11 #include <utility>
12 #include <variant>
13 #include <vector>
14 
15 #if defined(__GENPYBIND__) or defined(__GENPYBIND_GENERATED__)
16 #include "haldls/vx/pickle.h"
17 #include <pybind11/pybind11.h>
18 namespace py = pybind11;
19 #endif
20 
22 
23 namespace v3 GENPYBIND_TAG_STADLS_VX_V3 {
24 
25 struct GENPYBIND(visible) DumperDone
26 {
30  typedef std::variant<
31 #define PLAYBACK_CONTAINER(Name, Type) std::pair<typename Type::coordinate_type, Type>,
32 #pragma push_macro("PLAYBACK_CONTAINER")
33 #include "haldls/vx/v3/container.def"
34 #pragma pop_macro("PLAYBACK_CONTAINER")
35 #include "lola/vx/v3/container.def"
36  std::pair<typename haldls::vx::Timer::coordinate_type, haldls::vx::Timer::Value>,
37  std::pair<halco::hicann_dls::vx::BarrierOnFPGA, haldls::vx::Barrier>,
38  std::
39  pair<halco::hicann_dls::vx::PollingOmnibusBlockOnFPGA, haldls::vx::PollingOmnibusBlock>>
41  typedef std::vector<coco_type> values_type;
42 
43  DumperDone() = default;
44 
45  values_type values{};
46 
47  bool operator==(DumperDone const& other) const SYMBOL_VISIBLE;
48  bool operator!=(DumperDone const& other) const SYMBOL_VISIBLE;
49 
50  // clang-format off
51  GENPYBIND_MANUAL({
52  parent.def("__len__", [](GENPYBIND_PARENT_TYPE const& v) { return v.values.size(); })
53  .def("tolist", [](GENPYBIND_PARENT_TYPE const& v) {
54  py::list ret;
55  for (auto const& vv : v.values) {
56  py::object item;
57  std::visit(
58  [&item](auto const& vvv) {
59  item = py::make_tuple(std::get<0>(vvv), std::get<1>(vvv));
60  },
61  vv);
62  ret.append(item);
63  }
64  return ret;
65  });
66  })
67  // clang-format on
68 
69 
70 private:
71  friend class cereal::access;
72  template <typename Archive>
73  void serialize(Archive& ar, std::uint32_t);
74 };
75 
76 
82 lola::vx::v3::Chip GENPYBIND(visible) convert_to_chip(DumperDone const& dumperdone) SYMBOL_VISIBLE;
83 
90 lola::vx::v3::Chip GENPYBIND(visible) convert_to_chip(
91  DumperDone const& dumperdone, lola::vx::v3::Chip const& previous) SYMBOL_VISIBLE;
92 
93 } // namespace v3
94 
95 GENPYBIND_MANUAL({
96  haldls::vx::AddPickle<hate::type_list<stadls::vx::v3::DumperDone>>::apply(
97  parent, {"DumperDone"});
98 
99  ::haldls::vx::WrapToFromFunctions<stadls::vx::v3::DumperDone>::apply(parent);
100 })
101 
102 } // namespace stadls::vx
103 
104 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(stadls::vx::v3::DumperDone)
#define GENPYBIND_TAG_STADLS_VX_V3
Definition: genpybind.h:6
void serialize(Archive &ar, std::uint32_t)
wrapped def("pop", &ReinitStackEntry::pop)
struct stadls::vx::v3::DumperDone access
lola::vx::v2::Chip convert_to_chip(DumperDone const &dumperdone) SYMBOL_VISIBLE
Convert the dumper result to a Chip config.
bool operator!=(DumperDone const &other) const SYMBOL_VISIBLE
bool operator==(DumperDone const &other) const SYMBOL_VISIBLE
std::vector< coco_type > values_type
Definition: dumperdone.h:41
std::variant<#define PLAYBACK_CONTAINER(Name, Type) # 33 "/jenkins/jenlib_workspaces_f9/bld_nightly-haldls.YmxkX25pZ2h0bHktaGFsZGxzIzEzNzk.x/haldls/include/stadls/vx/v3/dumperdone.h" 2# 35 "/jenkins/jenlib_workspaces_f9/bld_nightly-haldls.YmxkX25pZ2h0bHktaGFsZGxzIzEzNzk.x/haldls/include/stadls/vx/v3/dumperdone.h" 2 std::pair< typename haldls::vx::Timer::coordinate_type, haldls::vx::Timer::Value >, std::pair< halco::hicann_dls::vx::BarrierOnFPGA, haldls::vx::Barrier >, std::pair< halco::hicann_dls::vx::PollingOmnibusBlockOnFPGA, haldls::vx::PollingOmnibusBlock > > coco_type
Variant over all coordinate/container pairs.
Definition: dumperdone.h:40