Forum Discussion

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

SDC for ALTCLKCTRL

Hello,

I have an ALTCLKCTRL component implemented in my design targeting a Cyclone V FPGA.

The ALTCLKCTRL has 4 of its inputs occupied:

1. Clock_1 driven by an FPGA pin.

2. Clock_2 driven by an FPGA pin.

3. Clock_3 coming from a pll_a.

4. Clock_4 coming from a pll_b.

All of the above are from the same bank and connected correctly - the design passes fitting without issue and last but not least - it works.

However, I do have some trouble with timing analysis:

I use the "create_clock" SDC command for creating Clock_1 and Clock_2 and then the "derive_pll_clocks" macro to generate Clock_3 , Clock_4 and the output of ALTCLKCTRL.

The result: Clock_1, Clock_2, Clock_3, Clock_4 get recognized as clocks by the tool but the output of ALTCLKCTRL doesn't.

From all I read the "derive_pll_clocks" macro should apply to ANY clock sourcing element...So why doesn't it work for ALTCLKCTRL ?

13 Replies

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

    You definitely have to manually constrain this. You need to find the output of the altclkctrl in the node finder, and then do:

    create_generated_clock -name pin1 -source [get_ports pin1] {altclkctrl|dout}

    create_generated_clock -name pin2 -source [get_ports pin2] {altclkctrl|dout} -add

    create_generated_clock -name pll_clk_1 -source [get_pins altpll...clkout1] {altclkctrl|dout} -add

    create_generated_clock -name pll_clk_2 -source [get_pins altpll...clkout2] {altclkctrl|dout} -add

    The last item is the name of the altclkctrl. The -source for the pins is just the name of the top-level port, while the -source for the PLL can be found when you run Report Clocks and is the Target column for the PLL generated clock. For the -name option, naturally name then whatever you want.

    Then you'll need something like:

    set_clock_groups -exclusive -group {pin1}

    -group {pin2}

    -group {pll_clk_1}

    -group {pll_clk_2}

    Naturally, add other clocks to this command as appropriate.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    You definitely have to manually constrain this

    --- Quote End ---

    So you disagree with what I wrote in# 10 ? You assume it's a bug in the tool ?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I'm not sure what you mean by fails to recognize. The altclkctrl is basically a mux, and the clocks all pass through it and are analyzed. This is the way it would work if you built a mux out of logic. The real problem is that timing analysis assumes all clocks can happen at the same time, so you'll get an analysis where pin1 goes through the mux and feeds the source register and pll_clk1 goes through the mux and feeds the destination(which in theory could happen when you switch clocks). Just adding the generated clocks doesn't change this analysis. Instead, it gives you a clear clock name that you can use for your set_clock_groups.

    As a test, before adding the generated_clocks, do a report_timing on some paths that are fed by this altclkctrl and see what it analyzes. If this was a clock that wasn't recognized, you wouldn't get any analysis, but I suspect you will.

    (In theory, you could skip doing the generated clocks and probably just do a set_clock_groups with the four clocks that drive into the altclkctrl, and probably be fine. The only way this wouldn't work is if you had paths that were outside of the altclkctrl you wanted to analyze, e.g. if you had a path who's source register is directly driven by pll_clk1 and destination is driven by pll_clk2 you might not want to cut that, but still would want to cut the analysis between these two clocks when they go through the altclkctrl block.)