Forum Discussion
Altera_Forum
Honored Contributor
9 years agoHi,
not a senior, but I also had to wrap my head around that recently... Input delay:- So the FPGA receives a clock, and some signal launched on that clock. It needs to latch that signal. In order not to violate the FPGA's tSU/tH, the timing must be known
- What's the time, relative to the clock the FPGA sees, when the data signal can change? Well, that's the delay from the oscillator to the external device (cd_ext), plus the time the external device needs (tco_ext), plus the time the signal needs from the external device. But wait, the FPGA doesn't see the oscillator clock - it sees it delayed, as the clock must propagate from the oscillator to the FPGA as well! That's why you subtract that delay (cd_altr)
- Now it's obvious that you need to do worst-case calculations. Okay, the earliest time the FPGA might see a change on the signal is when the external device's timing is minimal, and the propagation delay from the oscillator is maximal. That's the second formula. Do the analogous calculation for the latest time the FPGA might see a change on the signal (first formula)
- Now the FPGA launches a signal, which the external device must latch. If you don't want to violate the external device's tSU/tH, the timing must be known again
- When is it safe for the FPGA to launch (i.e. change) the signal? Well, you must not violate the setup time of the external device, so you start there (tsu_ext). That's how long before the latch clock the signal must be stable at the external device (we're looking at the externa device now, so we're talking about the latch clock). Okay, but way, the signal must be stable even longer before tSU, because it needs to propagate to there first! So that's the delay from the oscillator to the FPGA (cd_altr) and from the FPGA to the external device (dd). And don't forget the clock-to-out delay of the FPGA itself - but fortunately, the timing analyzer knows that time and takes it into account. Now one last thing: the external device's latch clock is a delayed version of the oscillator clock - that's why you must subtract that propagation delay (cd_ext)
- Next question, when is it safe for the FPGA to change the signal after the launch clock? No, that's not the same as the previous question, as tCO of the FPGA might be a small range; and you have jitter probably. So again, similar calculation, but this time with the hold time of the external register (th_ext), but the signs (except for the hold time, of course) are the same (even though the 2nd formula has more parentheses, for no apparent reason)
- Bonus: why are the signs of tsu_ext and th_ext opposite? Well, that's simply because tSU happens before the clock, and tH happens after the clock