Download Altera FPGA image from command line

Here’s a tip on how to download an Altera FPGA image from the command line, versus using the Quartus II GUI. Specifically, we show two types of downloadable files: JTAG Indirect Configuration File (.jic) and SRAM Object File (.sof). These commands have been tested using a Cygwin terminal.

JTAG Indirect Configuration File (.jic):
% quartus_pgm -m JTAG -o 'ip;'./output_files/fpga_top.jic''
SRAM Object File (.sof):
% quartus_pgm -m JTAG -o 'p;'./output_files/fpga_top.sof''

Also, we show a simple C-shell script that downloads a .jic file residing in any given directory:
#!/bin/csh
if ($#argv == 0) then
   echo "Usage: fpga_top_pgm.sh <path to jic file>"
   exit 1
endif
set PROJECT = $argv[1]echo "Programming $PROJECT"
quartus_pgm -m JTAG -o 'pi;'"$PROJECT"''

Additional information could be found here TclScriptRefMnl.pdf.