HALDLS
readout.h
Go to the documentation of this file.
1 #pragma once
2 #include <iosfwd>
3 
4 #include "halco/common/typed_array.h"
5 #include "halco/hicann-dls/vx/capmem.h"
6 #include "halco/hicann-dls/vx/chip.h"
7 #include "halco/hicann-dls/vx/readout.h"
8 #include "haldls/cerealization.h"
9 #include "haldls/vx/genpybind.h"
10 #include "haldls/vx/traits.h"
11 #include "hate/visibility.h"
12 
13 namespace fisch::vx {
14 
15 class OmnibusChipOverJTAG;
16 class Omnibus;
17 
18 } // namespace fisch::vx
19 
21 
27 class GENPYBIND(visible) PadMultiplexerConfig
28 {
29 public:
30  typedef halco::hicann_dls::vx::PadMultiplexerConfigOnDLS coordinate_type;
31 
32  typedef std::true_type is_leaf_node;
33 
35  PadMultiplexerConfig() SYMBOL_VISIBLE;
36 
37  typedef halco::common::typed_array<bool, halco::hicann_dls::vx::CapMemBlockOnDLS>
38  capmem_quadrant_type GENPYBIND(opaque(false));
39  typedef halco::common::typed_array<bool, halco::hicann_dls::vx::HemisphereOnDLS> hemisphere_type
40  GENPYBIND(opaque(false));
41  typedef halco::common::
42  typed_array<bool, halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection>
43  buffer_type GENPYBIND(opaque(false));
44 
46  GENPYBIND(getter_for(cadc_v_ramp_mux), return_value_policy(reference_internal))
47  capmem_quadrant_type const& get_cadc_v_ramp_mux() const SYMBOL_VISIBLE;
48  GENPYBIND(setter_for(cadc_v_ramp_mux))
49  void set_cadc_v_ramp_mux(capmem_quadrant_type const& value) SYMBOL_VISIBLE;
50 
52  GENPYBIND(getter_for(cadc_v_ramp_mux_to_pad))
53  bool get_cadc_v_ramp_mux_to_pad() const SYMBOL_VISIBLE;
54  GENPYBIND(setter_for(cadc_v_ramp_mux_to_pad))
55  void set_cadc_v_ramp_mux_to_pad(bool value) SYMBOL_VISIBLE;
56 
58  GENPYBIND(getter_for(capmem_i_out_mux), return_value_policy(reference_internal))
59  capmem_quadrant_type const& get_capmem_i_out_mux() const SYMBOL_VISIBLE;
60  GENPYBIND(setter_for(capmem_i_out_mux))
61  void set_capmem_i_out_mux(capmem_quadrant_type const& value) SYMBOL_VISIBLE;
62 
67  GENPYBIND(getter_for(capmem_i_out_mux_to_capmem_intermediate_mux))
68  bool get_capmem_i_out_mux_to_capmem_intermediate_mux() const SYMBOL_VISIBLE;
69  GENPYBIND(setter_for(capmem_i_out_mux_to_capmem_intermediate_mux))
70  void set_capmem_i_out_mux_to_capmem_intermediate_mux(bool value) SYMBOL_VISIBLE;
71 
74  GENPYBIND(getter_for(capmem_intermediate_mux_to_pad))
75  bool get_capmem_intermediate_mux_to_pad() const SYMBOL_VISIBLE;
76  GENPYBIND(setter_for(capmem_intermediate_mux_to_pad))
77  void set_capmem_intermediate_mux_to_pad(bool value) SYMBOL_VISIBLE;
78 
80  GENPYBIND(getter_for(capmem_v_out_mux), return_value_policy(reference_internal))
81  capmem_quadrant_type const& get_capmem_v_out_mux() const SYMBOL_VISIBLE;
82  GENPYBIND(setter_for(capmem_v_out_mux))
83  void set_capmem_v_out_mux(capmem_quadrant_type const& value) SYMBOL_VISIBLE;
84 
88  GENPYBIND(getter_for(capmem_v_out_mux_to_capmem_intermediate_mux))
89  bool get_capmem_v_out_mux_to_capmem_intermediate_mux() const SYMBOL_VISIBLE;
90  GENPYBIND(setter_for(capmem_v_out_mux_to_capmem_intermediate_mux))
91  void set_capmem_v_out_mux_to_capmem_intermediate_mux(bool value) SYMBOL_VISIBLE;
92 
94  GENPYBIND(getter_for(capmem_v_ref_mux), return_value_policy(reference_internal))
95  capmem_quadrant_type const& get_capmem_v_ref_mux() const SYMBOL_VISIBLE;
96  GENPYBIND(setter_for(capmem_v_ref_mux))
97  void set_capmem_v_ref_mux(capmem_quadrant_type const& value) SYMBOL_VISIBLE;
98 
102  GENPYBIND(getter_for(capmem_v_ref_mux_to_capmem_intermediate_mux))
103  bool get_capmem_v_ref_mux_to_capmem_intermediate_mux() const SYMBOL_VISIBLE;
104  GENPYBIND(setter_for(capmem_v_ref_mux_to_capmem_intermediate_mux))
105  void set_capmem_v_ref_mux_to_capmem_intermediate_mux(bool value) SYMBOL_VISIBLE;
106 
108  GENPYBIND(getter_for(neuron_i_stim_mux), return_value_policy(reference_internal))
109  hemisphere_type const& get_neuron_i_stim_mux() const SYMBOL_VISIBLE;
110  GENPYBIND(setter_for(neuron_i_stim_mux))
111  void set_neuron_i_stim_mux(hemisphere_type const& value) SYMBOL_VISIBLE;
112 
114  GENPYBIND(getter_for(neuron_i_stim_mux_to_pad))
115  bool get_neuron_i_stim_mux_to_pad() const SYMBOL_VISIBLE;
116  GENPYBIND(setter_for(neuron_i_stim_mux_to_pad))
117  void set_neuron_i_stim_mux_to_pad(bool value) SYMBOL_VISIBLE;
118 
122  GENPYBIND(getter_for(cadc_debug_acausal_to_synapse_intermediate_mux))
123  bool get_cadc_debug_acausal_to_synapse_intermediate_mux() const SYMBOL_VISIBLE;
124  GENPYBIND(setter_for(cadc_debug_acausal_to_synapse_intermediate_mux))
125  void set_cadc_debug_acausal_to_synapse_intermediate_mux(bool value) SYMBOL_VISIBLE;
126 
130  GENPYBIND(getter_for(cadc_debug_causal_to_synapse_intermediate_mux))
131  bool get_cadc_debug_causal_to_synapse_intermediate_mux() const SYMBOL_VISIBLE;
132  GENPYBIND(setter_for(cadc_debug_causal_to_synapse_intermediate_mux))
133  void set_cadc_debug_causal_to_synapse_intermediate_mux(bool value) SYMBOL_VISIBLE;
134 
138  GENPYBIND(getter_for(synin_debug_inhibitory_to_synapse_intermediate_mux))
139  bool get_synin_debug_inhibitory_to_synapse_intermediate_mux() const SYMBOL_VISIBLE;
140  GENPYBIND(setter_for(synin_debug_inhibitory_to_synapse_intermediate_mux))
141  void set_synin_debug_inhibitory_to_synapse_intermediate_mux(bool value) SYMBOL_VISIBLE;
142 
146  GENPYBIND(getter_for(synin_debug_excitatory_to_synapse_intermediate_mux))
147  bool get_synin_debug_excitatory_to_synapse_intermediate_mux() const SYMBOL_VISIBLE;
148  GENPYBIND(setter_for(synin_debug_excitatory_to_synapse_intermediate_mux))
149  void set_synin_debug_excitatory_to_synapse_intermediate_mux(bool value) SYMBOL_VISIBLE;
150 
154  GENPYBIND(getter_for(synapse_intermediate_mux_to_pad))
155  bool get_synapse_intermediate_mux_to_pad() const SYMBOL_VISIBLE;
156  GENPYBIND(setter_for(synapse_intermediate_mux_to_pad))
157  void set_synapse_intermediate_mux_to_pad(bool value) SYMBOL_VISIBLE;
158 
162  GENPYBIND(getter_for(buffer_to_pad), return_value_policy(reference_internal))
163  buffer_type const& get_buffer_to_pad() const SYMBOL_VISIBLE;
164  GENPYBIND(setter_for(buffer_to_pad))
165  void set_buffer_to_pad(buffer_type const& value) SYMBOL_VISIBLE;
166 
171  GENPYBIND(getter_for(debug_to_pad))
172  bool get_debug_to_pad() const SYMBOL_VISIBLE;
173  GENPYBIND(setter_for(debug_to_pad))
174  void set_debug_to_pad(bool value) SYMBOL_VISIBLE;
175 
176  bool operator==(PadMultiplexerConfig const& other) const SYMBOL_VISIBLE;
177  bool operator!=(PadMultiplexerConfig const& other) const SYMBOL_VISIBLE;
178 
179  GENPYBIND(stringstream)
180  friend std::ostream& operator<<(std::ostream& os, PadMultiplexerConfig const& config)
181  SYMBOL_VISIBLE;
182 
183  static size_t constexpr config_size_in_words GENPYBIND(hidden) = 2;
184 
185  template <typename AddressT>
186  static std::array<AddressT, config_size_in_words> addresses(coordinate_type const& coord)
187  SYMBOL_VISIBLE GENPYBIND(hidden);
188 
189  template <typename WordT>
190  std::array<WordT, config_size_in_words> encode() const SYMBOL_VISIBLE GENPYBIND(hidden);
191 
192  template <typename WordT>
193  void decode(std::array<WordT, config_size_in_words> const& words) SYMBOL_VISIBLE
194  GENPYBIND(hidden);
195 
196 private:
197  friend class cereal::access;
198  template <class Archive>
199  void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
200 
201  // CADC
202  capmem_quadrant_type m_cadc_v_ramp_mux;
203  bool m_cadc_v_ramp_mux_to_pad;
204 
205  // CapMem
206  capmem_quadrant_type m_capmem_i_out_mux;
207  bool m_capmem_i_out_mux_to_inter;
208  bool m_capmem_inter_mux_to_pad;
209  capmem_quadrant_type m_capmem_v_out_mux;
210  bool m_capmem_v_out_mux_to_inter;
211  capmem_quadrant_type m_capmem_v_ref_mux;
212  bool m_capmem_v_ref_mux_to_inter;
213 
214  // Neuron
215  hemisphere_type m_neuron_i_stim_mux;
216  bool m_neuron_i_stim_mux_to_pad;
217 
218  // Synapse array
219  bool m_cadc_debug_acausal_to_inter;
220  bool m_cadc_debug_causal_to_inter;
221  bool m_synin_debug_inhibitory_to_inter;
222  bool m_synin_debug_excitatory_to_inter;
223  bool m_synapse_inter_mux_to_pad;
224 
225  // Other readout chain outputs
226  buffer_type m_buffer_to_pad;
227  bool m_debug_to_pad;
228 };
229 
231 
242 class GENPYBIND(visible) ReadoutSourceSelection
243 {
244 public:
245  typedef halco::hicann_dls::vx::ReadoutSourceSelectionOnDLS coordinate_type;
246  typedef std::true_type is_leaf_node;
247 
249  {
251  SourceMultiplexer() SYMBOL_VISIBLE;
252 
253  typedef halco::common::typed_array<bool, halco::hicann_dls::vx::HemisphereOnDLS>
254  hemisphere_type GENPYBIND(opaque(false));
255 
257  GENPYBIND(getter_for(debug_plus))
258  bool get_debug_plus() const SYMBOL_VISIBLE;
259  GENPYBIND(setter_for(debug_plus))
260  void set_debug_plus(bool value) SYMBOL_VISIBLE;
261 
263  GENPYBIND(getter_for(debug_minus))
264  bool get_debug_minus() const SYMBOL_VISIBLE;
265  GENPYBIND(setter_for(debug_minus))
266  void set_debug_minus(bool value) SYMBOL_VISIBLE;
267 
271  GENPYBIND(getter_for(current_dac))
272  bool get_current_dac() const SYMBOL_VISIBLE;
273  GENPYBIND(setter_for(current_dac))
274  void set_current_dac(bool value) SYMBOL_VISIBLE;
275 
277  GENPYBIND(getter_for(synin_debug_inhibitory))
278  bool get_synin_debug_inhibitory() const SYMBOL_VISIBLE;
279  GENPYBIND(setter_for(synin_debug_inhibitory))
280  void set_synin_debug_inhibitory(bool value) SYMBOL_VISIBLE;
281 
283  GENPYBIND(getter_for(synin_debug_excitatory))
284  bool get_synin_debug_excitatory() const SYMBOL_VISIBLE;
285  GENPYBIND(setter_for(synin_debug_excitatory))
286  void set_synin_debug_excitatory(bool value) SYMBOL_VISIBLE;
287 
289  GENPYBIND(getter_for(cadc_debug_causal))
290  bool get_cadc_debug_causal() const SYMBOL_VISIBLE;
291  GENPYBIND(setter_for(cadc_debug_causal))
292  void set_cadc_debug_causal(bool value) SYMBOL_VISIBLE;
293 
295  GENPYBIND(getter_for(cadc_debug_acausal))
296  bool get_cadc_debug_acausal() const SYMBOL_VISIBLE;
297  GENPYBIND(setter_for(cadc_debug_acausal))
298  void set_cadc_debug_acausal(bool value) SYMBOL_VISIBLE;
299 
301  GENPYBIND(getter_for(synapse_driver_debug), return_value_policy(reference_internal))
302  hemisphere_type const& get_synapse_driver_debug() const SYMBOL_VISIBLE;
303  GENPYBIND(setter_for(synapse_driver_debug))
304  void set_synapse_driver_debug(hemisphere_type const& value) SYMBOL_VISIBLE;
305 
307  GENPYBIND(getter_for(neuron_odd), return_value_policy(reference_internal))
308  hemisphere_type const& get_neuron_odd() const SYMBOL_VISIBLE;
309  GENPYBIND(setter_for(neuron_odd))
310  void set_neuron_odd(hemisphere_type const& value) SYMBOL_VISIBLE;
311 
313  GENPYBIND(getter_for(neuron_even), return_value_policy(reference_internal))
314  hemisphere_type const& get_neuron_even() const SYMBOL_VISIBLE;
315  GENPYBIND(setter_for(neuron_even))
316  void set_neuron_even(hemisphere_type const& value) SYMBOL_VISIBLE;
317 
318  bool operator==(SourceMultiplexer const& other) const SYMBOL_VISIBLE;
319  bool operator!=(SourceMultiplexer const& other) const SYMBOL_VISIBLE;
320 
321  GENPYBIND(stringstream)
322  friend std::ostream& operator<<(std::ostream& os, SourceMultiplexer const& config)
323  SYMBOL_VISIBLE;
324 
325  private:
327  friend class cereal::access;
328  template <class Archive>
329  void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
330 
331  bool m_debug_plus;
332  bool m_debug_minus;
333  bool m_current_dac;
334  bool m_synin_debug_inhibitory;
335  bool m_synin_debug_excitatory;
336  bool m_cadc_debug_causal;
337  bool m_cadc_debug_acausal;
338  hemisphere_type m_synapse_driver_debug;
339  hemisphere_type m_neuron_odd;
340  hemisphere_type m_neuron_even;
341  };
342 
344  ReadoutSourceSelection() SYMBOL_VISIBLE;
345 
346  SourceMultiplexer get_buffer(
347  halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection const& buffer) const
348  SYMBOL_VISIBLE;
349  void set_buffer(
350  halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection const& buffer,
351  SourceMultiplexer const& value) SYMBOL_VISIBLE;
352 
353  typedef halco::common::
354  typed_array<bool, halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection>
355  source_multiplexer_type GENPYBIND(opaque(false));
359  GENPYBIND(getter_for(enable_buffer_to_pad), return_value_policy(reference_internal))
360  source_multiplexer_type const& get_enable_buffer_to_pad() const SYMBOL_VISIBLE;
361  GENPYBIND(setter_for(enable_buffer_to_pad))
362  void set_enable_buffer_to_pad(source_multiplexer_type const& value) SYMBOL_VISIBLE;
363 
364  static size_t constexpr config_size_in_words GENPYBIND(hidden) = 2;
365 
366  template <typename AddressT>
367  static std::array<AddressT, config_size_in_words> addresses(coordinate_type const& block)
368  GENPYBIND(hidden);
369 
370  template <typename WordT>
371  std::array<WordT, config_size_in_words> encode() const GENPYBIND(hidden);
372 
373  template <typename WordT>
374  void decode(std::array<WordT, config_size_in_words> const& data) GENPYBIND(hidden);
375 
376  GENPYBIND(stringstream)
377  friend std::ostream& operator<<(std::ostream& os, ReadoutSourceSelection const& config)
378  SYMBOL_VISIBLE;
379 
380  bool operator==(ReadoutSourceSelection const& other) const SYMBOL_VISIBLE;
381  bool operator!=(ReadoutSourceSelection const& other) const SYMBOL_VISIBLE;
382 
383 private:
384  friend class cereal::access;
385  template <class Archive>
386  void serialize(Archive& ar, std::uint32_t const version);
387 
388  halco::common::typed_array<
390  halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection>
391  m_buffers;
392  source_multiplexer_type m_enable_buffer_to_pad;
393 };
394 
397 
398 namespace detail {
399 
400 template <>
402  : public BackendContainerBase<
403  PadMultiplexerConfig,
404  fisch::vx::word_access_type::Omnibus,
405  fisch::vx::word_access_type::OmnibusChipOverJTAG>
406 {};
407 
408 template <>
410  : public BackendContainerBase<
411  ReadoutSourceSelection,
412  fisch::vx::word_access_type::Omnibus,
413  fisch::vx::word_access_type::OmnibusChipOverJTAG>
414 {};
415 
416 } // namespace detail
417 
418 } // namespace haldls::vx
#define EXTERN_INSTANTIATE_CEREAL_SERIALIZE(CLASS_NAME)
Definition: cerealization.h:75
A configuration container for the top-level readout mux, selecting the connections between an analog ...
Definition: readout.h:28
PadMultiplexerConfig() SYMBOL_VISIBLE
Default constructor with all inputs disabled.
halco::common::typed_array< bool, halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection > buffer_type
Definition: readout.h:43
std::true_type is_leaf_node
Definition: readout.h:32
halco::common::typed_array< bool, halco::hicann_dls::vx::CapMemBlockOnDLS > capmem_quadrant_type
Definition: readout.h:38
halco::common::typed_array< bool, halco::hicann_dls::vx::HemisphereOnDLS > hemisphere_type
Definition: readout.h:40
halco::hicann_dls::vx::PadMultiplexerConfigOnDLS coordinate_type
Definition: readout.h:30
Configuration container for the two mux and buffer blocks for voltage readout.
Definition: readout.h:243
halco::common::typed_array< bool, halco::hicann_dls::vx::SourceMultiplexerOnReadoutSourceSelection > source_multiplexer_type
Definition: readout.h:355
halco::hicann_dls::vx::ReadoutSourceSelectionOnDLS coordinate_type
Definition: readout.h:245
#define GENPYBIND_TAG_HALDLS_VX
Definition: genpybind.h:4
Definition: arq.h:13
SourceMultiplexer() SYMBOL_VISIBLE
Default constructor with all inputs disabled.
halco::common::typed_array< bool, halco::hicann_dls::vx::HemisphereOnDLS > hemisphere_type
Definition: readout.h:254
Backend container trait base.
Definition: traits.h:77