5 #include "halco/common/geometry.h"
6 #include "halco/common/typed_array.h"
7 #include "halco/hicann-dls/vx/pll.h"
12 #include "hate/visibility.h"
15 class JTAGPLLRegisterOnDLS;
16 class OmnibusChipOverJTAGAddress;
42 struct GENPYBIND(inline_base("*
")) LoopFilterInt
43 : public halco::common::detail::RantWrapper<LoopFilterInt, uint_fast16_t, 31, 1>
45 constexpr explicit LoopFilterInt(uintmax_t const val = 2) : rant_t(val) {}
49 struct GENPYBIND(inline_base("*
")) LoopFilterProp
50 : public halco::common::detail::RantWrapper<LoopFilterProp, uint_fast16_t, 31, 1>
52 constexpr explicit LoopFilterProp(uintmax_t const val = 8) : rant_t(val) {}
59 struct GENPYBIND(inline_base("*
")) LoopDivN
60 : public halco::common::detail::RantWrapper<LoopDivN, uint_fast16_t, 31, 1>
62 constexpr explicit LoopDivN(uintmax_t const val = 10) : rant_t(val) {}
69 struct GENPYBIND(inline_base("*
")) CoreDivM0
70 : public halco::common::detail::RantWrapper<CoreDivM0, uint_fast16_t, 31, 1>
72 constexpr explicit CoreDivM0(uintmax_t const val = 1) : rant_t(val) {}
79 struct GENPYBIND(inline_base("*
")) CoreDivM1
80 : public halco::common::detail::RantWrapper<CoreDivM1, uint_fast16_t, 31, 1>
82 constexpr explicit CoreDivM1(uintmax_t const val = 2) : rant_t(val) {}
89 struct GENPYBIND(inline_base("*
")) PreDivP0
90 : public halco::common::detail::RantWrapper<PreDivP0, uint_fast16_t, 4, 2>
92 constexpr explicit PreDivP0(uintmax_t const val = 2) : rant_t(val) {}
100 struct GENPYBIND(inline_base("*
")) PreDivP1
101 : public halco::common::detail::RantWrapper<PreDivP1, uint_fast16_t, 4, 2>
103 constexpr explicit PreDivP1(uintmax_t const val = 2) : rant_t(val) {}
110 struct GENPYBIND(inline_base("*
")) PreDivP2
111 : public halco::common::detail::RantWrapper<PreDivP2, uint_fast16_t, 4, 2>
113 constexpr explicit PreDivP2(uintmax_t const val = 2) : rant_t(val) {}
117 struct GENPYBIND(inline_base("*
")) Tune
118 : public halco::common::detail::RantWrapper<Tune, uint_fast16_t, 4095, 0>
120 constexpr explicit Tune(uintmax_t const val = 512) : rant_t(val) {}
124 struct GENPYBIND(inline_base("*
")) DcoPowerSwitch
125 : public halco::common::detail::RantWrapper<DcoPowerSwitch, uint_fast16_t, 63, 0>
127 constexpr explicit DcoPowerSwitch(uintmax_t const val = 63) : rant_t(val) {}
131 struct GENPYBIND(inline_base("*
")) FilterShift
132 : public halco::common::detail::RantWrapper<FilterShift, uint_fast16_t, 3, 0>
134 constexpr explicit FilterShift(uintmax_t const val = 3) : rant_t(val) {}
138 ADPLL() SYMBOL_VISIBLE;
140 GENPYBIND(getter_for(loop_filter_int))
141 LoopFilterInt get_loop_filter_int() const SYMBOL_VISIBLE;
142 GENPYBIND(setter_for(loop_filter_int))
143 void set_loop_filter_int(LoopFilterInt value) SYMBOL_VISIBLE;
145 GENPYBIND(getter_for(loop_filter_prop))
146 LoopFilterProp get_loop_filter_prop() const SYMBOL_VISIBLE;
147 GENPYBIND(setter_for(loop_filter_prop))
148 void set_loop_filter_prop(LoopFilterProp value) SYMBOL_VISIBLE;
150 GENPYBIND(getter_for(loop_div_n))
151 LoopDivN get_loop_div_n() const SYMBOL_VISIBLE;
152 GENPYBIND(setter_for(loop_div_n))
153 void set_loop_div_n(LoopDivN value) SYMBOL_VISIBLE;
155 GENPYBIND(getter_for(core_div_m0))
156 CoreDivM0 get_core_div_m0() const SYMBOL_VISIBLE;
157 GENPYBIND(setter_for(core_div_m0))
158 void set_core_div_m0(CoreDivM0 value) SYMBOL_VISIBLE;
160 GENPYBIND(getter_for(core_div_m1))
161 CoreDivM1 get_core_div_m1() const SYMBOL_VISIBLE;
162 GENPYBIND(setter_for(core_div_m1))
163 void set_core_div_m1(CoreDivM1 value) SYMBOL_VISIBLE;
165 GENPYBIND(getter_for(pre_div_p0))
166 PreDivP0 get_pre_div_p0() const SYMBOL_VISIBLE;
167 GENPYBIND(setter_for(pre_div_p0))
168 void set_pre_div_p0(PreDivP0 value) SYMBOL_VISIBLE;
170 GENPYBIND(getter_for(pre_div_p1))
171 PreDivP1 get_pre_div_p1() const SYMBOL_VISIBLE;
172 GENPYBIND(setter_for(pre_div_p1))
173 void set_pre_div_p1(PreDivP1 value) SYMBOL_VISIBLE;
175 GENPYBIND(getter_for(pre_div_p2))
176 PreDivP2 get_pre_div_p2() const SYMBOL_VISIBLE;
177 GENPYBIND(setter_for(pre_div_p2))
178 void set_pre_div_p2(PreDivP2 value) SYMBOL_VISIBLE;
180 GENPYBIND(getter_for(tune))
181 Tune get_tune() const SYMBOL_VISIBLE;
182 GENPYBIND(setter_for(tune))
183 void set_tune(Tune value) SYMBOL_VISIBLE;
185 GENPYBIND(getter_for(dco_power_switch))
186 DcoPowerSwitch get_dco_power_switch() const SYMBOL_VISIBLE;
187 GENPYBIND(setter_for(dco_power_switch))
188 void set_dco_power_switch(DcoPowerSwitch value) SYMBOL_VISIBLE;
194 GENPYBIND(getter_for(open_lock))
195 bool get_open_lock() const SYMBOL_VISIBLE;
201 GENPYBIND(setter_for(open_lock))
202 void set_open_lock(bool value) SYMBOL_VISIBLE;
208 GENPYBIND(getter_for(enforce_lock))
209 bool get_enforce_lock() const SYMBOL_VISIBLE;
215 GENPYBIND(setter_for(enforce_lock))
216 void set_enforce_lock(bool value) SYMBOL_VISIBLE;
222 GENPYBIND(getter_for(pfd_select))
223 bool get_pfd_select() const SYMBOL_VISIBLE;
229 GENPYBIND(setter_for(pfd_select))
230 void set_pfd_select(bool value) SYMBOL_VISIBLE;
236 GENPYBIND(getter_for(lock_window))
237 bool get_lock_window() const SYMBOL_VISIBLE;
243 GENPYBIND(setter_for(lock_window))
244 void set_lock_window(bool value) SYMBOL_VISIBLE;
246 GENPYBIND(getter_for(filter_shift))
247 FilterShift get_filter_shift() const SYMBOL_VISIBLE;
248 GENPYBIND(setter_for(filter_shift))
249 void set_filter_shift(FilterShift value) SYMBOL_VISIBLE;
255 GENPYBIND(getter_for(enable_output_clock))
256 bool get_enable_output_clock() const SYMBOL_VISIBLE;
262 GENPYBIND(setter_for(enable_output_clock))
263 void set_enable_output_clock(bool value) SYMBOL_VISIBLE;
269 GENPYBIND(getter_for(enable))
270 bool get_enable() const SYMBOL_VISIBLE;
276 GENPYBIND(setter_for(enable))
277 void set_enable(bool value) SYMBOL_VISIBLE;
283 GENPYBIND(getter_for(use_external_config))
284 bool get_use_external_config() const SYMBOL_VISIBLE;
290 GENPYBIND(setter_for(use_external_config))
291 void set_use_external_config(bool value) SYMBOL_VISIBLE;
300 double calculate_output_frequency(
301 Output const& output, double const& f_ref = nominal_pll_f_reference) const SYMBOL_VISIBLE;
303 bool operator==(ADPLL const& other) const SYMBOL_VISIBLE;
304 bool operator!=(ADPLL const& other) const SYMBOL_VISIBLE;
306 GENPYBIND(stringstream)
307 friend std::ostream& operator<<(std::ostream& os, ADPLL const& config) SYMBOL_VISIBLE;
309 static size_t constexpr config_size_in_words GENPYBIND(hidden) = 2;
310 template <typename AddressT>
311 static std::array<AddressT, config_size_in_words> addresses(coordinate_type const& coord)
312 SYMBOL_VISIBLE GENPYBIND(hidden);
313 template <typename WordT>
314 std::array<WordT, config_size_in_words> encode() const SYMBOL_VISIBLE GENPYBIND(hidden);
315 template <typename WordT>
316 void decode(std::array<WordT, config_size_in_words> const& data) SYMBOL_VISIBLE
320 friend class cereal::access;
321 template <typename Archive>
322 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
324 LoopFilterInt m_loop_filter_int;
325 LoopFilterProp m_loop_filter_prop;
326 LoopDivN m_loop_div_n;
327 CoreDivM0 m_core_div_m0;
328 CoreDivM1 m_core_div_m1;
329 PreDivP0 m_pre_div_p0;
330 PreDivP1 m_pre_div_p1;
331 PreDivP2 m_pre_div_p2;
333 DcoPowerSwitch m_dco_power_switch;
338 FilterShift m_filter_shift;
339 bool m_enable_output_clock;
341 bool m_use_external_config;
344 std::ostream& operator<<(std::ostream&, ADPLL::Output const&) SYMBOL_VISIBLE;
346 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(ADPLL)
357 struct BackendContainerTrait<ADPLL>
358 : public BackendContainerBase<
360 fisch::vx::word_access_type::JTAGPLLRegister,
361 fisch::vx::word_access_type::OmnibusChipOverJTAG>
364 } // namespace detail
370 class GENPYBIND(visible) PLLSelfTest
373 typedef halco::hicann_dls::vx::PLLSelfTestOnDLS coordinate_type;
374 typedef std::true_type is_leaf_node;
380 struct GENPYBIND(inline_base("*
")) PreScalerP
381 : public halco::common::detail::RantWrapper<PreScalerP, uint_fast16_t, 15, 0>
383 constexpr explicit PreScalerP(uintmax_t const val = 0) : rant_t(val) {}
390 struct GENPYBIND(inline_base("*
")) CheckRange
391 : public halco::common::detail::RantWrapper<CheckRange, uint_fast16_t, 15, 0>
393 constexpr explicit CheckRange(uintmax_t const val = 0) : rant_t(val) {}
400 struct GENPYBIND(inline_base("*
")) CheckValue
401 : public halco::common::detail::
402 RantWrapper<CheckValue, uint_fast16_t, 1048575 /*2^20-1*/, 0>
404 constexpr explicit CheckValue(uintmax_t const val = 0) : rant_t(val) {}
408 PLLSelfTest() SYMBOL_VISIBLE;
415 GENPYBIND(getter_for(clock_enable))
416 bool get_clock_enable() const SYMBOL_VISIBLE;
423 GENPYBIND(setter_for(clock_enable))
424 void set_clock_enable(bool value) SYMBOL_VISIBLE;
426 GENPYBIND(getter_for(pre_scaler_p))
427 PreScalerP get_pre_scaler_p() const SYMBOL_VISIBLE;
428 GENPYBIND(setter_for(pre_scaler_p))
429 void set_pre_scaler_p(PreScalerP value) SYMBOL_VISIBLE;
435 GENPYBIND(getter_for(select_source))
436 halco::hicann_dls::vx::PLLClockOutputOnDLS get_select_source() const SYMBOL_VISIBLE;
442 GENPYBIND(setter_for(select_source))
443 void set_select_source(halco::hicann_dls::vx::PLLClockOutputOnDLS value) SYMBOL_VISIBLE;
445 GENPYBIND(getter_for(check_range))
446 CheckRange get_check_range() const SYMBOL_VISIBLE;
447 GENPYBIND(setter_for(check_range))
448 void set_check_range(CheckRange value) SYMBOL_VISIBLE;
450 GENPYBIND(getter_for(check_value))
451 CheckValue get_check_value() const SYMBOL_VISIBLE;
452 GENPYBIND(setter_for(check_value))
453 void set_check_value(CheckValue value) SYMBOL_VISIBLE;
455 bool operator==(PLLSelfTest const& other) const SYMBOL_VISIBLE;
456 bool operator!=(PLLSelfTest const& other) const SYMBOL_VISIBLE;
458 GENPYBIND(stringstream)
459 friend std::ostream& operator<<(std::ostream& os, PLLSelfTest const& config) SYMBOL_VISIBLE;
461 static size_t constexpr config_size_in_words GENPYBIND(hidden) = 1;
462 template <typename AddressT>
463 static std::array<AddressT, config_size_in_words> addresses(coordinate_type const& coord)
464 SYMBOL_VISIBLE GENPYBIND(hidden);
465 template <typename WordT>
466 std::array<WordT, config_size_in_words> encode() const SYMBOL_VISIBLE GENPYBIND(hidden);
467 template <typename WordT>
468 void decode(std::array<WordT, config_size_in_words> const& data) SYMBOL_VISIBLE
472 friend class cereal::access;
473 template <typename Archive>
474 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
477 PreScalerP m_pre_scaler_p;
478 halco::hicann_dls::vx::PLLClockOutputOnDLS m_select_source;
479 CheckRange m_check_range;
480 CheckValue m_check_value;
483 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(PLLSelfTest)
488 struct BackendContainerTrait<PLLSelfTest>
489 : public BackendContainerBase<
491 fisch::vx::word_access_type::JTAGPLLRegister,
492 fisch::vx::word_access_type::OmnibusChipOverJTAG>
495 } // namespace detail
501 class GENPYBIND(visible) PLLSelfTestStatus
504 typedef halco::hicann_dls::vx::PLLSelfTestStatusOnDLS coordinate_type;
505 typedef std::true_type is_leaf_node;
510 struct GENPYBIND(inline_base("*
")) CounterValue
511 : public halco::common::detail::
512 RantWrapper<CounterValue, uint_fast16_t, 1048575 /*2^20-1*/, 0>
514 constexpr explicit CounterValue(uintmax_t const val = 0) : rant_t(val) {}
520 PLLSelfTestStatus() SYMBOL_VISIBLE;
526 GENPYBIND(getter_for(success))
527 bool get_success() const SYMBOL_VISIBLE;
535 GENPYBIND(getter_for(finished))
536 bool get_finished() const SYMBOL_VISIBLE;
542 GENPYBIND(getter_for(counter_value))
543 CounterValue get_counter_value() const SYMBOL_VISIBLE;
545 GENPYBIND(stringstream)
546 friend std::ostream& operator<<(std::ostream& os, PLLSelfTestStatus const& config)
549 bool operator==(PLLSelfTestStatus const& other) const SYMBOL_VISIBLE;
550 bool operator!=(PLLSelfTestStatus const& other) const SYMBOL_VISIBLE;
552 static size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 1;
553 static size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 0;
554 template <typename AddressT>
555 static std::array<AddressT, read_config_size_in_words> read_addresses(
556 coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
557 template <typename AddressT>
558 static std::array<AddressT, write_config_size_in_words> write_addresses(
559 coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
560 template <typename WordT>
561 std::array<WordT, write_config_size_in_words> encode() const SYMBOL_VISIBLE GENPYBIND(hidden);
562 template <typename WordT>
563 void decode(std::array<WordT, read_config_size_in_words> const& data) SYMBOL_VISIBLE
567 friend class cereal::access;
568 template <typename Archive>
569 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
573 CounterValue m_counter_value;
576 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(PLLSelfTestStatus)
581 struct BackendContainerTrait<PLLSelfTestStatus>
582 : public BackendContainerBase<
584 fisch::vx::word_access_type::OmnibusChipOverJTAG>
587 } // namespace detail
590 } // namespace haldls
594 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::LoopFilterInt)
595 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::LoopFilterProp)
596 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::LoopDivN)
597 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::CoreDivM0)
598 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::CoreDivM1)
599 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::PreDivP0)
600 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::PreDivP1)
601 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::PreDivP2)
602 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::Tune)
603 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::DcoPowerSwitch)
604 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::ADPLL::FilterShift)
605 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::PLLSelfTest::PreScalerP)
606 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::PLLSelfTest::CheckRange)
607 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::PLLSelfTest::CheckValue)
608 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::PLLSelfTestStatus::CounterValue)
Container for configuration of an ADPLL (All-Digital Phased-Locked-Loop) clock generator.
halco::hicann_dls::vx::ADPLLOnDLS coordinate_type
Output
Outputs of the ADPLL.
std::true_type is_leaf_node
#define GENPYBIND_TAG_HALDLS_VX