用verilog写的异步置位清零的D触发器:
module asyn_d (
clk,
clr,
set,
d,
q
);
//input signal
input clk;
input clr,set;
input d;
//output signal
output q;
//declare the type of data
reg q;
//logic relationship
always @(posedge clk or posedge clr or posedge set)
begin
if(clr) //if clr is high level,then reset 'q'
begin q <= 1'b0; end
else //if clr is loe level,then..
if(set)
begin q <=1'b1; end
else
begin q <= d; end
end
endmodule
Quartus ii 9.0功能仿真结果:
功能仿真警告:Warning: Found clock-sensitive change during active clock edge at time 75.0 ns on register "|asyn_d|q~reg0"
时序仿真:
http://bbs.dicder.com/data/attac ... 9nzisrvfp27vlsf.jpg
时序仿真没有产生警告,为什么时序仿真时错误的?
整体编译结果:
Warning: Presettable and clearable registers converted to equivalent circuits with latches. Registers power-up to an undefined state, and DEVCLRn places the registers in an undefined state.
Warning (13310): Register "q~reg0" is converted into an equivalent circuit using register "q~reg0_emulated" and latch "q~reg0latch"
Warning: No exact pin location assignment(s) for 5 pins of 5 total pins
Info: Pin q not assigned to an exact location on the device
Info: Pin set not assigned to an exact location on the device
Info: Pin clr not assigned to an exact location on the device
Info: Pin d not assigned to an exact location on the device
Info: Pin clk not assigned to an exact location on the device
Warning: Found 1 output pins without output pin load capacitance assignment
Info: Pin "q" has no specified output pin load capacitance -- assuming default load capacitance of 0 pF for timing analysis
Warning: The Reserve All Unused Pins setting has not been specified, and will default to 'As output driving ground'.
Warning: Timing Analysis is analyzing one or more combinational loops as latches
Warning: Node "q~reg0latch" is a latch
Warning: Found pins functioning as undefined clocks and/or memory enables
Info: Assuming node "clk" is an undefined clock
请高手指点……
此帖出自
小平头技术问答
一周热门 更多>