2
\$\begingroup\$
module A (input a, input b)
...
module B (input a, input b)
...
endmodule
endmodule

Is the above allowed in Verilog?

asked Apr 26, 2019 at 15:01
\$\endgroup\$
1

2 Answers 2

5
\$\begingroup\$

I do not think it is allowed, may be if you want to do, you should use System Verilog. More information is available in this link.

vineeshvs
1552 silver badges8 bronze badges
answered Apr 26, 2019 at 15:10
\$\endgroup\$
3
\$\begingroup\$

Nested module declarations are only allowed in SystemVerilog. The nested module is only visible for instanciation within the module is contained.

If you are looking to have two different module definitions with the same name, it's possible to do this in Verilog with libraries and the config construct.

answered Apr 26, 2019 at 15:34
\$\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.