Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Re: Generic, Ports, this '=>' is optional?

Thread Tools

Re: Generic, Ports, this '=>' is optional?
Posts: n/a
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
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Who can explain this bug? mathog C Programming 57 06-11-2013 10:09 PM
How do I encode and decode this data to write to a file? Python 11 05-01-2013 11:36 PM
Why does this incorrect CRTP static_cast compile? C++ 2 04-25-2013 01:38 PM
This looks like a Perl bug George Mpouras Perl Misc 18 04-21-2013 11:56 PM
Really throwing this out there - does anyone have a copy of my oldDancer web browser? Python 1 04-10-2013 03:32 PM