Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > More actuals found than formals in port map

Reply
Thread Tools

More actuals found than formals in port map

 
 
june
Guest
Posts: n/a
 
      11-03-2007
Hello everyone? I'm June from Korea.
I was doing a homework, where I encountered a trouble.
I'll appreciate if you can help me.

The Problem is: I checked the grammar again and again, but found no
errors.
Still, ISE says " More actuals found than formals in port map"
There's no information about this error message in Google.
Please! tell me what's the problem and how to solve it.

-June-

architecture-----------------------------------------------------------------------------------------
stage5 : fourbitadder port map (x(3),x(2),x(1),x(0),
y(3),y(2),y(1),y(0), c, sum(3),sum(2),sum(1),sum(0), carry);

*Error message occurs here** More actuals found than formals in port
map***
-----------------------------------------------------------------------------------------------------------

fourbitadder is refered as follows:

architecture----------------------------------------------------------------------------------------
component fourbitadder
port ( a : in std_logic_vector(3 downto 0);
b : in std_logic_vector(3 downto 0);
cin : in std_logic;
s : out std_logic_vector(3 downto 0);
cout : out std_logic);
end component;
----------------------------------------------------------------------------------------------------------

 
Reply With Quote
 
 
 
 
David R Brooks
Guest
Posts: n/a
 
      11-03-2007
june wrote:
> Hello everyone? I'm June from Korea.
> I was doing a homework, where I encountered a trouble.
> I'll appreciate if you can help me.
>
> The Problem is: I checked the grammar again and again, but found no
> errors.
> Still, ISE says " More actuals found than formals in port map"
> There's no information about this error message in Google.
> Please! tell me what's the problem and how to solve it.
>
> -June-
>
> architecture-----------------------------------------------------------------------------------------
> stage5 : fourbitadder port map (x(3),x(2),x(1),x(0),
> y(3),y(2),y(1),y(0), c, sum(3),sum(2),sum(1),sum(0), carry);
>
> *Error message occurs here** More actuals found than formals in port
> map***
> -----------------------------------------------------------------------------------------------------------
>
> fourbitadder is refered as follows:
>
> architecture----------------------------------------------------------------------------------------
> component fourbitadder
> port ( a : in std_logic_vector(3 downto 0);
> b : in std_logic_vector(3 downto 0);
> cin : in std_logic;
> s : out std_logic_vector(3 downto 0);
> cout : out std_logic);
> end component;
> ----------------------------------------------------------------------------------------------------------
>

I suspect (without actually running it) that the issue is that your
formals & actuals are of different types. Each formal & actual counts 1,
regardless of its size/type. So you have 14 actuals, & 5 formals. The
fact that they total the same number of bits doesn't help.
How about this:
signal x, y, sum : std_logic_vector(3 downto 0);
signal c, carry : std_logic;
stage5 : fourbitadder port map (x, y, c, sum, carry);

If you really want your signals broken up into bits (to attach to
top-level pins?), you do that explicitly at the top level.


 
Reply With Quote
 
 
 
 
KJ
Guest
Posts: n/a
 
      11-03-2007

"june" <> wrote in message
news: ps.com...
> Hello everyone? I'm June from Korea.
> I was doing a homework, where I encountered a trouble.
> I'll appreciate if you can help me.
>
> The Problem is: I checked the grammar again and again, but found no
> errors.
> Still, ISE says " More actuals found than formals in port map"
> There's no information about this error message in Google.
> Please! tell me what's the problem and how to solve it.
>
> -June-
>
> architecture-----------------------------------------------------------------------------------------
> stage5 : fourbitadder port map (x(3),x(2),x(1),x(0),
> y(3),y(2),y(1),y(0), c, sum(3),sum(2),sum(1),sum(0), carry);
>
> *Error message occurs here** More actuals found than formals in port
> map***
> -----------------------------------------------------------------------------------------------------------
>
> fourbitadder is refered as follows:
>
> architecture----------------------------------------------------------------------------------------
> component fourbitadder
> port ( a : in std_logic_vector(3 downto 0);
> b : in std_logic_vector(3 downto 0);
> cin : in std_logic;
> s : out std_logic_vector(3 downto 0);
> cout : out std_logic);
> end component;
> ----------------------------------------------------------------------------------------------------------
>

There are only 5 ports expected (a, b, cin, s and cout) but you've supplied
14 arguments. The number that are expected (the formals) come from your
component definition, the actuals are the list of 14 signals that you
provided. Here are a couple different ways to correct:

--- 1. Using the '&' operator to concatenate the individual signals
stage5 : fourbitadder port map (x(3) & x(2) & x(1) & x(0),
y(3) & y(2) & y(1) & y(0), c, sum(3) & sum(2) & sum(1) & sum(0), carry);

-- 2. Simply use the correct vectors
stage5 : fourbitadder port map (x(3 downto 0),
y(3 downto 0), c, sum(3 downto 0), carry);

-- 3. Use explicit port mappings (this is better practice than relying on
the position in the mapping as you've done

stage5 : fourbitadder port map (
a => x(3 downto 0),
b => y(3 downto 0),
cin => c,
s => sum(3 downto 0),
cout => carry);

KJ


 
Reply With Quote
 
 
 
Reply

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
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com Java 0 03-06-2008 08:11 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C++ 0 03-05-2008 08:41 AM
Like all great travelers, I have seen more than I remember andremember more than I have seen. shenrilaa@gmail.com C Programming 0 03-05-2008 03:26 AM
Hash Map slower than Map. Amit Bhatia C++ 7 10-09-2007 09:33 AM
ReadWriteLock rather on map's each field than whole map? easy Java 8 09-29-2007 07:45 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57