Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] quartus 2 simple vhdl; Error: Node instance instantiates undefined entity.

Status
Not open for further replies.

zoulzubazz

Member level 5
Joined
Apr 26, 2012
Messages
87
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,288
Activity points
2,040
hey guys,

new to vhdl design and i think the error is due to something trivial, following is the vhdl code for which i want to generate a rtl diagram using rtl viewer in quartus 2. I get the following error when compiling the code

12006 Error: Node instance "rcvr" instantiates undefined entity "spi_custom_slave"
As you can see the code is simple and should compile ok but it isnt. thanks.


Code VHDL - [expand]
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
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
 
entity spi_custom is 
    port (         ss       : in std_logic;
            clk     : in std_logic;
            MOSI    : in std_logic;
            outs        : out std_logic
            );
end entity spi_custom;
 
architecture behave of spi_custom is
 
    component spi_custom_slave
        port(           ss      : in std_logic;
                clk     : in std_logic;
                MOSI    : in std_logic;
                outs        : out std_logic
            );
    end component spi_custom_slave;
    
    begin
    
    rcvr: spi_custom_slave port map (
    ss      => ss,
    clk         => clk,
    MOSI    => MOSI,
    outs            => outs
    );
 
    end architecture behave;

 
Last edited by a moderator:

You have defined entity spi_custom
And then define component spi_custom_slave
And then instantiate spi_custom_slave rcvr: spi_custom_slave port map (

There is no entity that is associated with the spi_custom_slave component in the code you've posted. Two options, choose one:
- Change the name of the entity to be spi_custom_slave
- Change the component and the instantiation to use spi_custom

As a side note, it is unnecessary and can cause problems when you define a component inside an architecture. It is not necessary because when you instantiate the component you can simply use direct entity instantiation like this:
rcvr: entity work.spi_custom port map (...

The problem comes in because, as you've probably noticed, the component and the entity are nearly identical which likely means you copy/paste but as the design evolves you might end up changing something one place but not in another (i.e. you didn't copy/paste) and run into a subtle difference because the component definition is slightly different (maybe just a default initializer difference). There are enough things to debug without creating your own avoidable problems that need debugging as well. As an example, had you not had the component definition in your original code, you might've spotted the error yourself since you wouldn't have been deflected by the fact that you defined a component that did not match the intended entity.

Unless you are using black box cores that you don't really have access to the code (like you will get with third party IP), you don't need to use components.

Kevin Jennings
 
It seems you have not compiled spi_custom slave..You have to compile all the files in your design..
 
thanks for your input, i ditched using component and am instantiating using work.<entity_name> instead and split up the various entities in different files. thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top