Forum Discussion
setup and hold time with set_input_delay
Hello,
I have some problem understanding the set_input_delay min and max constraint. Assume that you have an interface that is connected to an FPGA. This interface has a clock (Clk) and a databus (DB). The datavalid window is centered around the rising edge of Clk. Assume a setup time of 1ns and a hold time of 2 ns. The clk period is 10 ns. How should I constrain this with the set_input_delay command? thanks for helping me,22 Replies
- windy_city
New Member
I could not locate your old documents. I have trouble with understand sset_input_delay constraint.
A) it is difference between data arrival and clock arrival time.
assume data and clock are coming from same external source. clock period is 10ns. set_input_delay is 3. external clock signal has trace delay of 4ns.
out of the 10ns, data used up 3ns, but clock also has a delay and reaches the internal flop late by 4ns, does it not mean that data now has 11ns to meet setup time of that internal flop?
how is it even possible that difference between their arrivals is 3ns but clock trace takes 4ns?
if clock trace takes 3ns, will data have 10ns internally to travel to the flop's input?
I will subtract setup time of the internal flop. I am trying to keep numbers simple.
B) if two chips are talking to each other then isnt set_input_deay of one chip same as set_output_delay of another chip. ? then why do I need both.
it will be big help if you can help me solve these. I asked AI and I was able to convince it to give me the answer I wanted.
- Altera_Forum
Honored Contributor
Rysc, thank you kindly for your posts and clearing up IO constraints. The Quartus Documentation is extremely shotty. Thanks again.
- Altera_Forum
Honored Contributor
Cyclone III's M9Ks have an output register that is bypassable. Not sure what error you're seeing, as it's definitely possible.
- Altera_Forum
Honored Contributor
Thanks for the reply, It indeed allows to uncheck latches for the RAM, but i'm not sure weather it also allows for CYCLONE 3 FPGA.
It indicated some error when i did,and tried to compile. - Altera_Forum
Honored Contributor
In the Megawizard there is a checkbox to disable the output latch. (The input/address latch is always there).
- Altera_Forum
Honored Contributor
hello Everyone,
Sorry for posting question in middle of no where, I did not find how to start new thread,Ok anyways My question is, The LPM Ram or Ram created thr MEGAWIZARD has a input latch and an output latch, because of which we are getting the 2 cycles delay in the output, which is very crucial in our design, how to over come the delay caused by the RAM, Cant we overcome this latch, if so how do we do it. - Altera_Forum
Honored Contributor
Thanks Rysc, placing derive_clock_uncertainty in the .sdc file seemed to sort it out
- Altera_Forum
Honored Contributor
I think it just means to add the following line to your .sdc:
derive_clock_uncertainty (That should be in all .sdc files for devices 65nms and newer...) And note that, even though your slack is getting tight, if you meet timing, and if everything is correct, then you're in good shape. I've seen designs meet timing by a few picoseconds. - Altera_Forum
Honored Contributor
Thanks again Rysc for your reply.
I am fairly sure that the delay of 6.6 ns specified is the max delay between the rising edge of clock leaving the PowerPC and the time the data bits are stable. I have attached the datasheet and on page 78 these details are given. Perhaps you could have a quick look at this if you had time. On page 69 there is a timing diagram where the tov max delay term is used and it seems to refer to what I think. Anyway I took your advice and used a PLL to shift the clock and I have been able to meet timing. I had to shift the clock by +5ns to meet timing. I now have a worst case setup time of 0.790ns and a worst case hold time slack of 2.123ns. I have not included board trace delays in the input_delay constraints, its something I will add later, but I am assuming that they would typically quite low in the order of 100´s of ps? I am also receiving some warnings about no clock uncertainty assignment on the clocks. From looking at the attached datasheet on page 67 it specifies the max and min high and low time for PerClk (the clock in question). The values given are that the clock can be high for between 7.5 and 9.9ns (50-66%)of a 15 ns cycle and low for between 4.95ns and 7.5 ns (33-50%) on a 15 ns cycle. Does the potential difference in duty cycle represent clock uncertainty or am I misunderstanding clock uncertainty? If my understanding is correct, then between the 6.6ns delay on the databus and the difference in potential duty cycle, it would make meeting timing even more difficult. Do you have any thoughts on this? Many Thanks - Altera_Forum
Honored Contributor
First off, make sure the spec is what you're saying. Outputs are often spec'd in terms of the input clock, i.e. the data is valid between 0 and 6.6ns after the input clock. This, by itself, is useless, since we want to know what the data output is in relation to the clock output. So if the clock output, in relation to the clock input, was 0 to 6.6ns, then we could figure out the skew between these.
Or is the spec saying the data comes out anywhere between 0ns(with the clock) up to 6.6ns after the clock? I don't know the answer, but it naturally makes a big difference. And skewed by anywhere between 0 and 6.6ns is a pretty big number(but not impossible). Now, your setup requirement is 7.5ns. So that only leaves 0.9ns of skew inside the FPGA. First, if using a PLL in source synchronous mode, it's possible that you can meet that. Secondly, don't forget that you have -7.5ns of hold to work with. So if you're just barely meeting setup timing and have tons of hold timing, then Quartus might be able to reduce the data delay to borrow some of that hold timing. Or, you can add a positive phase shift of a few nanoseconds to your capture clock. (And you would add a multicycle -setup of 2 between the external clock and the PLL clock to get the correct requirement). Bottom line is you still might meet timing, so give it a try. I do not think you need to go to a slower data rate.