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

Compiling project through Makefile

Altera_Forum
Honored Contributor II
2,449 Views

Hello, I always used GUI for my projects and now trying to learn how to set up the project and do compilation/synthesis through command line. I am reading the quartus 2 handbook for command line scripting. I went through their example of a script for creating project and doing full compilation, STA, pin assignment. I have one small question though. 

 

Is there any way for just doing compilation and elaboration (ctl + K) through command-line ? I don't want to do full compilation each time as it consumes time and not necessary always. I can also compile the codes using Modelsim but wondering about how it can be done through quartus.  

 

Thanks in advance.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,324 Views

You can use Makefiles, but Tcl is also an option. For example, see the scripts created with this project: 

 

http://www.alterawiki.com/wiki/using_the_usb-blaster_as_an_sopc/qsys_avalon-mm_master_tutorial 

 

Makefiles are good when you can create dependencies, eg., a .o file is created from a .c file. Unfortunately for synthesis, there is no .o file. HDL code gets compiled into the "black box" that is the Quartus database. Altera does provide an application that makes it possible to track internal dependencies, but I've never used it. Tcl has sufficed for me. 

 

Modelsim also has a facility to create Makefiles. However, they're useless. The way it creates the compilation order is to try, and if failure occurs, re-order and try again. Since Modelsim generates files in database directories, you can create dependencies, or 'touch' files to create xxx.done timestamps. Basically you have to create a Makefile manually, with your design files in the correct order (packages first, then source), and then create mega-dependencies, i.e., rebuild all source if any of the packages change (I do this since I've never found a dependency generator for VHDL files, i.e., this source depends on these packages). 

 

You'll also face issues with how Make deals with directory paths in Cygwin vs Linux ... 

 

Start with Tcl, see if that is enough for you. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
1,324 Views

 

--- Quote Start ---  

 

Is there any way for just doing compilation and elaboration (ctl + K) through command-line ? 

 

--- Quote End ---  

 

 

Simply use quartus_map 

 

"quartus_map -h" for argument list, but at the high level, all you need is "quartus_map <revision_name>" where revision_name is the base name of your qsf (no extension)
0 Kudos
Altera_Forum
Honored Contributor II
1,324 Views

Also note that every time you run a process on the GUI (like "Analysis and Synthesis"), Quartus will report the command-line string in one of its first messages. That is the exact command you can use yourself on the command-line

0 Kudos
Altera_Forum
Honored Contributor II
1,324 Views

 

--- Quote Start ---  

Simply use quartus_map 

 

"quartus_map -h" for argument list, but at the high level, all you need is "quartus_map <revision_name>" where revision_name is the base name of your qsf (no extension) 

--- Quote End ---  

 

 

Thanks. I found it. "quartos_sh --flow analysis_and_elaboration <projectname>" does the compilation.
0 Kudos
Altera_Forum
Honored Contributor II
1,324 Views

You can also find more info using 

 

quartus_sh --qhelp 

 

To start the Tcl help GUI. You'll find info on the command-line tools, Tcl packages, and down the bottom makefiles. 

 

Cheers, 

Dave
0 Kudos
Reply