Hi,
I realised the pipeline that I talked before (
https://www.edaboard.com/threads/275809/), but now I have some doubts on the maximum frequency.
I have a Spartan-3E FPGA running at 50MHz and I want to test my pipeline on it. I linked the output result with the 7-segments display and all works "fine" (I'll explain this a bit after).
The problem is: how can I calculate the maximum frequency?
I added a DCM in my design, because I already know that my pipeline has to work below the 50MHz frequency.
Let's say I tried with 20MHz (base_clock / 2.5): I tested my project on the FPGA, but sometimes the result is wrong.
Fine... I put a 20ns (50MHz) constraint for the base clock (that I repeat works at 50MHz and it's called "clk_in") and in the Post-PAR (Place and Route) I find this:
Derived Constraint Report
Derived Constraints for TS_clk_in
+-------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
| | Period | Actual Period | Timing Errors | Paths Analyzed |
| Constraint | Requirement |-------------+-------------|-------------+-------------|-------------+-------------|
| | | Direct | Derivative | Direct | Derivative | Direct | Derivative |
+-------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
|TS_clk_in | 20.000ns| 6.000ns| 21.765ns| 0| 20| 0|163484298872214|
| TS_Clock_DCM_CLKDV_BUF | 50.000ns| 54.413ns| N/A| 20| 0|163484298872214| 0|
+-------------------------------+-------------+-------------+-------------+-------------+-------------+-------------+-------------+
1 constraint not met.
Data Sheet report:
-----------------
All values displayed in nanoseconds (ns)
Clock to Setup on destination clock clk_in
---------------+---------+---------+---------+---------+
| Src:Rise| Src:Fall| Src:Rise| Src:Fall|
Source Clock |Dest:Rise|Dest:Rise|Dest:Fall|Dest:Fall|
---------------+---------+---------+---------+---------+
clk_in | 54.413| | | |
---------------+---------+---------+---------+---------+
Timing summary:
---------------
Timing errors: 20 Score: 41134 (Setup/Max: 41134, Hold: 0)
Constraints cover 163484298872214 paths, 0 nets, and 6552 connections
Design statistics:
Minimum period: 54.413ns{1} (Maximum frequency: 18.378MHz)
------------------------------------Footnotes-----------------------------------
1) The minimum period statistic assumes all single cycle delays.
So it seems fine to me that if I "run" my project a 20MHz, and not 18.378MHz, it doesn't work properly.
Ok, so I tried with 15MHz and it still doesn't work (sometimes the pipeline output is wrong).
Then I tried with 12.5MHz and it's the same.
My pipeline works only at 10MHz (and below)... Why? How can I justify the discrepancy of about 8MHz from the report and the "practice"? And how can I "predict" it instead of going with multiple attempts (lowering the frequency)?
Thanks