Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Identifier "adder" does not identify a component declaration.

Reply
Thread Tools

Identifier "adder" does not identify a component declaration.

 
 
anagarwal89 anagarwal89 is offline
Junior Member
Join Date: Jan 2011
Posts: 1
 
      01-20-2011
When I compile my code for a 32 bit adder, I get this error. My code for adder is compiling successfully but testbench is giving error.
Here's my code for testbench:
library ieee;
use ieee.std_logic_1164.all;

entity adder_testbench is
end adder_testbench;

architecture behavior of adder_testbench is

signal a_tb: std_logic_vector(31 downto 0);
signal b_tb: std_logic_vector(31 downto 0);
signal sum_tb: std_logic_vector(31 downto 0);
signal co_tb :std_logic ;
signal cin_tb : std_logic;
component adder
port (A,B: in std_logic_vector(31 downto 0);
CIN: in std_logic;
S: out std_logic_vector(31 downto 0);
COUT: out std_logic);
end component;
begin
uut: Work.adder port map(A => a_tb, B => b_tb, CIN => cin_tb, S => sum_tb, COUT => co_tb);

tb1: process
constant period1: time := 20ns;
begin
a_tb<= "00000000000000001111111111111111";
b_tb<= "11111111111111110000000000000000";
cin_tb<= '0';

wait for period1;

assert ((sum_tb = "11111111111111111111111111111111") and (co_tb ='0'))
report "test failed for combination" severity error;

wait;
end process tb1;
end behavior;
 
Reply With Quote
 
 
 
 
joris joris is offline
Senior Member
Join Date: Jan 2009
Posts: 152
 
      01-20-2011
Uhm perhaps you need to leave out the Work prefix:
Code:
uut: adder port map(A => a_tb, B => b_tb, CIN => cin_tb, S => sum_tb, COUT => co_tb);
 
Reply With Quote
 
 
 
 
Philippe.Faes Philippe.Faes is offline
Junior Member
Join Date: Jan 2011
Posts: 4
 
      01-20-2011
You can either write:

uut: adder port map( ...

which will instantiate the component you have typed in the declarative part of your architecture, or you can write:

uut: entity work.adder port map( ...

Which will directly instantiate the entity. No need to copy the component declaration if you use this style.

You can even specify which architecture you want:

uut: entity work.adder(RTL) port map( ...

--
Philippe
sigasi.com
 
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
XSD Error: "Expecting '.', identifier or quoted identifier withmultiple tables. S_K ASP .Net 0 08-06-2008 09:22 PM
How to identify on which component the focus is currently residing arun.viswanath@gmail.com Java 4 06-02-2008 01:01 AM
How can I fix the warning C4786 'identifier' : identifier wastruncated to 'number' characters in the debug information...? babakandme@yahoo.com C++ 2 12-11-2007 08:17 PM
identifier not found error, undeclared identifier aarthi28@gmail.com C++ 2 02-26-2007 02:11 AM
Trying to declare identifier locally and hide a file scope identifier Kobu C Programming 7 02-25-2005 05:19 AM



Advertisments