CSCE351:
Pre Project Lab
Pre-project
Lab
Deadline
& Weight
▪
At your own time
▪
0%
weight in your final grade [1]
Objective
To
get the project infrastructure ready
Design Environment
Hardware
á A computer
accessible by a team
á FPGA boards: either
DE1 (user manual) or DE2 (user manual)
á Accessories: power
cord, USB cable
DE1 board (user manual) |
DE2 board (user manual) |
|
|
Required Software
á Quartus-II Web Edition v11.0, including Nios-II
v11.0 Software Build Tools for Eclipse (download
with registration required)
á Nios-II Soft-Core: for
DE1_NIOS-II (manual,
zip)
or DE2_NIOS-II (manual,
zip)
á USB Blaster Driver:
indispensable for the communication between your computer and the DE1/DE2
board.
Host OS |
User Manual |
Installation Guide |
Windows |
||
Linux |
Optional Software
á Virtualbox for Mac (download)
[2]
Suggestion
á During the Quartus-II
installation, you can choose to only install "Cyclone Family II" to save
storage space.
Download
the Nios-II Soft CPU to the FPGA Platform
1.
Connect the DE1/DE2 board (BLASTER Port, not DEVICE Port) to
your computer with the USB cable, and power it on.
2.
Click "Nios-II IDE"
-> "Nios II" -> "Quartus II Programmer", and you will launch the FPGA
programmer.
3.
Configure "Hardware Setup" as
"USB-Blaster", configure "Mode" as "JTAG", and
click "Auto Detect". You will see the detected "EP2C35"
device.
4.
Double click the "<none>" field below the
"File" tag, specify "DE1/DE2_Basic_Computer.sof" under your
unzipped DE1/DE2_NIOS-II folder, check the "Program/Configure" box,
and click "Start".
5.
When the "progress" bar reaches "100%(Successful)",
you have finished downloading the Nios-II CPU to the
DE1/DE2 board. After that, you can quit the FPGA programmer.
6.
Please be advised that the Nios-II
CPU is volatile, which means that all configurations will be lost after your
power off the DE1/DE2 board. You will have to repeat the procedures above next
time.
|
|
Create
a Nios-II C Project
1.
Click "Nios-II IDE"
-> "File" -> "Nios II
Application and BSP from Template".
2.
Specify the file "nios_system.sopcinfo"
under your unzipped DE1/DE2_NIOS-II folder in the "SOPC Information File
Name" field.
3.
Type your preferred "Project name".
4.
Change the "Project location" with the "Use
default location" box unchecked if you want.
5.
Choose a "Project template". E.g., "Hello
World" (or "Blank Project").
6.
Click "Finish"
|
Build
the Project
1.
Click
"Nios-II IDE" -> "Project"
-> "Build All"
Observe
the FPGA Platform Output
1.
Click "Nios-II IDE"
-> "Run" -> "Run Configurations".
2.
Double click "Nios II
Hardware".
3.
In the "Target Connection" tag, keep clicking
"Refresh Connections" until you see the device information.
4.
In the "Project" tag, specify the name of the
project that you want to run.
5.
Click "Run". After a while, you will see the
message "Hello from Nios II!" printed out
by your program, at the bottom of your ÒNios-II IDEÓ.
Debug
the Project
1.
Click "Nios-II IDE"
-> "Run" -> "Debug Configurations".
2.
Double click "New_Configuration"
below the "Nios II Hardware" option.
3.
Click "Debug" so that the IDE window switches to
the debug perspective.
4.
If you click "Nios-II
IDE" -> "Debug Sub-Window" -> "Instruction Stepping
Mode" icon, you will see the disassembly instructions of your C program.
Later on, you can proceed with debugging instruction by instruction, which will
be shown in the "Disassembly" tag at the bottom of the "Nios-II IDE". If you just want to debug your normal C
program rather than its disassembly, you will need to click the
"Instruction Stepping Mode" icon again so as to switch back to the
normal stepping mode. In this case, you can also close the
"Disassembly" tag if you want.
5.
You can do debugging as in other C/C++ IDEs, such as setting
checkpoints, watching variable/register/memory values, or tracking the program
execution step by step or continuously.
References
1.
↑ Note: You don't need to submit anything
for this lab by the deadline.
2.
↑ Note: The Lab TA has no idea whether the Quartus-II Linux version can work on Mac. But the past
practices indicated that Mac users can install a
virtual machine (e.g., Virtualbox) plus a Windows OS
on Mac to run Quartus-II and Nios-II
IDEs.