Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
9 years ago

set_input_delay And set_output_delay .SDC Constraints

Hello! I have little familiarity with the set_input_delay and set_output_delay SDC and was wondering whether the following commands would correctly constrain the inputs as per the requirements in the attached figure..

https://alteraforum.com/forum/attachment.php?attachmentid=13431&stc=1

what the diagram shows : I have an 8-bit port on a Video Decoder which outputs data to the FPGA.The clock used in the FPGA is output from the

same device.The device is configured to change its data on the falling edge of the clock.The device opertes on a 27 Mhz clock i.e a period of 37.037 ns.The datasheet lists T5 as Output Hold Time and gives a minimum Value of 10ns.The datasheet lists T6 as Output Delay Time and gives a maximum Value of 25ns.So, I conclude that with respect to the falling edge of the clock, the data begins to change 10ns the after falling edge and regains stability 15ns later.Is this what the diagram depicts?If so, I think the constrains that specify this should be :
create_clock -period 37.037 -name clkvin;# virtual clock for input constraintset_input_delay -clock clkvin -max 25  -clock_fallset_input_delay -clock clkvin -min 10  -clock_fall

Setting the input delay constraints like this ends up giving the following failing constraints in the Timing Analyzer.

https://alteraforum.com/forum/attachment.php?attachmentid=13432&stc=1

CH2-BITEC-IN are the physical input pins on the HSMC connector.The data on these pins is registered with the clock CH2-BITEC-CLK like so :

always @ (posedge CH2_BITEC_CLK) begin input_data <= CH2_BITEC_IN; end

Have I deduced the requirements correctly from the diagram? If so, then why does the design fail and how can I make it work?

Thank you!

24 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    On a side note, Here's what I think setting the output_delay -max attribute does : It informs the synthesizer that the input register, the one with its "D" pins connected directly to the input pins on the FPGA can not be sampled at the positive edge of the same clock that is used between two internal registers on the FPGA. Consequently, when I constrain the output_delay -max to be 25 ns, it leaves out 12 ns (in a 37ns) for the input pins data to appear at the output of the register and then be used for any combinational logic(like comparators e.t.c) before the final result.When the constraints fail, this simply means that the remaining time isn't sufficient for the subsequent processing? If so, then

    What is the purpose of the minimum delay?

    Why did the design pass when I removed the -fall attribute?

    What can be done to assure maximum data integrity?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thank you for the prompt feedback and I apologize for the poor quality of the picture and any other shortcomings!

    Just to be certain, I wrote 't5' and 't6' on the left side of the diagram and not 15 and 16.Again, My bad.Now, as per the diagram attached the data sheet lists the values for 't5' and 't6' labelled in the diagram as "10ns" and "25ns" . My reasoning behind arriving at these values was that 10ns after the falling clock edge, the data begins to change and 15 ns later (25 ns after falling edge),new data is available, hence the min and max values, Please correct me if I'm wrong,

    Secondly, when I remove the -clock fall constraint, the analyzer reports no warnings.Why is this so?

    If it should still be 15 and 16 then, I am hopelessly lost. :( . Please have a look at the attached diagrams.

    https://alteraforum.com/forum/attachment.php?attachmentid=13434&stc=1 https://alteraforum.com/forum/attachment.php?attachmentid=13435&stc=1
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    you need to set offsets as they are:

    min = 15 &max = 16 and both from falling edge. It should be no problem to pass

    How did get those figures of 25/10??

    I needed glasses.min = t5 &max = t6 yes. If it fails then you need to try PLL or use same edge. Also you have assumed board delays to be equal for clk/data
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    UPDATE : When I remove the -clock_fall constraint, which I included since the data was changing on the negative edge of the clock, the failing constraints go away.With the following constraints, I get no errors.

    set_input_delay -clock clkvin -max 25 
    set_input_delay -clock clkvin -min 10 

    The only change I've made is the removal of the -clock_fall