Generic, Ports, this '=>' is optional?

C

Christiano

Guest
In some codes that exist component instantiation, sometimes it's like this:
X: Gate generic map (N => 5) port map (a, b);
and other times as well:
X: Gate generic map (5) port map (a, b);

Is there any difference or particular reason to use one or the other?
 
On Wednesday, August 14, 2013 9:11:53 PM UTC-3, Christiano wrote:
In some codes that exist component instantiation, sometimes it's like this:

X: Gate generic map (N => 5) port map (a, b);

and other times as well:

X: Gate generic map (5) port map (a, b);



Is there any difference or particular reason to use one or the other?

Solved, The book The Designer's Guide to VHDL, 3rd Edition, gives all the syntax rules in detail:
http://www.ashenden.com.au/vhdl-book/DG3E.html
http://img829.imageshack.us/img829/9758/ppci.png
 
Am Donnerstag, 15. August 2013 02:11:53 UTC+2 schrieb Christiano:
In some codes that exist component instantiation, sometimes it's like this:

X: Gate generic map (N => 5) port map (a, b);

and other times as well:

X: Gate generic map (5) port map (a, b);



Is there any difference or particular reason to use one or the other?

Hi Christiano,
so you already learned about Positional assignment and Named assignment. :)
While Positional assignment saves you some typing (which emacs would do automatically) it is error prone and badly maintainable.

See what you can do with named association.
(Most of this can be done wit positional association too, but imagine Models with high numbers of generics and ports. Can you handle all these anonymous values.)

X: Gate
generic map (-- select by comment and document differrent usages this way
--N => 5 -- use for simulation
N => 54 -- use in implementation
--N => 65 -- use in some special case
)
port map (putout_this => b -- place for usefull comments
something_in => a); -- don't worry about the order

This is just to give you an idea what's possible.

Have a nice synthesis
Eilert
 
On Thursday, August 15, 2013 2:59:07 AM UTC-3, goou...@gmail.com wrote:
Am Donnerstag, 15. August 2013 02:11:53 UTC+2 schrieb Christiano:

In some codes that exist component instantiation, sometimes it's like this:



X: Gate generic map (N => 5) port map (a, b);



and other times as well:



X: Gate generic map (5) port map (a, b);







Is there any difference or particular reason to use one or the other?



Hi Christiano,

so you already learned about Positional assignment and Named assignment. :)

While Positional assignment saves you some typing (which emacs would do automatically) it is error prone and badly maintainable.



See what you can do with named association.

(Most of this can be done wit positional association too, but imagine Models with high numbers of generics and ports. Can you handle all these anonymous values.)



X: Gate

generic map (-- select by comment and document differrent usages this way

--N => 5 -- use for simulation

N => 54 -- use in implementation

--N => 65 -- use in some special case

)

port map (putout_this => b -- place for usefull comments

something_in => a); -- don't worry about the order



This is just to give you an idea what's possible.



Have a nice synthesis

Eilert

Excellent, thank you.
 

Welcome to EDABoard.com

Sponsor

Back
Top