1#
发表于 2015-04-11 22:08:47
module test_timing_sync(
input reset_async_in,
input din,
input clk,
output reg reset_sync_out
);
reg reset_d1;
reg reset_d2;
always@(posedge clk)
begin
reset_d1<=reset_async_in;
reset_d2<=reset_d1;
end
reg din_d1;
always@(posedge clk)
begin
din_d1<=din;
end
reg din_d2;
always@(posedge clk /*or posedge reset_d2*/)
begin
if(reset_d2)
din_d2<=1'b0;
else
din_d2<=din_d1;
end
always@(posedge clk)
begin
reset_sync_out<=din_d2;
end
endmodule
module test_timing_async(
input reset_async_in,
input din,
input clk,
output reg reset_sync_out
);
reg reset_d1;
reg reset_d2;
always@(posedge clk)
begin
reset_d1<=reset_async_in;
reset_d2<=reset_d1;
end
reg din_d1;
always@(posedge clk)
begin
din_d1<=din;
end
reg din_d2;
always@(posedge clk or posedge reset_d2)
begin
if(reset_d2)
din_d2<=1'b0;
else
din_d2<=din_d1;
end
always@(posedge clk)
begin
reset_sync_out<=din_d2;
end
endmodule
以上两个模块差别仅在于always@(posedge clk or posedge reset_d2)是否为异步复位或同步复位
时序约束为
NET "clk" TNM_NET = clk;
TIMESPEC TS_clk = PERIOD "clk" 20 ns HIGH 50%;
发现同步复位的设计reset_d2与din_d2之间会有setup/hold检查,而异步复位则是没有检查,而且也没有
recovery time和removal time时序检查。
而很多设计人员,尤其是本人经常采用异步复位同步化的策略,但代码风格上会采用异步复位方式编写。
请问第二种写法reset_d2到din_d2之间确实不会有时序检查么?
|