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

Tcl command execute_module doesn't seem to work

Altera_Forum
Honored Contributor II
2,392 Views

I'm using QuartusII v15 and developing for a BeMicro CV board. The board has an eeprom device that is programmable by the fpga, but you need to convert the .SOF output file into a Jtag file (.JIC format) in order to program the board. It's been tedious to do this manually on every build, so I wanted to see if I could add an automated task via a Tcl script to generate the .JIC file. 

 

The Tcl Scripting Reference Manual claims to offer an execute_module command that allows you to execute the cdb tool from within a tcl script. I followed the recommended example (pg. 3-103) and came up with the following script line to run the quartus_cdb tool from a script: 

 

execute_module -args "-c Compression=on --sfl_device=\"5CEFA2\" --device=\"EPCS16\" output_files/simpleled.sof output_files/simpleled.jic" -tool cdb 

I decided to test this script inside the Tcl Console window, but it only gives me error output: 

 

Error:invalid command name "quartus_cdb" 

Error: while executing 

Error:"unknown_original quartus_cdb --tcl_eval <tcl command>" 

Error: ("eval" body line 1) 

Error: invoked from within 

Error:"eval unknown_original $cmd $args" 

Error: (procedure "::unknown" line 7) 

Error: invoked from within 

Error:"quartus_cdb --tcl_eval <tcl command>" 

Error: invoked from within 

Error:"execute_module -args "-c Compression=on --sfl_device=\"5CEFA2\" --device=\"EPCS16\" output_files/simpleled.sof output_files/simpleled.jic" -tool cdb" 

 

 

 

Can anyone at Altera tell me if I'm calling the script / procedure properly? Have I used the right escape syntax for the arguments? 

 

I'd also like to run this as a task from within the task window by putting this line into its own .tcl file and adding it to a new flow based on "Compilation". However, I need to make sure that the syntax is alright first and I find the error messages provided to be a little bit vague.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
1,623 Views

Ok, I solved this on my own. First, I was calling the cdb tool instead of the cpf tool. Second, you can't specify conversion/output options to cpf on the command line. They have to go in a separate config file which you specify with the --options argument. You're not even supposed to edit this by hand; rather you run the quartus_cpf tool from the shell and it prompts you with options that are based on your eeprom device (or whatever memory you have.)  

 

So the resulting solution is: 

$ quartus_cpf -w config_file.txt # From your bash terminal or command shell 

 

Then the Tcl script line is: 

execute_module -tool cpf -args "-c --option=<full_path>/config_options.txt --sfl_device=\"5CEFA2\" --device=\"EPCS16\" <full_path>/simpleled.sof <full_path>/ simpleled.jic" 

 

For paths, the .sof is in output_files and that's where I put the .jic file too. I put the config_options.txt in my root project folder since it's a small project and that's where everything else is. From here, you can figure out how to add this to your task list on your own with a bit of tinkering.
0 Kudos
Altera_Forum
Honored Contributor II
1,623 Views

Glad that you have resolved it and thanks for the sharing on the solution.

0 Kudos
Reply