Your input is other device's output.
First, thank you very much for the kind detailed explanations :-)
That bit I understand, but it makes me realize I was remiss in my explanations - my 'external' (other) device is a mainboard bus, not a single piece of silicon. The numbers I quoted are the timing characteristics as defined by the bus specifications. They were originally implemented in 1989 and have been obsolete for 20 years but that's what I want to interface with... (weird?) hobby stuff
My understanding is that the specifications as quoted are requirements for the peripheral on the bus, which is what I'm trying to implement. So at the connector that plugs into the bus, the signal is valid from 15ns before the edge to 1ns after the edge. To ensure this timing is met when talking to other peripheral on the shared bus, my peripheral must put a valid signal from 25ns before the edge to 2.5ns after the edge (which I forgot to quote, so here it comes).
Parameter | Condition | Symbol | Min. | Max. | Unit |
Output hold time after rising edge of CLK | CL = 50 pF | TOH | 2.5 | | ns |
I'll be thinking out loud below to track my understanding ... or perhaps lack thereof.
I think you need to get the basics right, then everything is simple.
Thanks for the vote of confidence. I'm purely a software guy and hardware - in particular timings - does not come naturally. I'm not finding *anything* simple, from PCB to VHDL
I've managed to get some VHDL simulating to waves similar to what I have in the specifications & books, but that's the 'easy' cycle-per-cycle/purely digital part.
(...) The time the receiver need is called "setup" time.
(...) How much time is needed to finish with the previous state depends on the receiver and is called "hold".
In my case, when my connector is the receiver it needs [setup,hold] from [-20,2.5] ns relative to the clock edge ("to next cycle output valid", "Output hold time" in the specs).
There are also clock adjustments. Clock emanates from some common place and travels to both launcher and receiver.
In my case, the bus supplies the clock. So when I measure clock delay to itself, I believe I can assume it's zero (with perhaps some jitter).
For example set_output_delay is about sending a signal to an outside device. The outside device is a receiver and must have setup and hold characteristics. So, we pile up all the delays which can violate the device's setup. We try to make the delay longer - maximum board delay for the data trace plus receiver setup time minus minimum board delay for the clock trace - this will give you -min you need to give to the tools.
From what you wrote before, I think that last '-min' is a typo and this is the '-max' for setup? So I think I got that one right - except I didn't really do min/max for the track delay yet; I know the length from the board design I will need to estimate max/min signal propagation speeds.
From the FPGA (launcher) to the bus (receiver) setup,
set_output_delay -max
* + maximum board delay for the data trace: 0.47 ns
* + receiver setup time: (40-20)=20 ns
* + maximum origin-to-launcher clock delay: 0.41 ns
* - minimum origin-to-receiver clock delay: 0 ns
* (+ clock jitter)
-> the 20.883 from my original post (modulo some rounding in the copy/paste).
I will have to re-read my specifications for the jitter value.
Similarly, for set_output_delay -min we pile up everything we can to make the delay smaller and violate the hold - minimum board delay for the data trace minus receiver hold time minus maximum board delay for the clock trace.
That one seems OK as well.
From the FPGA (launcher) to the bus (receiver) hold,
set_output_delay -min
* + minimum board delay for the data trace: 0.47ns
* - receiver hold time: 2.5 ns
* + minimum origin-to-launcher clock delay: 0.41 ns
* - maximum origin-to-receiver clock delay: 0 ns
* (- clock jitter)
-> the -1.617 from my original post.
BTW, that was a clearer explanation than what I had found via google!
So, we gather the delays from the external device datasheet (which is a launcher this time) trying to violate FPGA's setup or hold as much as we can. If you understood the principle, it shouldn't be a problem to do that.
For me it's not so obvious how to move from one to the other, mostly because I don't understand how to fit the parameters from my bus.
From the bus (launcher) to the FPGA (receiver) setup,
set_input_delay -max
* + maximum board delay for the data trace: 0.47 ns
* + receiver setup time: (fpga, built-in the tool)
* + maximum origin-to-launcher clock delay: 0 ns
* - minimum origin-to-receiver clock delay: 0.41 ns
* (+ clock jitter)
-> which would be 0.06 ns
From the bus (launcher) to the FPGA (receiver) hold,
set_input_delay -min
* + minimum board delay for the data trace: 0.47ns
* - receiver hold time: (fpga, built-in the tool)
* + minimum origin-to-launcher clock delay: 0 ns
* - maximum origin-to-receiver clock delay: 0.41 ns
* (- clock jitter)
-> which would also be 0.06 ns
'set_input_delay' is commonly described as 'Sets input delay on pins or input ports relative to a clock signal', which those number would be - the only thing in the value is the difference in track length (which a competent PCB designer probably (c|w)ould tune to 0), and twice the [missing] jitter. Also, using multiple propagation speeds would expand the gap. And for data signals with a track length shorter than the CLK's, this could go negative. I think I understand that part.
However, this means in this version I never tell the FPGA tool about the 15ns before/1 ns after guarantee from the bus. Is there some way I can tell the FPGA that there is some additional margin to acquire the signal from the bus? Or is it something of no concern? They are not 'delays' as such, but it feels like they are important nonetheless...
As far as I understand, in the specifications they are setup/hold requirements specified for the input side of the peripheral I'm implementing, from which are derived the setup/hold requirements seen by the output side of the peripheral I'm implementing (i.e. I need to output the signal 20ns before the next clock so that the other peripheral on the bus see the signal at least 15ns before the clock). So maybe they are only here so that whichever silicon is implementing the peripheral (in my case, the Artix-7) has receiver setup/hold requirements that fall into the limit of that [-15,1] ns bus specifications?