STADLS
init_generator.h
Go to the documentation of this file.
1 #pragma once
2 #include "hate/visibility.h"
5 
7 
8 namespace detail {
9 
10 class GENPYBIND(expose_as(_InitGenerator)) InitGenerator
11 {
12 public:
14  InitGenerator() SYMBOL_VISIBLE;
15 
18 
20  haldls::vx::InstructionTimeoutConfig instruction_timeout;
21 
23  haldls::vx::ShiftRegister shift_register;
24 
26  lola::vx::DACControlBlock dac_control_block;
27 
29  lola::vx::DACChannelBlock dac_channel_block;
30 
36  bool enable_xboard;
37 
39  haldls::vx::JTAGClockScaler jtag_clock_scaler;
40 
42  haldls::vx::v2::PLLClockOutputBlock pll_clock_output_block;
43 
45  typedef halco::common::typed_array<haldls::vx::ADPLL, halco::hicann_dls::vx::v2::ADPLLOnDLS>
46  adplls_type GENPYBIND(opaque(false));
47  adplls_type adplls;
48 
49  struct GENPYBIND(visible) HighspeedLink
50  {
52  HighspeedLink() SYMBOL_VISIBLE;
53 
55  haldls::vx::CommonPhyConfigFPGA common_phy_config_fpga;
56 
58  haldls::vx::CommonPhyConfigChip common_phy_config_chip;
59 
61  typedef halco::common::
62  typed_array<haldls::vx::PhyConfigFPGA, halco::hicann_dls::vx::v2::PhyConfigFPGAOnDLS>
63  phy_configs_fpga_type GENPYBIND(opaque(false));
64  phy_configs_fpga_type phy_configs_fpga;
65 
67  typedef halco::common::
68  typed_array<haldls::vx::PhyConfigChip, halco::hicann_dls::vx::v2::PhyConfigChipOnDLS>
69  phy_configs_chip_type GENPYBIND(opaque(false));
70  phy_configs_chip_type phy_configs_chip;
71 
73  haldls::vx::SystimeSyncBase systime_sync_base;
74 
81  bool enable_systime;
82 
83  } highspeed_link;
84 
89  bool enable_highspeed_link;
90 
92  lola::vx::v2::MemoryTiming memory_timing;
93 
95  haldls::vx::SynapseBiasSelection synapse_bias_selection;
96 
101  bool enable_capmem;
102 
104  haldls::vx::v2::ReferenceGeneratorConfig reference_generator_config;
105 
107  typedef halco::common::typed_array<
108  haldls::vx::v2::CapMemBlockConfig,
109  halco::hicann_dls::vx::v2::CapMemBlockConfigOnDLS>
110  capmem_block_config_type GENPYBIND(visible);
111  capmem_block_config_type capmem_block_config;
112 
115  typedef halco::common::
116  typed_array<haldls::vx::v2::CapMemBlock, halco::hicann_dls::vx::v2::CapMemBlockOnDLS>
117  capmem_block_type GENPYBIND(opaque(false));
118  capmem_block_type capmem_config;
119 
120  typedef hate::Nil Result;
121 
122  GENPYBIND(stringstream)
123  friend std::ostream& operator<<(std::ostream& os, InitGenerator const& sequence) SYMBOL_VISIBLE;
124 
125 protected:
130  PlaybackGeneratorReturn<Result> generate() const SYMBOL_VISIBLE;
131 
132 private:
133  friend auto stadls::vx::generate<InitGenerator>(InitGenerator const&);
134 };
135 
136 } // namespace detail
137 
143 class DigitalInit : public detail::InitGenerator
144 {
145 public:
147  DigitalInit() SYMBOL_VISIBLE;
148 
149 private:
150  friend auto stadls::vx::generate<DigitalInit>(DigitalInit const&);
151 };
152 
159 class ExperimentInit : public detail::InitGenerator
160 {
161 public:
163  ExperimentInit() SYMBOL_VISIBLE;
164 
167 
170  typedef halco::common::typed_array<
171  haldls::vx::CommonNeuronBackendConfig,
172  halco::hicann_dls::vx::v2::CommonNeuronBackendConfigOnDLS>
174  common_neuron_backend_config_type common_neuron_backend_config;
175 
177  typedef halco::common::typed_array<
178  haldls::vx::v2::ColumnCorrelationQuad,
179  halco::hicann_dls::vx::v2::ColumnCorrelationQuadOnDLS>
180  column_correlation_quad_type GENPYBIND(opaque(false));
181  column_correlation_quad_type column_correlation_quad_config;
182 
184  typedef halco::common::typed_array<
185  haldls::vx::v2::ColumnCurrentQuad,
186  halco::hicann_dls::vx::v2::ColumnCurrentQuadOnDLS>
187  column_current_quad_type GENPYBIND(opaque(false));
188  column_current_quad_type column_current_quad_config;
189 
191  typedef halco::common::typed_array<
192  haldls::vx::v2::CommonCorrelationConfig,
193  halco::hicann_dls::vx::v2::CommonCorrelationConfigOnDLS>
194  common_correlation_config_type GENPYBIND(opaque(false));
195  common_correlation_config_type common_correlation_config;
196 
197  typedef detail::InitGenerator::Result Result;
198 
199 private:
200  friend auto stadls::vx::generate<ExperimentInit>(ExperimentInit const&);
201 
206  PlaybackGeneratorReturn<Result> generate() const SYMBOL_VISIBLE;
207 };
208 
209 #if defined(__GENPYBIND__) or defined(__GENPYBIND_GENERATED__)
210 namespace detail {
211 
212 struct GENPYBIND(expose_as(ExperimentInit), inline_base("*ExperimentInit*")) PyExperimentInit
213  : public ExperimentInit
214  , public PlaybackGenerator
215 {
216  virtual pybind11::tuple generate() const override
217  {
218  return stadls::vx::detail::py_generate_impl(static_cast<ExperimentInit>(*this));
219  }
220 };
221 
222 // TODO: we can't use the alias above, cf. https://github.com/kljohann/genpybind/issues/32
223 struct GENPYBIND(expose_as(DigitalInit), inline_base("*DigitalInit*")) PyDigitalInit
224  : public DigitalInit
225  , public PlaybackGenerator
226 {
227  virtual pybind11::tuple generate() const override
228  {
229  return stadls::vx::detail::py_generate_impl(static_cast<DigitalInit>(*this));
230  }
231 };
232 
233 } // namespace detail
234 #endif // defined(__GENPYBIND__) or defined(__GENPYBIND_GENERATED__)
235 
236 GENPYBIND_MANUAL({
237  parent.def(
238  "generate",
239  [](::stadls::vx::v2::ExperimentInit const& seq) {
240  return ::stadls::vx::detail::py_generate_impl(seq);
241  },
242  pybind11::return_value_policy::move);
243 })
244 
245 GENPYBIND_MANUAL({
246  parent.def(
247  "generate",
248  [](::stadls::vx::v2::DigitalInit const& seq) {
249  return ::stadls::vx::detail::py_generate_impl(seq);
250  },
251  pybind11::return_value_policy::move);
252 })
253 
254 } // namespace stadls::vx::v2
Generator for initialization of the chip up to digital communication.
DigitalInit() SYMBOL_VISIBLE
Default constructor.
Generator for initialization required for typical experiments.
halco::common::typed_array< haldls::vx::CommonNeuronBackendConfig, halco::hicann_dls::vx::v2::CommonNeuronBackendConfigOnDLS > common_neuron_backend_config_type
Set common neuron backend with clocks enabled.
halco::common::typed_array< haldls::vx::v2::ColumnCurrentQuad, halco::hicann_dls::vx::v2::ColumnCurrentQuadOnDLS > column_current_quad_type
Set ColumnCurrentQuad/Switch connections.
halco::common::typed_array< haldls::vx::v2::CommonCorrelationConfig, halco::hicann_dls::vx::v2::CommonCorrelationConfigOnDLS > common_correlation_config_type
Set common correlation config.
halco::common::typed_array< haldls::vx::v2::ColumnCorrelationQuad, halco::hicann_dls::vx::v2::ColumnCorrelationQuadOnDLS > column_correlation_quad_type
Set ColumnCorrelationQuad/Switch connections.
ExperimentInit() SYMBOL_VISIBLE
Default constructor.
halco::common::typed_array< haldls::vx::v2::CapMemBlock, halco::hicann_dls::vx::v2::CapMemBlockOnDLS > capmem_block_type
Set initial CapMem config.
halco::common::typed_array< haldls::vx::ADPLL, halco::hicann_dls::vx::v2::ADPLLOnDLS > adplls_type
ADPLL setting.
InitGenerator() SYMBOL_VISIBLE
Default constructor.
halco::common::typed_array< haldls::vx::v2::CapMemBlockConfig, halco::hicann_dls::vx::v2::CapMemBlockConfigOnDLS > capmem_block_config_type
Initialize the CapMem with usable default values.
#define GENPYBIND_TAG_STADLS_VX_V2
Definition: genpybind.h:5
auto generate(Ts &&... args) -> decltype(stadls::vx::generate(std::forward< Ts >(args)...))
Definition: visitors.h:9
Return type of generate() call on playback sequence.