3
\$\begingroup\$

In my Verilog design, I have two clocks of the same frequency, but of different phase. At the moment, my timing constraints look like this:

create_clock -name clk1 -period "150 MHz" [get_ports clk1]
create_clock -name clk2 -period "150 MHz" [get_ports clk2]

The problem is that the compiler doesn't complain when signals cross the two time domains, although it should because the two clocks are asynchronous, and metastability protection is required.

The "hack" of changing one of the frequencies to 150.01 Mhz works, but it's a hack. Is there a proper way of setting timing constraints for isochronous clocks?

Edit: I'm using Altera Quartus II as my compiler.

\$\endgroup\$
5
  • 4
    \$\begingroup\$ FYI - the term for these signals would Isochronous \$\endgroup\$ Commented Jun 24, 2013 at 15:57
  • \$\begingroup\$ The answer to this question will probably depend on what synthesis tool you're using --- could you add that to the question? \$\endgroup\$
    – The Photon
    Commented Jun 24, 2013 at 15:58
  • \$\begingroup\$ Also, a period of "150 MHz" doesn't look right to me. Shouldn't it be 6.67 ns? I'm just wondering if when you use your version it isn't putting all of your clocks into the same clock "family" or something. \$\endgroup\$
    – The Photon
    Commented Jun 24, 2013 at 15:58
  • \$\begingroup\$ @ThePhoton: The frequency is actually 156.25 MHz, but I simplified it for the sake of argument. The period is then computed automatically for me. Regarding the "families", yes, my compiler is putting the two clocks in the same frequency family. \$\endgroup\$
    – Randomblue
    Commented Jun 24, 2013 at 16:01
  • \$\begingroup\$ @Randomblue what happens if you explicitly create two different families, and explicitly assign each clock to a different family? \$\endgroup\$
    – The Photon
    Commented Jun 24, 2013 at 16:08

3 Answers 3

3
\$\begingroup\$

Put clocks in different clock groups. This allows them to have the same phase and frequency yet be considered asynchronous for timing analysis. For a Quartus II .sdc file you would use this syntax:

create_clock -period "100 Mhz" -name {CONF_CLK}  [get_ports {CONF_CLK}]
create_clock -period "100 Mhz" -name {PCIE_CLK} [get_ports {PCIE_CLK}]
create_clock -period "645 Mhz" -name {GXB_REFCLK} [get_ports {GXB_REFCLK}]

# Specify clocks are unrelated by assinging to seperate asynchronus groups
set_clock_groups -asynchronous -group {CONF_CLK} -group {PCIE_CLK} -group {GXB_REFCLK}

And yes, -period can be either a frequency or time period, depending on the units specified.

\$\endgroup\$
1
  • \$\begingroup\$ Just as note: this is not working for (Libero 11.4 SP1) of Microsemi (Actel). 'set_clock_groups' is not implemented there. \$\endgroup\$
    – vermaete
    Commented Sep 27, 2014 at 8:02
4
\$\begingroup\$

You can use -phase with create_generated_clock. For example, below are two 125.0 MHz clocks, but the second one is shifted 90 degree:

create_generated_clock                                                  \
    -source {pll0|altpll_component|auto_generated|pll1|inclk[0]}        \
    -divide_by 4 -multiply_by 5 -duty_cycle 50.00                       \
    -name clk_125                                                       \
    {pll0|altpll_component|auto_generated|pll1|clk[0]}

create_generated_clock                                                  \
    -source {pll0|altpll_component|auto_generated|pll1|inclk[0]}        \
    -divide_by 4 -multiply_by 5 -phase 90.00 -duty_cycle 50.00          \
    -name clk_125_90                                                    \
    {pll0|altpll_component|auto_generated|pll1|clk[2]}
\$\endgroup\$
0
\$\begingroup\$

The tool assumes that clocks are rising-edge aligned, I believe, unless you otherwise specify them. That's why the tool doesn't complain.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ How do you tell the tool not to make that assumption? \$\endgroup\$
    – Randomblue
    Commented Jun 24, 2013 at 16:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.