Here's a 'basic' example for the DE2 board. Here's how to compile it:
1) Download and unzip the file, eg., into c:/temp/de2_basic
2) Start Quartus and select the Tcl console. If its not visible, bring it up using View->Utility Windows, Tcl console
3) Change to the source folder, eg.,
tcl> cd {c:/temp/de2_basic}
(The {} pass the path to Tcl as a string, allowing it to expand correctly under Windows. Its not needed under Linux.)
4) Build the design
tcl> source scripts/synth.tcl
5) Download the design.
Pressing the buttons on the board will change the hex display values.
Cheers,
Dave
EPCS programming instructions (added 3/10/14)
1. Download de2_basic.zip
2. Unzip into c:/temp/de2_basic
3. Start Quartus
4. Select the Tcl console
If the Tcl console is not visible, make it visible via
View->Utility Windows->Tcl console
5. Change directory to the zip folder
tcl> cd {C:\temp\de2_basic}
6. Source the synthesis script
tcl> source scripts/synth.tcl
The script will output the following:
Synthesizing the DE2 'basic' design
-----------------------------------
- Creating the Quartus work directory
- Create the project 'de2'
* create a new de2 project
- Creating the VHDL files list
- Applying constraints
- Processing the design
- Processing completed
7. Download the configuration using JTAG
a) Plug in your DE2 board
b) Start the programmer
Tools->Programmer
c) Check that the USB-Blaster is detected
The "Hardware Setup" should have text next to it
that says "USB-Blaster ". If it has "None",
then click the "Hardware Setup" button and configure
the programmer to use the DE2 USB-Blaster
d) Click the "Auto Detect" button in the programmer
The programmer should detect an EP2C35F672 and
be ready to download the file de2.sof
e) Make sure the RUN/PROG button is in the RUN position
f) Click the "Start" button
The "basic" design connects the switches to the LEDs,
and the push-button switches to the 7-segment displays.
Toggle a switch and see that the LEDs change.
Push a push-button and see that the 7-segment
displays change.
8. EPCS programming
To program the EPCS device
a) Change the RUN/PROG button to PROG
b) In the programmer window, change the "Mode" to
"Active Serial Programming"
c) Click on the "Add File" button and add the file de2.pof
This adds the DE2 file to the GUI. Note that the "Device"
is EPCS16.
d) Check the "Program/Configure" and "Verify" check buttons
The programmer will always erase the device, so the
"Erase" button is optional
e) Click the "Start" button.
If you forgot to change the RUN/PROG button you will see the
following error in the Quartus messages window:
Info (209060): Started Programmer operation at Mon Mar 10 13:20:37 2014
Error (209025): Can't recognize silicon ID for device 1
Error (209012): Operation failed
If you did everything correct, you will see
Info (209060): Started Programmer operation at Mon Mar 10 13:20:46 2014
Info (209018): Device 1 silicon ID is 0x14
Info (209044): Erasing ASP configuration device(s)
Info (209024): Programming device 1
Info (209022): Performing verification on device 1
Info (209018): Device 1 silicon ID is 0x14
Info (209011): Successfully performed operation(s)
Info (209061): Ended Programmer operation at Mon Mar 10 13:21:06 2014
f) Change the PROG/RUN button back to RUN
g) Cycle power
Viola, the board loads the "basic" design.