G
Giuseppe Marullo
Guest
Hi,
I am designing a very simple cw keyer, and I am wondering why some
timings in reset signal is triggering timing violations.
My problem is that apparently symmetrical FSMs get warnings on one
instance while the other not.
I got timing violations when reset duration is, for example 60ns or
100ns in the testbench:
....
// Initialize Inputs
fx2_clk = 0;
paddledot <= 1'b1;
paddledash = 1'b1;
resetpin = 1;
// Wait 100 ns for global reset to finish
#60;
resetpin = 0;
60 or 100ns are exactly on the raising edge of the feeded fx2_clk (40ns
period).
I got these warnings:
WARNING:Simulator:29 - at 63.358 ns: Warning: Timing violation in
/test002/uut/dashstate_FSM_FFd1/ $recrem<recovery>( RST:62.893 ns,
CLK:63.358 ns,991.000 ps)
WARNING:Simulator:29 - at 63.370 ns: Warning: Timing violation in
/test002/uut/morsestate_FSM_FFd1/ $recrem<recovery>( RST:62.958 ns,
CLK:63.370 ns,991.000 ps)
My question is: why I got the warning on dashstate and not on dotstate?
They are debouncers for the dot and dash paddle inputs and they are
identical.
I have similar problems on another FSM:
....
always @(posedge fx2_clk or posedge resetpin )
if (resetpin)
begin
// cwkeyer <= 1'b0;
// wpm_tick_trigger <= 1'b0;
morsestate <= 4'b0000;
end
else
case (morsestate)
4'b0000: begin
// init state
cwkeyer <= 1'b0;
wpm_tick_trigger <= 1'b0;
morsestate <= 4'b0001;
end
....
but not on this, that looks similar to me:
....
// WPM timer - fixed at 12 WPM at the moment
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
// wpm_tick_elapsed <= 1'b0;
// cntwpm <= 24'b0;
wpmstate <= 4'b0000;
end
else
case (wpmstate)
4'b0000: begin
wpm_tick_elapsed <= 1'b0;
cntwpm <= 24'b0;
wpmstate <= 4'b0001;
end
....
The other question is: how is supposed async reset to be properly
handled? Should I ignore the warnings?
WebISE is 10.1
TIA,
Giuseppe Marullo
PS: some snipplets of code:
....
reg [3:0] dotstate;
reg [3:0] dashstate;
....
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
//dashout <= 1'b0;
//cntdash <= 4'b0;
dashstate <= 4'b0000;
end
else
case (dashstate)
4'b0000: begin
dashout <= 1'b0;
cntdash <= 4'b0;
dashstate <= 4'b0001;
end
4'b0001: begin
if (paddledash == 1'b0)
dashstate <= 4'b0010;
else
dashout <=1'b0;
end
4'b0010: begin
if (paddledash == 1'b0)
begin
cntdash <= cntdash + 1'b1;
end
if (cntdash == 4'b011)
begin
dashout <= 1'b1;
cntdash <= 4'b0;
dashstate <= 4'b0001;
end
end
endcase
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
// dotout <= 1'b0;
// cntdot <= 4'b0;
dotstate <= 4'b0000;
end
else
case (dotstate)
4'b0000: begin
dotout <= 1'b0;
cntdot <= 4'b0;
dotstate <= 4'b0001;
end
4'b0001: begin
if (paddledot == 1'b0)
dotstate <= 4'b0010;
else
dotout <=1'b0;
end
4'b0010: begin
if (paddledot == 1'b0)
begin
cntdot <= cntdot + 1'b1;
end
if (cntdot == 4'b011)
begin
dotout <= 1'b1;
cntdot <= 4'b0;
dotstate <= 4'b0001;
end
end
endcase
....
I am designing a very simple cw keyer, and I am wondering why some
timings in reset signal is triggering timing violations.
My problem is that apparently symmetrical FSMs get warnings on one
instance while the other not.
I got timing violations when reset duration is, for example 60ns or
100ns in the testbench:
....
// Initialize Inputs
fx2_clk = 0;
paddledot <= 1'b1;
paddledash = 1'b1;
resetpin = 1;
// Wait 100 ns for global reset to finish
#60;
resetpin = 0;
60 or 100ns are exactly on the raising edge of the feeded fx2_clk (40ns
period).
I got these warnings:
WARNING:Simulator:29 - at 63.358 ns: Warning: Timing violation in
/test002/uut/dashstate_FSM_FFd1/ $recrem<recovery>( RST:62.893 ns,
CLK:63.358 ns,991.000 ps)
WARNING:Simulator:29 - at 63.370 ns: Warning: Timing violation in
/test002/uut/morsestate_FSM_FFd1/ $recrem<recovery>( RST:62.958 ns,
CLK:63.370 ns,991.000 ps)
My question is: why I got the warning on dashstate and not on dotstate?
They are debouncers for the dot and dash paddle inputs and they are
identical.
I have similar problems on another FSM:
....
always @(posedge fx2_clk or posedge resetpin )
if (resetpin)
begin
// cwkeyer <= 1'b0;
// wpm_tick_trigger <= 1'b0;
morsestate <= 4'b0000;
end
else
case (morsestate)
4'b0000: begin
// init state
cwkeyer <= 1'b0;
wpm_tick_trigger <= 1'b0;
morsestate <= 4'b0001;
end
....
but not on this, that looks similar to me:
....
// WPM timer - fixed at 12 WPM at the moment
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
// wpm_tick_elapsed <= 1'b0;
// cntwpm <= 24'b0;
wpmstate <= 4'b0000;
end
else
case (wpmstate)
4'b0000: begin
wpm_tick_elapsed <= 1'b0;
cntwpm <= 24'b0;
wpmstate <= 4'b0001;
end
....
The other question is: how is supposed async reset to be properly
handled? Should I ignore the warnings?
WebISE is 10.1
TIA,
Giuseppe Marullo
PS: some snipplets of code:
....
reg [3:0] dotstate;
reg [3:0] dashstate;
....
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
//dashout <= 1'b0;
//cntdash <= 4'b0;
dashstate <= 4'b0000;
end
else
case (dashstate)
4'b0000: begin
dashout <= 1'b0;
cntdash <= 4'b0;
dashstate <= 4'b0001;
end
4'b0001: begin
if (paddledash == 1'b0)
dashstate <= 4'b0010;
else
dashout <=1'b0;
end
4'b0010: begin
if (paddledash == 1'b0)
begin
cntdash <= cntdash + 1'b1;
end
if (cntdash == 4'b011)
begin
dashout <= 1'b1;
cntdash <= 4'b0;
dashstate <= 4'b0001;
end
end
endcase
always @(posedge fx2_clk or posedge resetpin)
if (resetpin)
begin
// dotout <= 1'b0;
// cntdot <= 4'b0;
dotstate <= 4'b0000;
end
else
case (dotstate)
4'b0000: begin
dotout <= 1'b0;
cntdot <= 4'b0;
dotstate <= 4'b0001;
end
4'b0001: begin
if (paddledot == 1'b0)
dotstate <= 4'b0010;
else
dotout <=1'b0;
end
4'b0010: begin
if (paddledot == 1'b0)
begin
cntdot <= cntdot + 1'b1;
end
if (cntdot == 4'b011)
begin
dotout <= 1'b1;
cntdot <= 4'b0;
dotstate <= 4'b0001;
end
end
endcase
....