Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
11 years ago

call qsys-(script|generate) from PRE_FLOW_SCRIPT_FILE

Hello!

I'd like to call qsys-script and qsys-generate in a tcl script wich is linked with PRE_FLOW_SCRIPT_FILE to a quartus project.

conditions:

I've got multiple quartus installations lying round for different projects (just have to, can't change this).

problem:

qexec makes it easy to call quartus_sh etc, but this doesn't work for qsys-script or qsys-generate.

I don't want to rely on quartus_rootdir since that does not neccessarily point to the quartus version which is currently used.

question:

Is there another solution to call / get the paths for qsys-generate and qsys-script corresponding to the quartus version currently used?

Thanks in advance!

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    My suggestion for managing multiple installations is to explicitly setup QUARTUS_ROOTDIR and your PATH to correctly point to the version of the tools you would like to use before you use them.

    Under Linux, I keep a simple shell script to setup the environment for the indicated version. I just run it manually each time I launch an xterm when I intend to use the Altera tools.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Is there another solution to call / get the paths for qsys-generate and qsys-script corresponding to the quartus version currently used?

    --- Quote End ---

    Yes. Take a look at the scripts used for the DE0-nano SDRAM design I posted;

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

    The script synth.tcl drives the design. If the qsys_system.qsys script does not exist, it generates it from qsys_system.tcl. Once qsys_system.qsys exists, the script calls synth_qsys.tcl to "generate" the Qsys system. All of this is done using Quartus Tcl, and within Quartus Tcl, QUARTUS_ROOTDIR is correct. As you have noticed, the same cannot be said when just starting a Command shell. Note however that if you run your scripts from a NIOS II IDE Shell (a Cygwin shell) specific to the Quartus installation, then the QUARTUS_ROOTDIR environment variable will be correct.

    Poke around in those scripts and you might get some ideas.

    Regarding the use of pre-flow scripts, take a look at the BeMicro-CV DDR design in the examples zip posted here (post# 5);

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

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi Dave!

    Thank you very much for sharing the two projects! From what i can see, there's a solution for pretty much every concern i have at the moment!

    Thanks again! :)
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thank you very much for sharing the two projects! From what i can see, there's a solution for pretty much every concern i have at the moment!

    Thanks again! :)

    --- Quote End ---

    You're welcome.

    The Quartus Tcl shell works properly, i.e., you can access ::env and use TCLLIBPATH to point to reusable scripts. System Console and Qsys use "crippled" Java-based Tcl interpreters. I've noticed that in the latest versions of the tools ::env gets cleared out, so my source code environment variable VHDL is no longer visible. I've tried to annotate my scripts with these tool limitations.

    Cheers,

    Dave