Forum Discussion

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

PRE_FLOW_SCRIPT_FILE problem

Hi.

I am trying to write the script for automatic update compilation time in my project. The script generate_version1.tcl:

set str  -format {%Y%m%d%H%M}]
set hex_value ${str}
set num_digits  
set bit_width   
set high_index  
set reset_value 
set fh 
puts $fh "module version_reg (clock, reset, data_out);"
puts $fh "    input clock;"
puts $fh "    input reset;"
puts $fh "    output \ data_out;"
puts $fh "    reg \ data_out;"
puts $fh "    always @ (posedge clock or negedge reset) begin"
puts $fh "        if (!reset)"
puts $fh "            data_out <= ${bit_width}'h${reset_value};"
puts $fh "        else"
puts $fh "            data_out <= ${bit_width}'h${hex_value};"
puts $fh "    end"
puts $fh "endmodule"
close $fh

This script generate version_reg.v file which contain the time. version_reg.v file included in my project.

I run:Tools->Tck Scripts...->generate_version1.tcl and this method work correct. I try to launch this cript automaticaly by adding in my qsf file:
set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:generate_version1.tcl"
But then I launch compilation, the script does not execute.

Operation system : Windows7

Quartus:13.0.1

PATH: C:\altera\13.0sp1\quartus\bin64

Also I try to use Tcl Console: "quartus_sh generate_version1.tcl" and have error:


Error:invalid command name "quartus_sh"
Error:    while executing
Error:"unknown_original quartus_sh generate_version1.tcl"
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_sh generate_version1.tcl"

Please, help me to solve my problem.

3 Replies

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

    I would like to use a pre-flow script to modify design parameters. Typically I used top level Generics in my design and then assign these using the

    Assignments/Settings/Default Parameters in Quartus. These appear as 'set parameter -name xxxx yy' in the project .qsf file.

    When I try to use a similar syntax in my .tcl script to modify the parameters I am informed that I need to open a project first. I wish to modify the project that is already open/about to be compiled.

    Any suggestions?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Any suggestions?

    --- Quote End ---

    Sure, read the script I referred to. It opens the project. Here's the bit you want ...

    
    #  -----------------------------------------------------------------
    #  Timestamp generic
    #  -----------------------------------------------------------------
    # 
    #  The project must be open before accessing generics
    if {!} {
    	project_open -revision $revision $project
    }
    #  Timestamp integer
    set timestamp  
    #  Top-level timestamp generic
    set_parameter -name TIMESTAMP $timestamp
    #  Post an info message
    set timestamp_str 
    set timestamp_hex 
    post_message -type info "TIMESTAMP = $timestamp_hex ($timestamp_str)"
    

    Cheers,

    Dave