Professional Documents
Culture Documents
Fontys Enginering Quartus Manual R10 190911 Laz
Fontys Enginering Quartus Manual R10 190911 Laz
Table of Content
1 Project (create/opening/editing) .................................................................................................... 4
1.1 Create an empty project .......................................................................................................... 4
1.2 Create a Simple project from scratch ...................................................................................... 9
1.2.1 Create a schematic view .................................................................................................. 9
1.2.2 Creating a symbol for a block form VHDL ..................................................................... 11
1.2.3 Using the generated symbol in a block/schematic file ................................................. 13
1.2.4 Generate/update the schematic file into a VHDL file. .................................................. 14
1.3 Create a More complex project from scratches .................................................................... 16
1.3.1 Creating a multi-block project ....................................................................................... 17
1.3.2 Create a new symbol from VHDL (and_block) .............................................................. 17
1.3.3 Create a new block from VHDL (or_block) .................................................................... 19
1.3.4 Create a new block from VHDL (sel_block) ................................................................... 19
1.4 Open an existing project ........................................................................................................ 22
1.5 Edit an existing project .......................................................................................................... 22
1.6 View the hardware result of your VHDL code (RTL viewer) .................................................. 25
2 Simulation...................................................................................................................................... 26
2.1 Create an expectation to compare your result ...................................................................... 26
2.2 Start the simulator ................................................................................................................. 27
2.3 Control the simulator/generate a simulation ........................................................................ 32
2.3.1 Add all the signals (you need them all for this tutorial) ................................................ 32
2.3.2 Change the height ......................................................................................................... 32
2.3.3 Change the order ........................................................................................................... 33
2.3.4 Adding dividers .............................................................................................................. 33
2.3.5 Prepare a DO file ........................................................................................................... 35
2.3.6 Execute the DO file ........................................................................................................ 36
2.4 Some tips to hand in your reports. ........................................................................................ 40
3 Use the board ................................................................................................................................ 41
3.1 Prepare your project for the board (assignment editor) ....................................................... 41
3.2 Uploading the SOF file (Soft programming) ........................................................................... 43
3.3 Creating a JIC file (for hard programming) ............................................................................ 48
3.4 Upload the JIC file(Hard Programming) ................................................................................. 49
4 Common error/mistakes ............................................................................................................... 50
4.1 VHDL....................................................................................................................................... 50
4.2 Schematic ............................................................................................................................... 50
4.3 ModelSim ............................................................................................................................... 50
Appendix A: Useful links/resources....................................................................................................... 51
Appendix B: VHDL syntax and examples: .............................................................................................. 52
Appendix C: VHDL Reserved Words ...................................................................................................... 54
Version history
R03 24-07-2017 Tanushree Roy Adapting to review 1 and adding chapters 1.2 and 1.3
R04 29-07-2017 Tanushree Roy Adapting to review 2 and adding chapter 1.4, 1.5 and 2
R05 09-08-2017 Joachim Lazaroms Ch 1 & 2 visual update. Error fix in VHDL template (end
process). Change ModelSim print steps. Added RTL viewer.
R06 15-08-2017 Tanushree Roy Adapting to reviews in over-all file and starting chapter 3
R07 23-08-2017 Joachim Lazaroms Finalize chapter 1 and 2. Make change to pin assignment
method. Adding links to appendix A: links
R08 26-08-2017 Tanushree Roy Changing time diagram and adding common mistakes
R09 28-08-2017 Joachim Lazaroms Final touch to all the content for publication
R10 11-09-2019 Meike Janssen, Updates pictures to Quartus 17, update picture that
Joachim Lazaroms everything is sourced from one project.
R11
1 Project (create/opening/editing)
1.1 Create an empty project
a) To start Altera Quartus Prime click on the Quartus Prime 17.0 icon or use Windows Start to
select Quartus Prime 17.0.
b) Use File New project Wizard (or click on the New Project Wizard icon) to create a new
project.
c) You now will get different windows. Do as in the demo below. The first window is the
Introduction window. Click here on Next.
d) In the next window select a directory and a name for your project and click Next.
For this and future projects make sure you apply a good file structure (see above), so files belonging
to a certain project are all within the right folder belonging to that project.
Follow the same rule for naming all assignments for all classes.
<sub code><semester><quarter>_<name of assignment><number of the assignment>_<small description>
Example: DD11_Ass1_projectname
f) In the Add Files window you can select and add files to your project. We start from the
scratch, hence just click on Next.
g) In the Family & Device Settings window choose for 5CSEMA5F31C6 and click next.
h) In the EDA Tool Settings window, you can add customary tools to the environment.
ModelSim-Altera is defined already. So, click next. (If not make sure it matches below)
i) In the Summary window, you will get a summary of your project. Click Finish.
Symbol:
and_block
Function:
The above block returns a high when both the inputs are high. This operation is called AND.
Make sure you have created a project as described in 1.1 Create an empty project
a) To do this go to File and choose for New. A new window will appear.
b) In this New window choose Block Diagram/ Schematic File and click on OK.
d) Click Save As, so this schematic file will have the name of the project.
b) Copy the VHDL template (from N@tschool) and adapt it to the your block. It should look like
this.
Entity name
e) If the result look like this, especially check the yellow marks. Then yo know, it did whent well.
a) Open the block/schematic file you already saved. Click on the SYMBOL TOOL.
b) Under project chose the and_block. And place it in the block/schematic file.
c) Click on the PIN TOOL to add the inputs and outputs. Remember to keep all inputs on the left
and outputs on the right.
After adding the appropriate input and output pins, your project should look like this.
If you see any errors after this, you need to fix it before going any further.
Make sure you have created a project as described in 1.1 Create an empty project
Symbol:
Architecture:
and_block:
This block generates a high on the output when both the input signals are high.
or_block:
This block generates a high on the output when either one of the input signals is high.
sel_block:
If the sel input is 0, then the output of the entire system is f_and. When sel input is 1 the output of
the entire system is f_or.
c) Save your VHDL file and name it and_block. Don’t forget to check the Add file to current
project check box.
The entity name and the name of your VHDL file should be the same, otherwise the software
will give you errors later.
d) Create a symbol from your code like you have done before.
e) Add the symbol to your schematic. Connect all the relevant input and output pins.
Remember to change the name of the ENTITYNAME and the name of the output. When
renaming the entity, do it in all three places to avoid errors.
Note: It is important to use the else statement instead of typing again an if statement with :
if sel=’1’.
d) Save your VHDL file. Create a symbol and place it in the block file.
In architecture, internal lines always need to get a name. If not, you get annoying names
when simulating.
Right click on the node line, click on properties, and give it an appropriate name (as done in
the picture above).
Now you need to do an ANALYSIS & SYNTHESIS. Click on either of the places as shown below
to run the check.
If you see any errors after this, you need to fix it before going any further.
assign_block:
Depending on the sel, the block assigns f to f0(when sel is 0) and f to f1(when sel is 1).
What should f0 be when sel = 1. As future engineer, you should see this quickly. Normally you should
give a suggestion, but for now we define the output value to be '0' when not defined.
c) Open a new VHDL file and follow the same steps as before. Your entity and sensitivity list
will be different now. With the help of the syntax of IF statement from the appendix
(Appendix B: VHDL syntax and examples:). Also the content of the process part is
different comping to other blocks.
e) Place the new symbol in the block file and connect the appropriate inputs and outputs.
Note: When the schematic change, you have to update the VHDL file of the schematic file.
g) Save your block file and run an Analysis & Synthesis check after checking all your
connections.
1.6 View the hardware result of your VHDL code (RTL viewer)
h) To see if your made a mess or not, copy a picture of the generaded result in your report.
Open RTL viewer
Remember, simple result is normally good. Big spaghetti should be coded better!
2 Simulation
2.1 Create an expectation to compare your result
a) Draw your own outcome as expected to compare later.
a) Compile your design (if not done yet). You can chose either way.
b) Then follow the steps below to open the simulation tool. Possible error is explained next.
c) When you get an error like this, then go to: toolsoptionsEDA Tool OptionsModelsim-
Altera and select the folder win32aloem. You find the map in
intelFGA_lite\17.0\modelsim_ase\win32aloem.
g) Select all your used VHDL files and click compile. Then click Done. (if you compile more then
use, it can result in bad simulation results). In our example project it is every VHDL file that is
listed below.
2
3
h) Check for error in the transcript log before you start a simulation.
For every complied file you get a new result. Make sure you scroll back for any errors.
k) You will see all your signals (internal and external) in the object window.
c) You will se that your signals have been added in the wave window.
OR
c) Set the height to 30.
b) Here the inputs are in the beginning and the outputs are in the end. Sel has been placed
afterwards because after the generation of f_and and f_or, the sel_block is used. After f is
generated from the sel_block, f0 and f1 and generated by the assign_block. Refer to the
architecture to understand the order of the system.
2.3.4 Adding dividers
Dividers can be used to make things clear.
These are dividers.
b) Give your divider a suitable name and click OK. (keep the height to 17 for diverders)
b) Retype the text below into your text editor. Complete the file. Make sure all combinations
are tested. (not everything is listed yet)
c) Save the notepad file with a .do extension. Don’t forget to change the SAVE AS TYPE to All
Files. Otherwise, you will have a text file saved as DD11_Ass11_2_DOfile.do.txt.
Use the projectlocation/simulation folder to save the file.
5. Use http://hilite.me/ to make your VHDL code look formatted when you paste it in word.
6. A simulation without comments is counted as no simulation.
7. Always make a copy of the work you hand in(tip). Sometimes teachers can lose their data.
8. Hand in a hard copy unless or otherwise stated.
9. Hand in your report within the deadline.
d) Double click the green text New in the column TO. Click on the glasses to search for
available IO.
f) Select all the IO (not the internal signals) and click COPY. Then click OK.
NOTE: if the list is empty, the project was not (successfully) compiled (1.2.4.b)).
NOTE: if you have an uncompleted pin assignment, it will break the board. This is solvable but is
risky. Ask the teacher for the. If you mess up this step it is broken for every!!!!!!!!!!
i) After assigning each pin to a location, close this windows and go back to the main window of
Quartus Prime. Compile your entire project.
j) Once the Assembler is done, a .SOF file is created in the folder ‘output_files’. Check the
timestamp of the SOF file.
f) Right click at the circled spot (left from label 5CSEMA5 AND not on the position of the HPS)
i) You can see the Progress bar on the top right to see when the .SOF file has been successfully
uploaded less than 15 seconds.
b) Now select JTAG Indirect Configuration File (.JIC) form the dropdown menu ‘Programming
file type’, set the Configuration device to EPCS128 and select a name and folder where you
want to save your file. Like the picture blow:
c) Now click Flash Loader in the lower window and click Add Device on the right.
Open the programmer and set up your device like you did before(3.2). Now follow the steps below.
a) Now connect your board, and aging make sure to set MSEL[4..0] to “10010” and go to the
programmer. Do the same as you did while Soft Programming, only select the newly
generated .JIC file instead. Your final window should look like this:
b) Click start. Your board will display some strange signs on the seven segment displays. Also
Hard programming your board takes a lot longer (up to 5 min). This is all normal. When the
progress bar is at 100% and this happens a few times, it is completely done. Disconnect
power to your board and reapply it (reboot it). Your program should load in and you should
be able to use it without a USB connection.
4 Common error/mistakes
4.1 VHDL
1. Error (10500): VHDL syntax error at addslice.vhd(35) near text "f"; expecting ";"
Syntax error. Probably forgotten to add a Semicolon (;) in the previous line.
Always look in the line above and compare it with Fout! Verwijzingsbron niet gevonden.
2. Error (10500): VHDL syntax error at addslice.vhd(31) near text "="; expecting "(", or "'", or "."
Error (10500): VHDL syntax error at addslice.vhd(31) near text "after"; expecting ";"
Error (10526): VHDL Signal Assignment Statement error at addslice.vhd(31): Signal
Assignment Statement must use <= to assign value to signal "d"
The = symbol is used in the IF statement. You need a <= symbol to assign a value to a
signal. In case of a variable you need a := symbol.
3. Error (10500): VHDL syntax error at addslice.vhd(16) near text ")"; expecting an identifier, or
"constant", or "file", or "signal", or "variable"
In the ENTITY part there is a PORT() description. All the ports a separated by a Semicolon
(;). You also added a Semicolon (;) after the last I/O. that’s is wrong. A separator is nog a
closing symbol.
4. Error (10327): VHDL error at addslice.vhd(49): can't determine definition of operator ""-"" --
found 0 possible definitions
VHDL don’t know what to do with math operator. There is a library for that. Include this on
the top of your VHDL file, next to the others: use ieee.std_logic_signed.all;
5.
4.2 Schematic
1. Warning (275002): No superset bus at connection
You forgot the yellow marked part or you connected 2 different NetNames to each other.
2. Warning (275011): Block or symbol "ADDSLICE" of instance "inst" overlaps another block or
symbol
Move the existing block to find which one is overlapping. An in or output could also overlap.
4. Error (275062): Logic function of type GND and instance "inst" is already defined as a signal
name or another logic function
This is hard to recognize. The problem is that Quartus was too stupid to give them a
different instance name. Use the right button of the mouse on the GND symbol and click
properties. There you can see there is an instance name and it is identical to another block.
Simple give it a unique name and you’re done.
4.3 ModelSim
1. Tbd
6. Statements
Statement Example
Variable assignment P := k;
Signal assignment A(6 downto 0) <= NOT B(11 downto 4);
A <= X XOR Y;
CASE expression IS
WHEN choice 1 => sequential Case sel is
statements; When "00" => a <= b+c;
WHEN choice 2 => sequential When "01" => k <= t AND y;
statements; When "11" => temp := 12;
: When others => z = "Jan";
: End case;
WHEN OTHERS =>
sequential statements;
END CASE;
Signal assignment
<target> <= {<expression> }; Sum <= A XOR B;
source: https://www.csee.umbc.edu/portal/help/VHDL/