Forum Discussion

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

TimeQuest Clock uncertainty

Hello everybody

Is adding clock uncertainty in TimeQuest a good idea when timing analysis says that everything is OK but the Design still does not operate correctly? Can clock uncertainty lead to a more robust fitting result or a more pessimistic timing analysis?

18 Replies

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

    --- Quote Start ---

    --- Quote Start ---

    Yes, exactly. There were a lot of timing violations between the 50MHz clock and the others, so i put the parts that run with 50MHz into a different clock domain. Data is transfered between the clock domains using dual clock FIFOs.

    By the way, at the moment my design seems to work, I hope it stays like that.

    --- Quote End ---

    Hi Stefan,

    what did you change ????:confused:

    Kind regards

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

    --- Quote Start ---

    --- Quote Start ---

    Hi Stefan,

    what did you change ????:confused:

    Kind regards

    GPK

    --- Quote End ---

    Hi Pletz

    Well that's the big problem: I don't know why my design sometimes does work and sometimes doesn't. I can make a very small change and after compilation it will not work correctly anymore. It must be some timing problems that are not detected by TimeQuest. Maybe it's just that the timing simulation can not exactly represent reality. That's why I wanted to make it more pessimistic by adding clock uncertainty.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    --- Quote Start ---

    Hi Pletz

    Well that's the big problem: I don't know why my design sometimes does work and sometimes doesn't. I can make a very small change and after compilation it will not work correctly anymore. It must be some timing problems that are not detected by TimeQuest. Maybe it's just that the timing simulation can not exactly represent reality. That's why I wanted to make it more pessimistic by adding clock uncertainty.

    --- Quote End ---

    Hi Stefan,

    I'm not sure, but I still believe your problem could be reset related. Your system reset is

    generated by a block clock by clk6M25, but it is also used in blocks running at clk_50M.

    That means you have valid paths between clk_50M and clk6M25. Are they re- synchronized ?

    Another reason could be the statemachines itself. Are all states defined ?

    Kind regards

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

    --- Quote Start ---

    --- Quote Start ---

    Hi Stefan,

    I'm not sure, but I still believe your problem could be reset related. Your system reset is

    generated by a block clock by clk6M25, but it is also used in blocks running at clk_50M.

    That means you have valid paths between clk_50M and clk6M25. Are they re- synchronized ?

    Another reason could be the statemachines itself. Are all states defined ?

    Kind regards

    GPK

    --- Quote End ---

    Hi Pletz

    No, I don't re-synchronize the reset signal. My thought was that it's pointless to synchronyze it, as the reset of the state machines and FIFOs are asynchronous anyway. Do you think this may cause problems?

    I could wrap the state machines in a if-structure. Is this a good way to make a synchronous reset?

    
    -- reset is asynchronous signal from other block
    state.clk = clk;
    if
    -- synchronize reset with clock of machine
    dff(reset, clk)
    then
        
        state = s0;
    else
        case state is
        
            when s0 =>
                ...
            
            when s1 =>
                ...
            
            when s2 =>
                ...
                
        end case;
    end if;
    
    At the time I am simply using the asynchronous reset input of the machine:

    
    state.clk = clk;
    state.reset = reset;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    --- Quote Start ---

    Hi Pletz

    No, I don't re-synchronize the reset signal. My thought was that it's pointless to synchronyze it, as the reset of the state machines and FIFOs are asynchronous anyway. Do you think this may cause problems?

    I could wrap the state machines in a if-structure. Is this a good way to make a synchronous reset?

    
    -- reset is asynchronous signal from other block
    state.clk = clk;
    if
    -- synchronize reset with clock of machine
    dff(reset, clk)
    then
        
        state = s0;
    else
        case state is
        
            when s0 =>
                ...
            
            when s1 =>
                ...
            
            when s2 =>
                ...
                
        end case;
    end if;
    
    At the time I am simply using the asynchronous reset input of the machine:

    
    state.clk = clk;
    state.reset = reset;
    

    --- Quote End ---

    Hi,

    are you using AHDL ? I'm not very familiar with the language, but I would resync the reset

    with a DFF outside the statemachine. Are all statemachines as fullcase implemented ?

    no illegal states ?

    Kind regards

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

    --- Quote Start ---

    --- Quote Start ---

    Hi,

    are you using AHDL ? I'm not very familiar with the language, but I would resync the reset

    with a DFF outside the statemachine. Are all statemachines as fullcase implemented ?

    no illegal states ?

    Kind regards

    GPK

    --- Quote End ---

    Yes, it's AHDL.

    I'm not sure what you mean with full case implemented. But every state has defined to which case to jump under what conditions.

    I'll try that with the external DFF. Thanks!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Other things to consider are that this may be a power / bypassing issue or perhaps a simultaneous switching noise (SSN) issue and not a timing issue.

    We had similar issues to yours - sometimes the design would work and then with seemingly trivial design changes it would stop working. In our case it looked like the FPGA was getting "reset" (all state machines, registers, etc. went to reset state) as a result of driving certain combination's of outputs - basically SSN issues.

    SSN is more likely in QFP packages and there are some forums or web info on SSN with respect to Altera parts you can search for.

    If there is noise on the power lines, or marginal bypassing, it's possible this could be effecting the operation.

    Changes to the design effect the routing and placement which may put susceptible signals closer to problem areas.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the advice StefanLevie. Actually I'm using a Cyclone II in a 240 pin PQFP so this could be an issue. However the layout and decoupling is above average in my opinion.

    By the way I found out that some of the problems happended outside the FPGA but not all.