Guidelines for Synthesis using VHDL

Hello,

Here are some of the guidelines/rules which will be helpful while writing synthesizable VHDL code:
  • If a signal or a variable is not assigned a value in all possible branches of an IF statement, a latch is inferred. If the intention is not to infer a latch, then the signal or variable must be assigned a value explicitly in all branches of the statement.
  • If a signal or a variable is not assigned a value in all possible branches of a case statement, a latch is inferred. If the intention is not to infer a latch, then the signal or variable must be assigned a value explicitly in all branches of the statement.
  • The only loop supported for synthesis is the for-loop.
  • There are three forms of the wait statement:
    -> wait for time;
    -> wait until condition;
    -> wait on signal-list;
    The wait-until form is the only one supported for synthesis. It is recommended to avoid the use of wait statements for synthesis.

  • Component instantiation statements are used when a designer is not satisfied with the quality of circuits produced by a synthesis tool.
  • Conversion functions do not represent hardware, it is important to find out the built-in conversion functions and use only where necessary.
  • It’s very useful in practice to identify common sub-expressions to reuse computed values where possible. Use parenthesis to control the structure of the synthesized logic.
  • Check to see if there are any signals that are being assigned a value and then later on read in to the process. To prevent simulation mismatches, it is better to model such temporaries as variables.
  • Delays are ignored by synthesis tools. This may cause a mismatch in simulation results. So it is recommended to avoid inserting delays into a model that is to be synthesized.
  • A process with an incomplete sensitivity list causes simulation mismatches. Include all signals read in the process in the sensitivity list of the process.
  • Synthesis tools ignore initial values specified for a variable or a signal in its declaration. This can cause a mismatch in simulation results, avoid inserting delays into a model that is to be synthesized.
  • By limiting module size, a designer gains in both the synthesizer run-time and the quality of the synthesis results.
  • The synthesizer does much better on logic that is contained within one entity. If a certain timing path travels through 4 separate modules, the synthesizer will make its best effort within each of the modules, but the overall results won’t be as good as the case where the whole path is in a single module.
  • Notice that there is a trade-off between the two rules of partitioning. The synthesizer always does better on smaller sized modules, however it also does better when all of a path’s logic is contained within one module.

Please comment for any query.

4 responses

  1. Please tell me about below expression when I write..

    always@(*)
    begin
    …..
    …..
    end

    what is it actually mean ?

    Liked by 2 people

    1. Hi abhay,

      Parenthesis in verilog always block represents sensitivity list so, here ‘ * ‘ will build the sensitivity list for your code and it will be sensitive to all nets and variables. That means value of any net or variable changes then this always block will be executed.

      If you consider hardware then, it will not care about sensitivity (other than posedge/negedge) and this block can create combinational logic or latch.
      For proper simulation or to prevent simulation mismatches either you can enter sensitivity manually or ‘ * ‘ can be used.

      Like

  2. Hi nikunj,

    I think we write this..

    always@(*)
    begin
    …..
    …..
    end

    It will be not sensible to all net or variable type . It will be sensible to only input and output we use in the always block.

    Is is right?
    Please check.

    Like

    1. Hi abhay,

      yes, it is right, it will be sensitive to all nets and variables used inside that always block.
      I should have added the sentence “used inside that always block” to my previous comment.
      Thank you for bringing it to my attention.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: