Modules, instantiation and the module port list

M

Marwan

Guest
Peace,

I have posted this question separately to make finding this answer for
the next person easier.

Simply, if a module (A) is instantiated within a higher level module
(B), must the port list of (A) be included in the port list of (B)?

I know in a testbench this does not happen... But I do not know if
this is generally applicable.

This is simple, but I can't find the answer in my references...

Thnaks in advance for any help.

Peace
 
"Marwan" <marwanboustany@gmail.com> wrote in message
news:1186058636.032737.121440@22g2000hsm.googlegroups.com...
Peace,

I have posted this question separately to make finding this answer for
the next person easier.

Simply, if a module (A) is instantiated within a higher level module
(B), must the port list of (A) be included in the port list of (B)?

I know in a testbench this does not happen... But I do not know if
this is generally applicable.

This is simple, but I can't find the answer in my references...

Thnaks in advance for any help.

Peace
What's the use of instantiating it in an upper level module if you aren't
connecting the ports to something. The ports of module A need to be defined
in module B is you wish to connect them to something. If they aren't
connected to anything .. then it must not do much.

Mike
 
Marwan <marwanboustany@gmail.com> writes:

Peace,

I have posted this question separately to make finding this answer for
the next person easier.

Simply, if a module (A) is instantiated within a higher level module
(B), must the port list of (A) be included in the port list of (B)?

I know in a testbench this does not happen... But I do not know if
this is generally applicable.

This is simple, but I can't find the answer in my references...

Thnaks in advance for any help.

Peace
I rpsume you are asking about something like this:

module A(in a, out b);
endmodule

module B(in x, out y);
wire r, s;
A a1(r, s);
endmdoule

In module B, r and s do not have to be declared as ports (nor do the
names a and b which are only local to module A and don't exist under
those names in module B at all).

Now, generally, the purpose of instantiating a module like the
instantiation a1 here is to "use" the functionality of it, and thus
one drives the inputs with values and receives the values generated by
the outputs. However, if the module A implemented an adder with both
"sum" and "carry" outputs, one still might instantiate it only to get
the "sum" output and drop the "carry" output on the floor (not connect
it to anything).

Does this answer your question?
-Chris

*****************************************************************************
Chris Clark Internet : compres@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
------------------------------------------------------------------------------
 
On Aug 2, 7:45 pm, Chris F Clark <c...@shell01.TheWorld.com> wrote:
Marwan <marwanboust...@gmail.com> writes:
Peace,

I have posted this question separately to make finding this answer for
the next person easier.

Simply, if a module (A) is instantiated within a higher level module
(B), must the port list of (A) be included in the port list of (B)?

I know in a testbench this does not happen... But I do not know if
this is generally applicable.

This is simple, but I can't find the answer in my references...

Thnaks in advance for any help.

Peace

I rpsume you are asking about something like this:

module A(in a, out b);
endmodule

module B(in x, out y);
wire r, s;
A a1(r, s);
endmdoule

In module B, r and s do not have to be declared as ports (nor do the
names a and b which are only local to module A and don't exist under
those names in module B at all).

Now, generally, the purpose of instantiating a module like the
instantiation a1 here is to "use" the functionality of it, and thus
one drives the inputs with values and receives the values generated by
the outputs. However, if the module A implemented an adder with both
"sum" and "carry" outputs, one still might instantiate it only to get
the "sum" output and drop the "carry" output on the floor (not connect
it to anything).

Does this answer your question?
-Chris

***************************************************************************­**
Chris Clark Internet : comp...@world.std.com
Compiler Resources, Inc. Web Site : http://world.std.com/~compres
23 Bailey Rd voice : (508) 435-5016
Berlin, MA 01503 USA fax : (978) 838-0263 (24 hours)
---------------------------------------------------------------------------­---
What you are saying makes sense... What I was thinking before was
that when you instantiate some module, that it was created externally
to the module but usable from the module via the instantiation
syntax. Hence with that concept I was thinking "Ok, if I need to
connect to this instantiated module, ill need extra ports in the
instantiating module to deal with the extra inputs and outputs..."

But what I am getting from you is that, once instatiated, the
instantiated module becomes an internal part of the module that calls
it, so no input or output ports are needed in the instantiating
module.

Thank you for your time.

Peace,
Marwan
 
Marwan <marwanboustany@gmail.com> writes:

But what I am getting from you is that, once instatiated, the
instantiated module becomes an internal part of the module that calls
it, so no input or output ports are needed in the instantiating
module.
Yes, that is correct.
 

Welcome to EDABoard.com

Sponsor

Back
Top