36struct sc_clock_ext :
public sc_core::sc_clock {
42 cci::cci_param<sc_core::sc_time>
period;
56 sc_clock_ext(
const char* name_,
const sc_core::sc_time& period_,
double duty_cycle_ = 0.5,
57 const sc_core::sc_time& start_time_ = sc_core::SC_ZERO_TIME,
bool posedge_first_ =
true)
58 : sc_core::sc_clock(name_, period_, duty_cycle_, start_time_, posedge_first_)
59 ,
period(get_cci_name(name_,
"period"), period_,
"The period of the generated clock")
60 ,
duty_cycle(get_cci_name(name_,
"duty_cycle"), duty_cycle_,
"The duty cycle of the generated clock")
61 ,
initial_delay(get_cci_name(name_,
"start_time"), start_time_,
"The start time of the generated clock") {
68 void end_of_elaboration()
override {
72 m_next_posedge_event.cancel();
75 m_next_negedge_event.cancel();
80 void period_write_callback(
const cci::cci_param_write_event<int>& ev) {}
81 static inline std::string get_cci_name(
const char* base,
const char* name) {
return std::string(base) +
"_" + name; }