0
\$\begingroup\$

If I have a mymodule that has parameters and I am instantiating this mymodule inside a top level block which has a few sub module and mymodule is also a submoulde then when instantiating mymodule inside the top level, do I need to define the parameters of mymodule inside the top level? And if there are some signal(rem) from mymodule that I do not need its value, then when instantiating this mymodule inside the top level can I map them like below:

instant mymodule (.res(res).,clk(clk),.div(div),rem())

I am not mapping rem to any signal. Is it legeal by compiler?

winny
18.1k6 gold badges53 silver badges74 bronze badges
asked Jun 1, 2018 at 3:28
\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

If I have a mymodule that has parameters and I am instantiating this mymodule inside a top level block which has a few sub module and mymodule is also a submoulde then when instantiating mymodule inside the top level,do I need to define the parameters of mymodule inside the top level?

You need to supply the parameters wherever your module is instantiated. If your module is instantiated in multiple locations, each of those locations creates a separate instance of your module, and each instance has its own parameters. The parameters do not need to be the same in all locations.

if there are some signal(rem) from mymodule that I do not need its value ,then when instantiating this mymodule inside the top level can I map them like below

If the port is an output, you can leave it out from the instantiation entirely. You don't need to mention the port at all.

If the port is an input, it cannot be omitted.

answered Jun 1, 2018 at 3:46
\$\endgroup\$
0

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.