Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17263 Discussions

Error: top level design entity " " is undefined

Altera_Forum
Honored Contributor II
104,284 Views

we have problem in compiling VHDL code in Quartus II software. Every time we compile it shows the Error:top level design entity " file name" is undefined. 

 

We are even taking care of the case sensitivity. 

 

Our file name, new created project name and entity name in the code are all same. 

 

Plz help us regarding this.
0 Kudos
31 Replies
Altera_Forum
Honored Contributor II
12,073 Views

I think this relates to th OPs problem. There seems to be a typo in the supplied file from Altera as part of DE2_tutorials\design_files data set has the top level entity/arch named addersubtractor2 in addersubtractor.vhd, it should of course be addersubtractor the file is marked (C) 2005 Altera Corporation. 

as shown here: 

 

-- Top-level module 

ENTITY addersubtractor2 IS 

GENERIC ( n : INTEGER := 16 ) ; 

PORT ( A, B : IN STD_LOGIC_VECTOR(n-1 DOWNTO 0) ; 

Clock, Reset, Sel, AddSub : IN STD_LOGIC ; 

Z : BUFFER STD_LOGIC_VECTOR(n-1 DOWNTO 0) ; 

Overflow: OUT STD_LOGIC ) ; 

END addersubtractor2 ; 

ARCHITECTURE Behavior OF addersubtractor2 IS..... 

 

This section of the file should read (as it did in 8.0sp1 supplied files): 

-- Top-level module 

ENTITY addersubtractor IS 

GENERIC ( n : INTEGER := 16 ) ; 

PORT ( A, B : IN STD_LOGIC_VECTOR(n-1 DOWNTO 0) ; 

Clock, Reset, Sel, AddSub : IN STD_LOGIC ; 

Z : BUFFER STD_LOGIC_VECTOR(n-1 DOWNTO 0) ; 

Overflow: OUT STD_LOGIC ) ; 

END addersubtractor ; 

ARCHITECTURE Behavior OF addersubtractor IS..... 

 

This file is marked -- (C) 2004 Altera Corporation. All rights reserved. 

 

Looks like a typo possibly, but if you change the top level entity and architecture to match as shown it will compile ok. Not helpful for beginners!
0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

Hello, guys, thanks for all your efforts, 

 

I encountered the same problem and solved it just now. It was due to the typo of my top level design entity name. A stupid mistake =) 

 

Cheers
0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

I strongly suggest to check the spell of the name of your entity.

0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

I solved this in Quartus II 11.0 by going Assignments > Settings > General and making my Top-level entity the name of my top level Verilog module (not its filename). 

 

 

e.g. for a file named example.v 

 

 

module circuit (output f, input x,y,z); 

assign f=(x|(y&~z))&~(y&z); 

endmodule 

 

 

make the Top-level entity "circuit" not "example"
Altera_Forum
Honored Contributor II
12,073 Views

save yourself some pain when changing top level entities (for debug) and match your file and module name

0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

 

--- Quote Start ---  

Hello, guys, thanks for all your efforts, 

 

I encountered the same problem and solved it just now. It was due to the typo of my top level design entity name. A stupid mistake =) 

 

Cheers 

--- Quote End ---  

 

 

your post solved my lot of problems, thank you very much. You made me understand a very important concept. 

 

thanks again
0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

Resurrecting an old thread here, but I just had this problem and this thread came up top of a google search. I've been using Quartus for 8 months now but have always been copying existing projects, but I recently tried a new project and it was a bit tricky so I have gone through every step and written it up below. Even in this simple led blink program there are 3 places that the project name is mentioned and it must match all these to avoid a "top level design entity" error.  

 

I hope this is helpful for someone :) 

 

-- notes re compile error "Top level entity is undefined" -- Steps to create file: -- File / New Project Wizard. -- Select a directory (in windows 8 need to create this beforehand as there is no new directory option) -- Select a name for the project, eg BlinkLed (not too long and maybe avoid spaces) -- Page 2 - Add files - just click Next -- Page 3 - select the chip family. This one was for a Cyclone II EP2C5T144C8 board from ebay -- click through all the options until finish -- File / New and select VHDL file -- File / Save As and it should be the same as the project eg BlinkLed -- Copy the text from below - but this is really important, if the project name is different to BlinkLed then -- 1) make the entity name the same as the name of the project eg entity BlinkLed is -- 2) make the end of the entity name the same as the project name eg end BlinkLed; -- 3) and also make the architecture struct name the same as the name of the project eg architecture struct of BlinkLed is -- Processing / Start Compilation and it should compile in about 20 seconds -- once compiled, the pin planner knows about the ports, eg input1 and output1 -- Assignments / Pin Planner -- click on pin 144 on the big drawing of the chip. This is the pushbutton on the EP2C5T144C8 board -- top right corner, Node Name, and select input1 -- click on pin 3 on the chip (LEDs are on pins 3,7 and 9) -- Node Name, output1 -- File / Save -- Processing / Start Compilation -- jtag programmer to the outside of the two 10 pin headers (this is for Active Serial permanent programming) -- Tools / Programmer -- Mode / Active Serial Programming -- Add Files, browse to output_file and there should be a file BlinkLed.pof, click to select -- Click and Open -- Check the boxes "program configure" and "verify" -- Click Start and it should download -- press the button and the led should turn on. library ieee; -- a few basic libraries, the simplest of things in vhdl don't work without libraries use ieee.std_logic_1164.all; use IEEE.STD_LOGIC_ARITH.all; use IEEE.STD_LOGIC_UNSIGNED.all; entity BlinkLed is port( input1 : in std_logic; -- semicolons between each entry output1 : out std_logic -- last entry in a port list does not have a semicolon ); end BlinkLed; architecture struct of BlinkLed is begin output1 <= input1; -- connects input to output - can put logic here eg not(input1) end;
0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

I've faced the same error. In my case, issue was caused by EOL (End of line) Format. My notepad ++ used LF (Old Mac) Format by default (don't know why).  

 

I solved the issue by converting EOL to Windows Format: 

Edit -> EOL Conversion -> Windows Format 

 

Default EOL Format in notepad ++ can be set:  

"Settings" -> "Preferences" -> "New Document/Default Directory" then select "Windows" (if you are Windows user offcourse :)) 

 

Hope this will help someone. 

 

Regards, 

Nemanja
0 Kudos
Altera_Forum
Honored Contributor II
12,073 Views

 

--- Quote Start ---  

As FvM indicated this error message is caused by the fact that no VHDL entity is found with the name of the "top level entity". It is not enough to name your VHDL file with the name of the top entity. The top entity itself of your VHDL description should have this name. 

 

e.g. In the example below TOP is the "Top Level Entity" and has been declare d like that (see @pletz) file TOP.vhd 

 

entity TOP is 

port ( 

... 

); 

end TOP; 

 

 

architecture my_design of TOP is 

begin 

... 

end my_design; 

--- Quote End ---  

 

 

Hey man, I should say thank you. I was suffering with the same problem and the solution proposed by you solved it.  

Thank you so much  

 

 

have a good day
0 Kudos
AMish34
Beginner
12,073 Views

You should match ur filename with the name after module.

like if ur filename is section1. then in ur code there should be module section1 ().

0 Kudos
bteddy
Beginner
11,253 Views

Hello,
"Error: Top-level design entity "*NAME*" is undefined"

This is what I did to correct.
1) check paths for spaces, none allowed.
2) check entity name can not start with number.
3) Assignment - Settings - General - Top-Level Entity - "..."
4) From bottom up. select next entity up. Apply - OK.
5) Processing - "Start Compilation"
6) When complete. Tools - "Netlist Viewers" - "RTL Viewer"
Don't know if this step is necessary. It's what I did.
7) Repeat from step 3) moving up for each entity in list.
when finished, one last time with first (bottom/original)
"Entity Name"
9) Done

This created what was missing that was needed.
I worked for me hope it works for you.

0 Kudos
Reply