Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16624 Discussions

Using cmd line when multiple quartus versions installed

Altera_Forum
Honored Contributor II
2,399 Views

Hi, 

 

I'm creating batch scripts to compile projects every night automatically. Works fine... 

 

Now i am running somehting like: "quartus_sh -t ....." and then I see the quartus verions last opened beeing used to execute the script. 

 

I want to choose for each project the version of quartus i want (eg: project 1 quartus 9.1, project 2 quartus 10.0, etc etc). 

 

 

How do you do that? Is their an option like quartus_sh -v 9.1 -t ... ???
0 Kudos
9 Replies
Altera_Forum
Honored Contributor II
1,072 Views

when you open up Quartus GUI on Windows, it sets the QUARTUS_ROOTDIR environment variable to that version. QUARTUS_ROOTDIR is used in the PATH environment variable, which is how the command line finds your executable applications 

 

so to change the version of Quartus used by your script, set the QUARTUS_ROOTDIR to the appropriate location between each quartus_sh command
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

now that i think about it, this may require a bit more work because i'm not sure that PATH will change based on QUARTUS_ROOTDIR being changed in a shell 

 

either way you should get an idea of how you can solve the problem
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

You cannot do this within Quartus, but you should be able to write a script to achieve what you want. For example, you can have the script change your search path so that when you type quartus_sh, it either finds it from the 9.1 or the 10.0 directories (for example). 

 

If you want to switch automatically based on the project, you will need your script to first get the LAST_QUARTUS_VERSIOON from the QSF, and use that to decide which EXE to call. It should be easy to do using grep/awk or using some higher level scripting language like Perl, Python (or Tcl). 

 

Hope this helps. 

 

DK
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

First have a look here, maybe it could help : 

http://www.alteraforum.com/forum/showthread.php?t=86 

Good luck.
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

okay!  

 

Combining all these I'll this is the plan: 

- parse qsf to see what quartus version is needed (tricky cause i sometimes use a tcl script to generate the qsf...) 

- try to list the installed Q2 versions and find their exe's 

- run the right one if available...
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

If you are on Windows, an easy hack to use is to use the old "subst" command. Basically, you define a new letter mount to basically link to the different versions of Quartus, such that you can use a constant absolute path to Quartus. 

Basically, you can add "z:\quartus\bin" to your search path (PATH) and then, based on the QSF setting, you dynamically change what Z: points to: 

subst z: c:\acds91_path 

or 

subst z: c:\acds100_path 

such that z:\quartus\bin\quartus*.exe are always the EXEs you use, only they magically point to different versions of Quartus.  

 

You use Links to do the same on Linux. 

 

Hope this helps. 

 

DK
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

hi, 

I have written a script in ticle (tcl) to create, compile and program the altera's device cyclone II. 

 

First two operations means create and compile design is working fine but when I am adding command to program the device it is showing errors that  

 

"Invalid command name quartus_pgm " 

while executing  

unknown_original quartus_pgm -c USB-Blaster -m JTAG -o P" 

 

 

please give me some solution. 

the script which I am using is shown below. 

basically I want to program the device from the script itself. 

////////////////////////////////// 

load_package flow 

 

project_new test3 -overwrite 

# Assign family, device, and top-level file 

set_global_assignment -name FAMILY CycloneII 

set_global_assignment -name DEVICE EP2C70F896C6 

set_global_assignment -name VERILOG_FILE mux2_1.v 

set_global_assignment -name TOP_LEVEL_ENTITY mux2_1 

# Assign pins 

set_location_assignment -to clk Pin_AD15 

set_location_assignment -to reset Pin_T29 

# compile the project 

execute_flow -compile 

# Other assignments could follow 

quartus_pgm -c USB-Blaster -m JTAG -o P;mux2_1.sof 

 

project_close 

///////////////////////////////////////////////////////// 

 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

Quartus_pgm is not a Tcl command. I believe you can access the command via execute_module ( you will need the -args option to specify the extra commands ), but if not, you need to use Tcl's 'exec' command or Quartus improved 'qexec' command. 

 

Please use 'quartus_sh --qhelp' for details on the commands.
0 Kudos
Altera_Forum
Honored Contributor II
1,072 Views

thanks for the reply. 

but I want to ask that it is possible to program a device using a script.
0 Kudos
Reply