本帖最后由 fpgaw 于 2010-7-6 06:24 编辑
源代码如下:
module nonblock(reset,din,clk,dout);
input reset,clk;
input[7:0] din;
output[7:0] dout;
reg clk1;
reg[7:0] din_reg1,din_reg2,dout;
always @(posedge reset orposedge clk)
begin
if(reset)
clk1 <= 1'b0;
else
clk1 <= ~clk1;
end
always @(posedge reset or posedge clk1)
begin
if(reset)
begin
din_reg1 <= 8'd0;
din_reg2 <= 8'd0;
dout <= 8'd0;
end
else
begin
din_reg1 <= din;
din_reg2 <= din_reg1;
dout <= din_reg2;
end
end
endmodule
问题是在时序仿真的时候好像不是按照clk1进行采样的,不知道是什么原因?请高手解答。附仿真波形图;谢谢回答^_^ |