lpm_counter bug?

May 25, 2005 4 Replies

Hi,



I'm using Quartus 4.1 Web Edition to program a MAX7000S CPLD.



I'm using an lpm_counter as a programmable divider with data[] and sload inputs, and cout output. I'm not using the q[] outputs. Originally, I connected cout directly back to sload, but I had intermittent problems. I routed cout to an I/O so I could look at it on the 'scope, and it was oscillating at very high frequency. To fix this, I had to put a DFF between the cout and the sload. This works, but now I need two dividers, and I can't spare another DFF. Is there another way to do it?


I don't see the behavior of the cout and the sload documented.

I would expect your tools would report a race condition if the cout IS dependent on the sload. But, assume for the moment the sload affects the cout such that an sload with a data[] value of all ones would force a cout even if the original count was less.

To get around the problem, tie sload to "the q[] value of all ones" to eliminate the cout dependence on sload.

between

Hi Andrew,

There was a problem with Q II 4.1 which didn't synthesize lpm_counter correctly, but not when targetting this device. Still, you might want to check it out:

formatting link

-- Pete

Andrew Holme wrote:

Hi Peter,

Thanks, I came across that article myself. I didn't think it applied because the MAX7000S isn't listed - as you point out, and also I'm not using synchronous clear or asynchronous set. It does sound spookily similar though. Perhaps I should try it anyway...

Andrew Holme wrote: [snip]

I should've mentioned -

  1. I'm using the lpm_counter as a down counter.

  1. I think (fairly sure, but not 100%) the problem goes away if you add a clock enable input - this forces it to use a different template or something.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required