Removed latch

This commit is contained in:
xeovalyte 2025-02-20 08:53:45 +01:00
parent 3f3d4503b7
commit e9b57fae1e
Signed by: xeovalyte
SSH Key Fingerprint: SHA256:kSQDrQDmKzljJzfGYcd3m9RqHi4h8rSwkZ3sQ9kBURo
2 changed files with 16 additions and 6 deletions

View File

@ -1,3 +1,5 @@
`timescale 1ns/1ps
module motorcontrol #(parameter N=21)
(input logic clk,
input logic rst,
@ -37,6 +39,11 @@ module motorcontrol #(parameter N=21)
pwm = 0;
next_state = state;
end
default:
begin
pwm = 0;
next_state = reset;
end
endcase
end
endmodule

View File

@ -18,12 +18,15 @@ module motorcontrol_tb();
clk = 0;
initial begin
$dumpfile("output.vcd");
$dumpvars;
rst = 1; direction = 0;
#10; rst = 0;
#19999990; rst = 1; direction = 1;
#10; rst = 0;
#19999990; rst = 1;
#10; rst = 0;
$finish;
end
endmodule