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

Scripting a global assignment without qsf modification?

Altera_Forum
Honored Contributor II
1,558 Views

Hello, 

 

I want to change a global assignment in a GUI started compilation, e.g. add SVN version information to USERCODE. This can be done by excuting a preflow script containing 

 

project_open -current_revision project_xxxxx set_global_assignment -name STRATIX_JTAG_USER_CODE code_yyyyy project_close 

 

But this also modifies the respective qsf file permanently which retriggers the version control system. The only workaround i've found so far is to reset the assignment to a default value in the postflow script. 

 

project_open -current_revision project_xxxxx set_global_assignment -name STRATIX_JTAG_USER_CODE FFFFFFFF project_close 

 

I hope there should be an easier way.  

 

As nother inconvenient point if you want to keep your scripts generic is the need for an actual project name in project_open command. I mean, the GUI apparently knows which project it is working with, the information should be available somehow? 

 

May be I'm missing something obvious, but at least the Quartus software manual examples don't tell it. 

 

Any insights appreciated! 

 

Frank
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
847 Views

Hey Frank, 

 

 

--- Quote Start ---  

 

But this also modifies the respective qsf file permanently which retriggers the version control system. ... I hope there should be an easier way.  

 

--- Quote End ---  

 

There is, don't use the .qsf file, use Tcl, and consider the .qsf file to be a build artifact :) 

 

 

--- Quote Start ---  

 

As nother inconvenient point if you want to keep your scripts generic is the need for an actual project name in project_open command. I mean, the GUI apparently knows which project it is working with, the information should be available somehow? 

 

--- Quote End ---  

 

Yeah, it is, you can get the info you want as follows  

 

# ----------------------------------------------------------------- # Tcl packages # ----------------------------------------------------------------- # package require ::quartus::project package require ::quartus::report # ----------------------------------------------------------------- # Script arguments # ----------------------------------------------------------------- # set module set project set revision # Path to the directory containing this preflow script set scripts ]] # post_message -type info "POSTFLOW: $module $project $revision" if {} { post_message -type info "POSTFLOW: Analysis & Synthesis detected!" post_message -type info "POSTFLOW: Run the DDR3 pin assignment script" # Check the pin assignments script exists set fname qsys_system/synthesis/submodules/qsys_system_ddr_p0_pin_assignments.tcl if {!} { post_message -type error "POSTFLOW: pin assignments script $fname missing!" } # Open the project before running the DDR assignments script if {!} { project_open -revision $revision $project } post_message -type info "POSTFLOW: Running the DDR3 pin assignments script $fname" source $fname # Save the changes export_assignments post_message -type info "POSTFLOW: DDR3 pin assignments complete" }  

 

This is the postflow script for the BeMicro-CV DDR example (see Post#5) 

 

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

 

and please take a look at this DE0-nano example (Post# 2) 

 

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

 

Both of these examples show how you can use a synth.tcl script to automate the creation of the Quartus project, i.e., it relegates the .qsf file to being a build artifact. The DE0-nano SDRAM example shows how you can take a Qsys XML file and convert it to Tcl so that it is portable between multiple Quartus versions. I figure that might be of interested to you. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
847 Views

Hello Dave, 

 

thanks for the suggestion. I think I understand the concept of replacing the qsf as project database by user scripts, it's basically discussed in the Quartus software manual, Volume 2, starting at Chapter 1. I agree that it can solve the raised issue. 

 

Personally I love a GUI centered design with qsf files holding most of the project settings. Lean and easy to setup for a new design. But I see that it has limitations. 

 

Regards, 

Frank
0 Kudos
Altera_Forum
Honored Contributor II
847 Views

 

--- Quote Start ---  

 

thanks for the suggestion. I think I understand the concept of replacing the qsf as project database by user scripts, it's basically discussed in the Quartus software manual, Volume 2, starting at Chapter 1. I agree that it can solve the raised issue. 

 

Personally I love a GUI centered design with qsf files holding most of the project settings. Lean and easy to setup for a new design. But I see that it has limitations. 

 

--- Quote End ---  

 

 

Don't think of the scripts as replacing the GUI, think of them as setting up the GUI independent of the Quartus version. Try running the synthesis scripts I referenced in the above links. Once you run the script, the GUI is fully functional, and is identical to as if you had opened up a .qsf file. You can save the Quartus project as a .qar, and it would be no different than had you started with Project->New. 

 

Tcl has the advantage that you can put useful Tcl procedures in a package (I use one called 'hdl', with 'altera' and 'modelsim' namespaces) and re-use that across multiple projects. It makes for concise Tcl scripts. I tend to remove that functionality from my example designs as it requires setting up environment variables (TCLLIBPATH) before it works. 

 

Cheers, 

Dave
0 Kudos
Reply