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

Is the above allowed in Verilog?

\$\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.

\$\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.

\$\endgroup\$

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.