util_pulse_gen: Use equal-to for counter reset

main
Istvan Csomortani 2018-02-23 12:01:37 +00:00 committed by István Csomortáni
parent 017dcaed82
commit e16f45c792
1 changed files with 2 additions and 2 deletions

View File

@ -68,11 +68,11 @@ module util_pulse_gen #(
if (rstn == 1'b0) begin if (rstn == 1'b0) begin
pulse_period_cnt <= 32'h0; pulse_period_cnt <= 32'h0;
end else begin end else begin
pulse_period_cnt <= (pulse_period_cnt < pulse_period_d) ? (pulse_period_cnt + 1) : 32'b0; pulse_period_cnt <= (pulse_period_cnt == pulse_period_d) ? 32'b0 : (pulse_period_cnt + 1);
end end
end end
assign end_of_period_s = (pulse_period_cnt == (pulse_period_d - 1)) ? 1'b1 : 1'b0; assign end_of_period_s = (pulse_period_cnt == pulse_period_d) ? 1'b1 : 1'b0;
// generate pulse with a specified width // generate pulse with a specified width