A Short Answer
Error (12007): Top-level design entity "alt_ex_1" is undefined
The error message is far from trivial to make sense of, but in a roundabout
way it does tell what is wrong.
You are (probably) using alt_ex_1.vhd
as the name of your design file.
In Altera Quartus, the file name must be the same as the name of the
(top level) entity
declared in the VHDL design code.
What you need to do is to change the file name from alt_ex_1.vhd
to
light.vhd
.
To keep it simple, create a new project named light
instead of alt_ex_1
.
An Elaborated Answer
Reproducing the error is straightforward. Here is what I did. 1
After starting the Quartus Prime Lite Edition click File
>
New Project Wizard...
.
If you see an Introduction, click Next >
. Choose a working directory.
As name of the project enter alt_ex_1
.
Click Next >
twice and then Finish
.
Create a design file: File
> New...
.
Under Design Files
, choose VHDL File
, then OK.
Next File
> Save As...
. Type or paste alt_ex_1.vhd
and click
Save
.
Paste the code:
library ieee;
use ieee.std_logic_1164.all;
entity light is
port(x1, x2: in std_logic;
f: out std_logic);
end light;
architecture LogicFunction of light is
begin
f <= (x1 and not x2) or (not x1 and x2);
end LogicFunction;
and save the file again.
Compile with Processing
> Start
> Start Analysis & Synthesis
- or press
Ctrl + K.
The Message window displays the error:
12007 Top-level design entity "alt_ex_1" is undefined
To get rid of the annoying error, delete all the files that were created in
the working directory, and then start all over.
Follow the instructions as above, but this time make sure to replace every
occurrence of alt_ex_1
with light
.
In the Message window expect to see something like:
Quartus Analysis & Synthesis was successful. 0 errors, 1 warning
as one of the last lines.
1 Using Altera / Intel Quartus Lite 18.1 on Windows 10, but the
version is likely not important.
References: