5 #include "halco/common/geometry.h"
6 #include "halco/common/typed_array.h"
7 #include "halco/hicann-dls/vx/highspeed_link.h"
11 #include "hate/visibility.h"
15 class OmnibusChipOverJTAGAddress;
31 struct GENPYBIND(inline_base("*
")) ManualDelay
32 : public halco::common::detail::RantWrapper<ManualDelay, uint_fast32_t, 15, 0>
34 constexpr explicit ManualDelay(uintmax_t const val = 0) : rant_t(val) {}
37 struct GENPYBIND(inline_base("*
")) VBias
38 : public halco::common::detail::RantWrapper<VBias, uint_fast32_t, 7, 0>
40 constexpr explicit VBias(uintmax_t const val = 0) : rant_t(val) {}
43 struct GENPYBIND(inline_base("*
")) DebugOutputs
44 : public halco::common::detail::RantWrapper<DebugOutputs, uint_fast32_t, 1, 0>
46 constexpr explicit DebugOutputs(uintmax_t const val = 0) : rant_t(val) {}
49 GENPYBIND(getter_for(enable_bit_slip))
50 bool get_enable_bit_slip() const SYMBOL_VISIBLE;
51 GENPYBIND(setter_for(enable_bit_slip))
52 void set_enable_bit_slip(bool value) SYMBOL_VISIBLE;
54 GENPYBIND(getter_for(manual_delay))
55 ManualDelay get_manual_delay() const SYMBOL_VISIBLE;
56 GENPYBIND(setter_for(manual_delay))
57 void set_manual_delay(ManualDelay value) SYMBOL_VISIBLE;
59 GENPYBIND(getter_for(enable_delay_cell_measurement))
60 bool get_enable_delay_cell_measurement() const SYMBOL_VISIBLE;
61 GENPYBIND(setter_for(enable_delay_cell_measurement))
62 void set_enable_delay_cell_measurement(bool value) SYMBOL_VISIBLE;
64 GENPYBIND(getter_for(enable_initialization_master_mode))
65 bool get_enable_initialization_master_mode() const SYMBOL_VISIBLE;
66 GENPYBIND(setter_for(enable_initialization_master_mode))
67 void set_enable_initialization_master_mode(bool value) SYMBOL_VISIBLE;
69 GENPYBIND(getter_for(enable_manual_tx_data_valid_for_init))
70 bool get_enable_manual_tx_data_valid_for_init() const SYMBOL_VISIBLE;
71 GENPYBIND(setter_for(enable_manual_tx_data_valid_for_init))
72 void set_enable_manual_tx_data_valid_for_init(bool value) SYMBOL_VISIBLE;
74 GENPYBIND(getter_for(enable_force_lvds_power_up))
75 bool get_enable_force_lvds_power_up() const SYMBOL_VISIBLE;
76 GENPYBIND(setter_for(enable_force_lvds_power_up))
77 void set_enable_force_lvds_power_up(bool value) SYMBOL_VISIBLE;
79 GENPYBIND(getter_for(enable_force_start))
80 bool get_enable_force_start() const SYMBOL_VISIBLE;
81 GENPYBIND(setter_for(enable_force_start))
82 void set_enable_force_start(bool value) SYMBOL_VISIBLE;
84 GENPYBIND(getter_for(enable_manual_training_mode))
85 bool get_enable_manual_training_mode() const SYMBOL_VISIBLE;
86 GENPYBIND(setter_for(enable_manual_training_mode))
87 void set_enable_manual_training_mode(bool value) SYMBOL_VISIBLE;
89 GENPYBIND(getter_for(enable_ber_loopback))
90 bool get_enable_ber_loopback() const SYMBOL_VISIBLE;
91 GENPYBIND(setter_for(enable_ber_loopback))
92 void set_enable_ber_loopback(bool value) SYMBOL_VISIBLE;
94 GENPYBIND(getter_for(vbias))
95 VBias get_vbias() const SYMBOL_VISIBLE;
96 GENPYBIND(setter_for(vbias))
97 void set_vbias(VBias value) SYMBOL_VISIBLE;
99 GENPYBIND(getter_for(debug_outputs))
100 DebugOutputs get_debug_outputs() const SYMBOL_VISIBLE;
101 GENPYBIND(setter_for(debug_outputs))
102 void set_debug_outputs(DebugOutputs value) SYMBOL_VISIBLE;
104 GENPYBIND(getter_for(enable_transmission_without_idls_pattern))
105 bool get_enable_transmission_without_idle_pattern() const SYMBOL_VISIBLE;
106 GENPYBIND(setter_for(enable_transmission_without_idls_pattern))
107 void set_enable_transmission_without_idle_pattern(bool value) SYMBOL_VISIBLE;
109 GENPYBIND(getter_for(enable_clock_pre_alignment))
110 bool get_enable_clock_pre_alignment() const SYMBOL_VISIBLE;
111 GENPYBIND(setter_for(enable_clock_pre_alignment))
112 void set_enable_clock_pre_alignment(bool value) SYMBOL_VISIBLE;
114 GENPYBIND(getter_for(enable_des_recal))
115 bool get_enable_des_recal() const SYMBOL_VISIBLE;
116 GENPYBIND(setter_for(enable_des_recal))
117 void set_enable_des_recal(bool value) SYMBOL_VISIBLE;
119 GENPYBIND(getter_for(enable_loopback_en))
120 bool get_enable_loopback_en() const SYMBOL_VISIBLE;
121 GENPYBIND(setter_for(enable_loopback_en))
122 void set_enable_loopback_en(bool value) SYMBOL_VISIBLE;
124 GENPYBIND(getter_for(enable_auto_init))
125 bool get_enable_auto_init() const SYMBOL_VISIBLE;
126 GENPYBIND(setter_for(enable_auto_init))
127 void set_enable_auto_init(bool value) SYMBOL_VISIBLE;
129 bool operator==(PhyConfigBase const& other) const SYMBOL_VISIBLE;
130 bool operator!=(PhyConfigBase const& other) const SYMBOL_VISIBLE;
132 GENPYBIND(stringstream)
133 friend std::ostream& operator<<(std::ostream& os, PhyConfigBase const& config) SYMBOL_VISIBLE;
136 PhyConfigBase() SYMBOL_VISIBLE;
138 friend class cereal::access;
139 template <typename Archive>
140 void cerealize_impl(Archive& ar) SYMBOL_VISIBLE;
142 uint32_t pack() const SYMBOL_VISIBLE;
143 void unpack(uint32_t value) SYMBOL_VISIBLE;
145 bool m_enable_bit_slip;
146 ManualDelay m_manual_delay;
147 bool m_enable_delay_cell_measurement;
148 bool m_enable_initialization_master_mode;
149 bool m_enable_manual_tx_data_valid_for_init;
150 bool m_enable_force_lvds_power_up;
151 bool m_enable_force_start;
152 bool m_enable_manual_training_mode;
153 bool m_enable_ber_loopback;
155 DebugOutputs m_debug_outputs;
156 bool m_enable_transmission_without_idle_pattern;
157 bool m_enable_clock_pre_alignment;
158 bool m_enable_des_recal;
159 bool m_enable_loopback_en;
160 bool m_enable_auto_init;
163 } // namespace detail
169 // FIXME: Instead of normal public inheritance we want CRTP here, which is not possible due to
170 // python wrapping issues, the properties don't show up in the derived class.
171 class SYMBOL_VISIBLE GENPYBIND(visible) PhyConfigFPGA : public detail::PhyConfigBase
174 typedef halco::hicann_dls::vx::PhyConfigFPGAOnDLS coordinate_type;
177 PhyConfigFPGA() SYMBOL_VISIBLE;
179 bool operator==(PhyConfigFPGA const& other) const SYMBOL_VISIBLE;
180 bool operator!=(PhyConfigFPGA const& other) const SYMBOL_VISIBLE;
182 GENPYBIND(stringstream)
183 friend std::ostream& operator<<(std::ostream& os, PhyConfigFPGA const& config) SYMBOL_VISIBLE;
185 static size_t constexpr config_size_in_words GENPYBIND(hidden) = 1;
186 static std::array<halco::hicann_dls::vx::OmnibusAddress, config_size_in_words> addresses(
187 coordinate_type const& word) SYMBOL_VISIBLE GENPYBIND(hidden);
188 std::array<fisch::vx::word_access_type::Omnibus, config_size_in_words> encode() const
189 SYMBOL_VISIBLE GENPYBIND(hidden);
190 void decode(std::array<fisch::vx::word_access_type::Omnibus, config_size_in_words> const& data)
191 SYMBOL_VISIBLE GENPYBIND(hidden);
194 friend class cereal::access;
195 template <typename Archive>
196 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
199 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(PhyConfigFPGA)
204 struct BackendContainerTrait<PhyConfigFPGA>
205 : public BackendContainerBase<PhyConfigFPGA, fisch::vx::word_access_type::Omnibus>
208 } // namespace detail
214 // FIXME: Instead of normal public inheritance we want CRTP here, which is not possible due to
215 // python wrapping issues, the properties don't show up in the derived class.
216 class GENPYBIND(visible) PhyConfigChip : public detail::PhyConfigBase
219 typedef halco::hicann_dls::vx::PhyConfigChipOnDLS coordinate_type;
222 PhyConfigChip() SYMBOL_VISIBLE;
224 bool operator==(PhyConfigChip const& other) const SYMBOL_VISIBLE;
225 bool operator!=(PhyConfigChip const& other) const SYMBOL_VISIBLE;
227 GENPYBIND(stringstream)
228 friend std::ostream& operator<<(std::ostream& os, PhyConfigChip const& config) SYMBOL_VISIBLE;
230 static size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 1;
231 static size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 0;
232 static std::array<halco::hicann_dls::vx::JTAGPhyRegisterOnDLS, write_config_size_in_words>
233 write_addresses(coordinate_type const& word) SYMBOL_VISIBLE GENPYBIND(hidden);
234 static std::array<halco::hicann_dls::vx::JTAGPhyRegisterOnDLS, read_config_size_in_words>
235 read_addresses(coordinate_type const& word) SYMBOL_VISIBLE GENPYBIND(hidden);
236 std::array<fisch::vx::word_access_type::JTAGPhyRegister, write_config_size_in_words> encode()
237 const SYMBOL_VISIBLE GENPYBIND(hidden);
239 std::array<fisch::vx::word_access_type::JTAGPhyRegister, read_config_size_in_words> const&
240 data) SYMBOL_VISIBLE GENPYBIND(hidden);
243 friend class cereal::access;
244 template <typename Archive>
245 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
248 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(PhyConfigChip)
253 struct BackendContainerTrait<PhyConfigChip>
254 : public BackendContainerBase<PhyConfigChip, fisch::vx::word_access_type::JTAGPhyRegister>
257 } // namespace detail
263 class GENPYBIND(visible) CommonPhyConfigFPGA
266 typedef halco::hicann_dls::vx::CommonPhyConfigFPGAOnDLS coordinate_type;
267 typedef std::true_type is_leaf_node;
270 CommonPhyConfigFPGA() SYMBOL_VISIBLE;
272 bool get_enable_phy(halco::hicann_dls::vx::PhyConfigFPGAOnDLS const& coord) const
274 void set_enable_phy(halco::hicann_dls::vx::PhyConfigFPGAOnDLS const& coord, bool value)
277 bool operator==(CommonPhyConfigFPGA const& other) const SYMBOL_VISIBLE;
278 bool operator!=(CommonPhyConfigFPGA const& other) const SYMBOL_VISIBLE;
280 GENPYBIND(stringstream)
281 friend std::ostream& operator<<(std::ostream& os, CommonPhyConfigFPGA const& config)
284 static size_t constexpr config_size_in_words GENPYBIND(hidden) = 1;
285 static std::array<halco::hicann_dls::vx::OmnibusAddress, config_size_in_words> addresses(
286 coordinate_type const& word) SYMBOL_VISIBLE GENPYBIND(hidden);
287 std::array<fisch::vx::word_access_type::Omnibus, config_size_in_words> encode() const
288 SYMBOL_VISIBLE GENPYBIND(hidden);
289 void decode(std::array<fisch::vx::word_access_type::Omnibus, config_size_in_words> const& data)
290 SYMBOL_VISIBLE GENPYBIND(hidden);
293 friend class cereal::access;
294 template <typename Archive>
295 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
297 halco::common::typed_array<bool, halco::hicann_dls::vx::PhyConfigFPGAOnDLS> m_enable_phy;
300 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(CommonPhyConfigFPGA)
305 struct BackendContainerTrait<CommonPhyConfigFPGA>
306 : public BackendContainerBase<CommonPhyConfigFPGA, fisch::vx::word_access_type::Omnibus>
309 } // namespace detail
315 class GENPYBIND(visible) CommonPhyConfigChip
318 typedef halco::hicann_dls::vx::CommonPhyConfigChipOnDLS coordinate_type;
319 typedef std::true_type is_leaf_node;
322 CommonPhyConfigChip() SYMBOL_VISIBLE;
324 bool get_enable_phy(halco::hicann_dls::vx::PhyConfigChipOnDLS const& coord) const
326 void set_enable_phy(halco::hicann_dls::vx::PhyConfigChipOnDLS const& coord, bool value)
329 bool operator==(CommonPhyConfigChip const& other) const SYMBOL_VISIBLE;
330 bool operator!=(CommonPhyConfigChip const& other) const SYMBOL_VISIBLE;
332 GENPYBIND(stringstream)
333 friend std::ostream& operator<<(std::ostream& os, CommonPhyConfigChip const& config)
336 static size_t constexpr config_size_in_words GENPYBIND(hidden) = 1;
337 static std::array<halco::hicann_dls::vx::OmnibusChipOverJTAGAddress, config_size_in_words>
338 addresses(coordinate_type const& word) SYMBOL_VISIBLE GENPYBIND(hidden);
339 std::array<fisch::vx::word_access_type::OmnibusChipOverJTAG, config_size_in_words> encode()
340 const SYMBOL_VISIBLE GENPYBIND(hidden);
342 std::array<fisch::vx::word_access_type::OmnibusChipOverJTAG, config_size_in_words> const&
343 data) SYMBOL_VISIBLE GENPYBIND(hidden);
346 friend class cereal::access;
347 template <typename Archive>
348 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
350 halco::common::typed_array<bool, halco::hicann_dls::vx::PhyConfigChipOnDLS> m_enable_phy;
353 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(CommonPhyConfigChip)
358 struct BackendContainerTrait<CommonPhyConfigChip>
359 : public BackendContainerBase<
361 fisch::vx::word_access_type::OmnibusChipOverJTAG>
364 } // namespace detail
367 class GENPYBIND(visible) PhyStatus
370 typedef halco::hicann_dls::vx::PhyStatusOnFPGA coordinate_type;
371 typedef std::true_type is_leaf_node;
373 PhyStatus() SYMBOL_VISIBLE;
378 struct GENPYBIND(inline_base("*
")) CRCErrorCount
379 : public halco::common::detail::BaseType<CRCErrorCount, uint32_t>
381 constexpr explicit CRCErrorCount(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
389 struct GENPYBIND(inline_base("*
")) OnlineTime
390 : public halco::common::detail::BaseType<OnlineTime, uint32_t>
392 constexpr explicit OnlineTime(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
400 struct GENPYBIND(inline_base("*
")) RxDroppedCount
401 : public halco::common::detail::BaseType<RxDroppedCount, uint32_t>
403 constexpr explicit RxDroppedCount(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
411 struct GENPYBIND(inline_base("*
")) RxCount
412 : public halco::common::detail::BaseType<RxCount, uint32_t>
414 constexpr explicit RxCount(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
422 struct GENPYBIND(inline_base("*
")) TxCount
423 : public halco::common::detail::BaseType<TxCount, uint32_t>
425 constexpr explicit TxCount(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
430 GENPYBIND(getter_for(crc_error_count))
431 CRCErrorCount get_crc_error_count() const SYMBOL_VISIBLE;
432 GENPYBIND(setter_for(crc_error_count))
433 void set_crc_error_count(CRCErrorCount value) SYMBOL_VISIBLE;
435 GENPYBIND(getter_for(online_time))
436 OnlineTime get_online_time() const SYMBOL_VISIBLE;
437 GENPYBIND(setter_for(online_time))
438 void set_online_time(OnlineTime value) SYMBOL_VISIBLE;
440 GENPYBIND(getter_for(rx_dropped_count))
441 RxDroppedCount get_rx_dropped_count() const SYMBOL_VISIBLE;
442 GENPYBIND(setter_for(rx_dropped_count))
443 void set_rx_dropped_count(RxDroppedCount value) SYMBOL_VISIBLE;
445 GENPYBIND(getter_for(rx_count))
446 RxCount get_rx_count() const SYMBOL_VISIBLE;
447 GENPYBIND(setter_for(rx_count))
448 void set_rx_count(RxCount value) SYMBOL_VISIBLE;
450 GENPYBIND(getter_for(tx_count))
451 TxCount get_tx_count() const SYMBOL_VISIBLE;
452 GENPYBIND(setter_for(tx_count))
453 void set_tx_count(TxCount value) SYMBOL_VISIBLE;
455 bool operator==(PhyStatus const& other) const SYMBOL_VISIBLE;
456 bool operator!=(PhyStatus const& other) const SYMBOL_VISIBLE;
458 GENPYBIND(stringstream)
459 friend std::ostream& operator<<(std::ostream& os, PhyStatus const& config) SYMBOL_VISIBLE;
461 static size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 5;
462 static size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 0;
463 static std::array<halco::hicann_dls::vx::OmnibusAddress, read_config_size_in_words>
464 read_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
465 static std::array<halco::hicann_dls::vx::OmnibusAddress, write_config_size_in_words>
466 write_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
467 std::array<fisch::vx::word_access_type::Omnibus, write_config_size_in_words> encode() const
468 SYMBOL_VISIBLE GENPYBIND(hidden);
469 void decode(std::array<fisch::vx::word_access_type::Omnibus, read_config_size_in_words> const&
470 data) SYMBOL_VISIBLE GENPYBIND(hidden);
473 friend class cereal::access;
474 template <typename Archive>
475 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
477 CRCErrorCount m_crc_error_count;
478 OnlineTime m_online_time;
479 RxDroppedCount m_rx_dropped_count;
484 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(PhyStatus)
489 struct BackendContainerTrait<PhyStatus>
490 : public BackendContainerBase<PhyStatus, fisch::vx::word_access_type::Omnibus>
493 } // namespace detail
496 } // namespace haldls
Common base class for PhyConfig of the FPGA- and chip-side PHYs.
std::true_type is_leaf_node
#define GENPYBIND_TAG_HALDLS_VX