2
\$\begingroup\$

If you have some sort of Verilog implementation like:

module Example1 (input logic n);
 always @(*) begin
 a <= n;
 b <= n;
 c <= n;
 end
endmodule;

and another implementation like:

module Exmaple2 (input logic n);
 assign a = n;
 assign b = n;
 assign c = n;
endmodule;

Is the synthesis algorithm that Verilog runs going to create the same netlist for each circuit?

I am under the impression the synthesizer is able to simplify logic somehow, and in my understanding the above two examples are essentially identical.

toolic
10.8k11 gold badges31 silver badges35 bronze badges
asked Feb 14, 2023 at 18:04
\$\endgroup\$
0

1 Answer 1

1
\$\begingroup\$

Yes, your synthesis tool is likely to synthesize both code examples into the same logic. The same synthesis constructs can be represented using different coding styles; the same is true for simulation behavior.

Both styles you show are intended to represent combinational logic. In your 1st example, you use a procedural always block, where it is more customary to use blocking assignments (=) than nonblocking (<=):

module Example1 (input logic n);
 logic a, b, c;
 always @(*) begin
 a = n;
 b = n;
 c = n;
 end
endmodule

I realize you are only posting incomplete pseudocode, but the semicolon after endmodule is illegal syntax and should produce a compile error.

answered Feb 14, 2023 at 19:07
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.