Forum Discussion
lpm_ff megafunction
I am analyzing an old design of an FPGA that looks like it is clocking data in with the lpmFF megafunction set up as a D flip flop. But looking at the input data with an analyzer, the input data goes valid after the rising edge of the clock input to the megawizard flip flop so it seems like a D flip flop would not work properly. Typically a D flipflop sets the output to the input on the rising edge of the input clock. Just wondering if there is a way to set up the lpm_FF megafunction to have the output follow the input when the clock signal is high and then latch the output when clock goes low as perhaps this is what is going on? Also is there a way to simulate what the design will do by entering simulated input signals?
14 Replies
- Altera_Forum
Honored Contributor
Yeah I cascaded a few flip-flops together and my design is working. I also read in the User Guide for lpm_shiftreg that this megafunction is not supported by the device I am implementing on; hence I will go with the cascade.
Thanks. - Altera_Forum
Honored Contributor
a shift register is really just a chain of flip flops.
- Altera_Forum
Honored Contributor
I was looking into the lpm_shiftreg megafunction and am a little confused.
I basically want to delay a 16-bit input to a multiplier by 5 clock periods. I did not find any option in the MegaWizard for lpm_shiftreg to set the desired time delay. Any help will be appreciated. - Altera_Forum
Honored Contributor
try a shift register?
- Altera_Forum
Honored Contributor
I noticed that the lpm_ff megafunction has been removed from Quartus 10.1.
Is there any other similar megafunction that can be used to delay the input, for example, by 5 clock periods? I don't want to use 5 dff blocks. Thank you. - Altera_Forum
Honored Contributor
thanks for the replies, I think something is going on with the input data. I also ran a simulation to verify the behavior.
- Altera_Forum
Honored Contributor
--- Quote Start --- Looks like the previous timing diagram got messed up, I have included a txt file showing input signals to the megawizard, thanks. --- Quote End --- The diagram you give shows the '1' value of data is more a glitch than a real data value, and is rightly ignored. pletz has given you a diagram of what should really happen. - Altera_Forum
Honored Contributor
--- Quote Start --- Looks like the previous timing diagram got messed up, I have included a txt file showing input signals to the megawizard, thanks. --- Quote End --- Hi, you have to keep the required timing conditions in order to get the right functionality. The input data needs to stable a certain time before the active edge ( setup requirement) and needs to stable for a ceratin time after the active edge ( hold time requirement). The output of your FF will be always "0" with the given timing diagramm. Have a look to the attached file. Kind regards GPK - Altera_Forum
Honored Contributor
Looks like the previous timing diagram got messed up, I have included a txt file showing input signals to the megawizard, thanks.
- Altera_Forum
Honored Contributor
you text diagram makes no sense. Try using the code tags to light text up.