instances of entities vs components

A

Andy Peters

File this under "VHDL philosophy."

Given a top-level entity that instantiates some lower-level entites, do
you:

a) instantiate the lower-level modules as entities, e.g.,

u_foo : entity work.foo
port map ( signals );

b) instantiate the lower-level modules as components, e.g.,

u_foo : component foo
port map (signals );

The advantage of a) is that you don't have to type the lower-level
entity's port interface declaration in your architecture. The
disadvantages of a) is that you don't see that entity's interfaces in
your architecture, and you have to ensure that you compile the
lower-level entities before the higher-level ones.

The advantage of b) is that it's clear what signals the lower-level
entity needs. The disadvantage is that if you change the interface to
the lower-level entity (in its source file), you have to make sure that
you change the component declaration in your higher-level module's
architecture. Keeping these in sync could be a problem.

Of course, you could package the component and use the package in your
top-level design, but then you still don't see the port declarations in
the top-level module.

And do you create separate files for the component packages, which
means you have to maintain them if the interface changes, but you don't
have to recompile the top-level if the lower-level changes? (Yes, I
use makefiles, which helps.)

Oy, it's all confusing. Thoughts ??

-a
 
M

Mike Treseler

Andy said:
Given a top-level entity that instantiates some lower-level entites, do
you:

a) instantiate the lower-level modules as entities, e.g.,

u_foo : entity work.foo
port map ( signals );

b) instantiate the lower-level modules as components, e.g.,

u_foo : component foo
port map (signals );

The advantage of a) is that you don't have to type the lower-level
entity's port interface declaration in your architecture.

And you only have to keep 2 port lists lined up instead of 3.
disadvantages of a) is that you don't see that entity's interfaces in
your architecture,

Tolerable with a good editor.
and you have to ensure that you compile the
lower-level entities before the higher-level ones.

That is tolerable using make.
The advantage of b) is that it's clear what signals the lower-level
entity needs. The disadvantage is that if you change the interface to
the lower-level entity (in its source file), you have to make sure that
you change the component declaration in your higher-level module's
architecture. Keeping these in sync could be a problem.

I find this too tedious. I vote for A.

-- Mike Treseler
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top