Forum Discussion
Altera_Forum
Honored Contributor
12 years agoResurrecting 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;