Forum Discussion
5 Replies
- Altera_Forum
Honored Contributor
Does anybody who used lpm_ff find this? Allthough lpm_ff is a very basic IP, but it provides some functions which "<=" in verilog does not have such as syn/asyn reset. So it seems bring some inconveniences.
- Altera_Forum
Honored Contributor
I think, Altera has cleaned up the Megawizard from functions, that can be easily replaced by a few lines of HDL code. lpm_ff nevertheless exists in the lpm libraries for backward compatibility and can be instantiated in your code if you copy the component/module definitions from previous Quartus versions or write new interface instances from the scratch.
- Altera_Forum
Honored Contributor
If you want to implement sync and async reset this is easily done in Verilog:
module dFF( input clk, input asyncReset, input syncReset, input d, output q ); reg r; assign q = r; always @(posedge clk, posedge asyncReset) begin if(asyncReset) r <= 1'b0; else if(syncReset) r <= 1'b0; else r <= d; end endmodule - Altera_Forum
Honored Contributor
Thanks FvM. The only thing is when I write a verilog code to describe the behavior of a simple module, I don't know whether it is optimized same as the IP core in Megawizard.
For example, originally I always use IP "Counter" to count the number. Actually, in some cases describe the counter using behavior description Verilog will be much simpler. And I write two codes one with IP counter another just using Verilog behavior description, then I found the cost number of LEs are very similar (should be same but I am not sure), and timing parameters are similar too, then I will prefer using Verilog to write instead of using IP counter. The similar things will happen in other simple IP like add, subtract. I just wonder when you confront the similar problems, how do you which one is better? Using IP or write behavior description code by yourself? Thanks very much. - Altera_Forum
Honored Contributor
Yes, you are right. The only thing I am worried is whether Altera IP is more optimized.
Now, the lpm_ff has been removed. So the code you post will be the first choice. Thanks very much.