Removed latch
This commit is contained in:
parent
3f3d4503b7
commit
e9b57fae1e
@ -1,3 +1,5 @@
|
|||||||
|
`timescale 1ns/1ps
|
||||||
|
|
||||||
module motorcontrol #(parameter N=21)
|
module motorcontrol #(parameter N=21)
|
||||||
(input logic clk,
|
(input logic clk,
|
||||||
input logic rst,
|
input logic rst,
|
||||||
@ -37,6 +39,11 @@ module motorcontrol #(parameter N=21)
|
|||||||
pwm = 0;
|
pwm = 0;
|
||||||
next_state = state;
|
next_state = state;
|
||||||
end
|
end
|
||||||
|
default:
|
||||||
|
begin
|
||||||
|
pwm = 0;
|
||||||
|
next_state = reset;
|
||||||
|
end
|
||||||
endcase
|
endcase
|
||||||
end
|
end
|
||||||
endmodule
|
endmodule
|
||||||
|
@ -18,12 +18,15 @@ module motorcontrol_tb();
|
|||||||
clk = 0;
|
clk = 0;
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
|
$dumpfile("output.vcd");
|
||||||
|
$dumpvars;
|
||||||
rst = 1; direction = 0;
|
rst = 1; direction = 0;
|
||||||
#10; rst = 0;
|
#10; rst = 0;
|
||||||
#19999990; rst = 1; direction = 1;
|
#19999990; rst = 1; direction = 1;
|
||||||
#10; rst = 0;
|
#10; rst = 0;
|
||||||
#19999990; rst = 1;
|
#19999990; rst = 1;
|
||||||
#10; rst = 0;
|
#10; rst = 0;
|
||||||
|
$finish;
|
||||||
end
|
end
|
||||||
|
|
||||||
endmodule
|
endmodule
|
||||||
|
Loading…
x
Reference in New Issue
Block a user