17#ifndef _SYSC_CLOCK_IF_MIXINS_H_
18#define _SYSC_CLOCK_IF_MIXINS_H_
22#include "scml_clock/scml_clock_if.h"
34template <
typename BASE>
38 public scml_clock_observer
47 sc_core::sc_in<bool>
clk_i{
"clk_i"};
61 template <
typename... Args>
63 : BASE(nm, std::forward<Args>(args)...) {}
77 if(
auto scml_clk_if = scml2::get_scml_clock(
clk_i)) {
78 scml_clk_if->register_observer(
this);
79 handle_clock_parameters_updated(scml_clk_if);
80 BASE::end_of_elaboration();
84 auto clk_if =
dynamic_cast<sc_core::sc_clock*
>(
clk_i.get_interface());
85 sc_assert(clk_if !=
nullptr);
86 this->set_clock_period(clk_if->period());
87 BASE::end_of_elaboration();
90 void handle_clock_parameters_updated(scml_clock_if* clk_if)
override { this->set_clock_period(clk_if->get_period()); }
91 void handle_clock_deleted(scml_clock_if*)
override{};
109 sc_core::sc_in<sc_core::sc_time>
clk_i{
"clk_i"};
117#if SYSTEMC_VERSION < 20250221
121 this->sensitive <<
clk_i;
129 template <
typename... Args>
131 : BASE(nm, std::forward<Args>(args)...) {
132#if SYSTEMC_VERSION < 20250221
136 this->sensitive <<
clk_i;
149 void clock_cb() { this->set_clock_period(
clk_i.read()); }
sc_core::sc_in< bool > clk_i
ticking_clock(sc_core::sc_module_name const &nm)
Constructor for the ticking_clock class.
void end_of_elaboration() override
Method called at the end of elaboration.
virtual ~ticking_clock()=default
Virtual destructor for the tickless_clock class.
ticking_clock(sc_core::sc_module_name const &nm, Args &&... args)
Constructor for the ticking_clock class with variable number of arguments.
virtual ~tickless_clock()=default
Virtual destructor for the tickless_clock class.
tickless_clock(sc_core::sc_module_name const &nm, Args &&... args)
Constructor for the tickless_clock class with template arguments.
tickless_clock(sc_core::sc_module_name const &nm)
Constructor for the tickless_clock class.
sc_core::sc_in< sc_core::sc_time > clk_i