48 sc_out<double> filtered_speed;
51 sc_inout<int> elapsed_time;
54 sc_signal<double> raw_speed;
57 void read_speed_proc();
60 void filter_speed_proc();
65 sensitive << pulse.pos();
68 sensitive << raw_speed;
78 sc_in<double> filtered_speed;
85 void pwm_driver_proc();
90 sensitive << filtered_speed;
102 sc_out<double> speed;
103 sc_out<double> angle;
106 sc_signal<int> elapsed_time;
107 sc_signal<double> filtered_speed;
110 speed_read_mod *read_mod;
111 speed_pwm_mod *pwm_mod;
114 void find_time_proc();
119 sensitive << clk.pos();
121 read_mod =
new speed_read_mod(
"read_mod");
122 pwm_mod =
new speed_pwm_mod(
"pwm_mod");
124 read_mod->start.bind(start);
125 read_mod->pulse.bind(pulse);
126 read_mod->elapsed_time.bind(elapsed_time);
127 read_mod->filtered_speed.bind(filtered_speed);
129 pwm_mod->start.bind(start);
130 pwm_mod->filtered_speed.bind(filtered_speed);
131 pwm_mod->speed.bind(speed);
132 pwm_mod->angle.bind(angle);
135 filtered_speed = 0.0;