Build a Quartus Project for an Intel Cyclone Board
Build a Quartus Prime Lite 23.1 project for a Cyclone IV E board from the command line with a QSF file, an SDC clock constraint, quartus_sh and quartus_pgm.

Quartus Prime is Intel's FPGA design suite, the vendor tool for the Cyclone family. This post builds a blinking LED design for a Terasic DE0-Nano board, which carries a Cyclone IV E EP4CE22F17C6, using Quartus Prime Lite Edition 23.1 from the command line. It covers the project's settings file, the SDC timing constraints, the compile flow, the reports and programming over JTAG. Part numbers and pins come from Terasic's DE0-Nano documentation. Verify them against the user manual for your board, and note that supported devices depend on the Quartus edition and version, so check Intel's device support list before installing.
How a Quartus project is organised
A Quartus project is a small set of text files. The project file, with the extension .qpf, names the project and its revisions. The settings file, .qsf, holds assignments: the device, the top-level entity, the source files, the pin locations and the I/O standards. A timing constraints file, .sdc, holds Synopsys Design Constraints style timing statements. Compilation writes results to an output_files directory: reports, the compiled .sof programming file and logs.
Because every file is text, a project fits in version control and builds in batch. The graphical interface edits the same files.
The design
The DE0-Nano has a 50 MHz oscillator and eight green LEDs. A counter shows its top bits on the LEDs:
module blink_de0 (
input wire clk,
output wire [7:0] led
);
reg [27:0] counter = 28'd0;
always @(posedge clk)
counter <= counter + 28'd1;
assign led = counter[27:20];
endmoduleAt 50 MHz, bit 27 toggles every 2^27 cycles, about 2.7 seconds, and bit 20 toggles about every 21 ms. The slow LEDs blink visibly and the fast ones appear to glow.
Quartus honours the initial value of counter for FPGA registers, since the configuration sets each register's power-up state.
The settings file
The .qsf below names the device, the top entity, the source and the pins. The pin names come from the DE0-Nano user manual, and the values PIN_R8 for the clock and PIN_A15 and its neighbours for the LEDs should be checked against it:
set_global_assignment -name FAMILY "Cyclone IV E"
set_global_assignment -name DEVICE EP4CE22F17C6
set_global_assignment -name TOP_LEVEL_ENTITY blink_de0
set_global_assignment -name VERILOG_FILE blink_de0.v
set_global_assignment -name SDC_FILE blink_de0.sdc
set_location_assignment PIN_R8 -to clk
set_location_assignment PIN_A15 -to led[0]
set_location_assignment PIN_A13 -to led[1]
set_location_assignment PIN_B13 -to led[2]
set_location_assignment PIN_A11 -to led[3]
set_location_assignment PIN_D1 -to led[4]
set_location_assignment PIN_F3 -to led[5]
set_location_assignment PIN_B1 -to led[6]
set_location_assignment PIN_L3 -to led[7]
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to clk
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to led[*]FAMILY and DEVICE select the chip. TOP_LEVEL_ENTITY names the top module. VERILOG_FILE adds a source, and SDC_FILE adds the timing constraints. set_location_assignment PIN_X -to port fixes a pin, and set_instance_assignment -name IO_STANDARD sets the electrical standard, with led[*] as a wildcard over the bus bits.
The project file is minimal:
PROJECT_REVISION = "blink_de0"The timing constraints
Without a clock constraint, Quartus's timing analyser has no target and reports the clock as unconstrained. The SDC file declares it:
create_clock -name clk -period 20.000 [get_ports clk]
derive_clock_uncertaintycreate_clock defines a clock named clk on the port with a 20 ns period, which is 50 MHz. derive_clock_uncertainty tells the analyser to add the device's own clock uncertainty, a recommended statement for Cyclone devices. Output ports driven by this design go to LEDs, so no output-delay constraints are needed. For ports that connect to other chips, set_input_delay and set_output_delay statements describe the external timing, as a later post in this cluster explains.
Compiling from the command line
The quartus_sh command with --flow compile runs analysis and synthesis, the fitter (Quartus's name for place and route), the assembler that writes the programming file, and the timing analyser:
quartus_sh --flow compile blink_de0The output is a summary of each stage, ending like this:
Info: Quartus Prime Full Compilation was successful. 0 errors, 4 warningsThe warning count depends on the project. Read the warnings once: unconstrained or unused-pin warnings can hide a mistake. If you prefer to run stages individually, quartus_map, quartus_fit, quartus_asm and quartus_sta run synthesis, fitting, assembly and static timing analysis respectively, and give finer control.
The compile writes its products to output_files/:
| File | Contents |
|---|---|
blink_de0.sof | SRAM object file, the volatile configuration for JTAG programming |
blink_de0.map.rpt | Analysis and synthesis report |
blink_de0.fit.rpt | Fitter report with resource use and pin assignments |
blink_de0.sta.rpt | Timing analysis report |
blink_de0.flow.rpt | Overall flow summary |
Reading the reports
The fitter summary lists logic elements used, registers, pins and memory bits against the device totals, and the timing report lists the Fmax per clock. A shortened extract of the Fmax summary has this form:
+-----------------------------------------------+
; Slow 1200mV 85C Model Fmax Summary ;
+------------+-----------------+------------+---+
; Fmax ; Restricted Fmax ; Clock Name ; ;
+------------+-----------------+------------+---+
; 320.41 MHz ; 250.0 MHz ; clk ; ;
+------------+-----------------+------------+---+The figures are illustrative. Fmax is the highest frequency the slowest path allows, and Restricted Fmax applies the device's limits on clock frequency, such as the maximum toggle rate of the clock network. If Restricted Fmax exceeds the 50 MHz target, the constraint is met.
Quartus analyses timing across several models, slow and fast corners at different temperatures, and the slow model is the one that must pass. The report names the corner, and a design that fails only in a fast model has a hold problem rather than a setup problem.
Programming over JTAG
The DE0-Nano has an on-board USB Blaster. quartus_pgm loads the .sof into the FPGA:
quartus_pgm -m jtag -o "p;output_files/blink_de0.sof"The operation string p;file means program that file. A listing of programming cables is available with quartus_pgm -l, and if more than one is present, the -c option names the right one. The output confirms:
Info: Quartus Prime Programmer was successful. 0 errors, 0 warningsThe .sof is volatile. To make the design persistent, convert it into a programming file for the board's configuration flash and program that, which needs the board's configuration device and a conversion step through quartus_cpf. For a first design, volatile loading is enough.
openFPGALoader also supports many Intel boards over USB-Blaster interfaces, which lets you program without the full Quartus installation.
Differences from the other flows
| Aspect | Quartus | Vivado | Open toolchain |
|---|---|---|---|
| Constraint format | QSF plus SDC | XDC (Tcl and SDC) | PCF, LPF and a frequency option |
| Place and route name | Fitter | Implementation | nextpnr |
| Programming file | .sof | .bit | .bin or .bit |
| Batch interface | quartus_sh --flow compile | vivado -mode batch -source | Individual commands |
| Cost | Free Lite edition | Free for small devices | Free and open |
Quartus Prime Lite supports a subset of devices, and Cyclone IV E parts such as the EP4CE22 are covered by Lite in 23.1. Later releases may drop or add devices, so confirm before choosing a version.
Common problems
**
Error: Can't place pin** or a warning that a pin is unassigned: a port has no location, or the pin number is invalid for the package.Unconstrained path warnings in timing analysis: the SDC file is missing, not listed in the QSF, or the clock name does not match.
**
Error (293007): Current license file does not support the device**: the installed edition does not cover the chosen device.The JTAG programmer sees no device: check the USB Blaster driver, the cable list from
quartus_pgm -l, and the board's power.Settings in the GUI differ from the command line: the GUI rewrites the QSF on save, so commit the file after any change.


