Altera_Forum
Honored Contributor
14 years agodff with async reset and set got warning of latches on FPGA 3C5
A very simple dff with async reset and preset got warining of latches if I use FPGA 3C5.
module dff(reset, set,clk,d,q); input reset,set,clk,d; output q; reg q; always@(posedge clk or negedge reset or negedge set) begin if(!reset) q<=0; else if(!set) q<=1; else q<=d; end endmodule There was no any problem when I use MAXII or MAX V CPLD. But after I switched to FPGA 3C5, I got the warning, as well as FPGA 2C8 "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: Timing Analysis is analyzing one or more combinational loops as latches" However the simulation result and the actual testing was correct. My questions are: 1, Why FPGA got this warring but CPLD not ? 2, How to fix it? Thank you.