generator quick fix

This commit is contained in:
2026-05-29 18:01:31 +03:00
parent 906d5090cd
commit 0a68a753be
2 changed files with 58 additions and 44 deletions

View File

@ -43,7 +43,8 @@ module generator
cnt_pulse_num <= '0;
cnt_period <= '0;
sample_req <= 0;
end else begin
end
else begin
if (start & !enable) begin
enable <= 1'b1;
cnt_pulse_num <= '0;
@ -77,12 +78,12 @@ module generator
end
else begin
if (cnt_period <= pulse_width_reg) begin
if (cnt_period < pulse_width_reg - 1) begin
pulse_height_out_reg <= pulse_height_reg;
end else begin
pulse_height_out_reg <= ZERO_LEVEL;
end
if (cnt_period == pulse_period_reg) begin
if (cnt_period == pulse_period_reg - 1) begin
cnt_period <= 0;
end else begin
cnt_period <= cnt_period + 1;