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");
128 read_mod->start(start);
129 read_mod->pulse(pulse);
130 read_mod->elapsed_time(elapsed_time);
131 read_mod->filtered_speed(filtered_speed);
137 pwm_mod->start(start);
138 pwm_mod->filtered_speed.bind(filtered_speed);
139 pwm_mod->speed.bind(speed);
140 pwm_mod->angle(angle);
143 filtered_speed = 0.0;