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

Getting the PRE_FLOW_SCRIPT_FILE thing to work

Altera_Forum
Honored Contributor II
2,893 Views

Folks, 

I have been trying to get a tcl script to run before compile to no avail. I have a tcl script to create a vhd file with the build date and time in it, gleaned from the examples on the net. I can run this script from the tcl cmd line in qts (15.1). The tcl file runs and creates the correct vhd file contents. I put this in the projects qsf file: 

 

set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:build_date.tcl" 

 

build_date.tcl resides in the projects root dir, ext to the .qsf file 

When I initiate a build, I dont see it running 

I tried entering this command manually at the tcl command line in qts as well - still does not get run. 

 

Questions: 

Where is the build_date.tcl file supposed to be placed? 

when does the .qsf file get read? 

How do I debug this? 

 

Thanks, 

Ed
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
1,931 Views

Hi, 

Refer the following old thread especially “readme.txt” as reference, 

https://www.alteraforum.com/forum/showthread.php?t=46559 

It is probably useful as you might be looking for. 

 

Let me know if this has helped resolve the issue you are facing or if you need any further assistance. 

 

Best Regards 

Vikas Jathar  

(This message was posted on behalf of Intel Corporation)
0 Kudos
Altera_Forum
Honored Contributor II
1,931 Views

Vikas, 

Thanks for responding. The link you referred to is the one I used initially to set up my build date idea. What is is missing is the command in the .qsf to get the synth_preflow.tcl running. This is specifically called out in the Quartus II handbook v 13.1 on page 3-10. It sez to put the set_global_assignment line in the projects .qsf, which I did. There are other links on the web for doing this and they all appear to have the same procedure, which I followed 

 

I experimented with the location of the .tcl file but got nowhere. Right now it is at the project top. I added a post_message line in it but I never see anything come out on the messages window. I intentionally misspelled a command in the .qsf file and qts found that immediately. It must be have a settings cache because it "reverted" the qsf settings and wrote them back to the qsf file. 

 

I put an error in my build_date.tcl file and there is never a complaint when I run A&S. I dont think qts is even processing the command in the qsf file. 

 

I tried restarting qts, does not run the script 

Its like the PRE and POST script running is disabled... 

 

Questions: 

How do I list the current working directory in the tcl console? ls and dir dont work. There doesnt seem to be a solution for this on the web either. Is this function removed from the quartus tcl implementation? 

 

Thanks, 

Ed 

 

 

 

--- Quote Start ---  

Hi, 

Refer the following old thread especially “readme.txt” as reference, 

https://www.alteraforum.com/forum/showthread.php?t=46559 

It is probably useful as you might be looking for. 

 

Let me know if this has helped resolve the issue you are facing or if you need any further assistance. 

 

Best Regards 

Vikas Jathar  

(This message was posted on behalf of Intel Corporation) 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,931 Views

Hi Ed, 

 

I'm using a preflow script for generating a VHDL-file with tiem stamp, build id, ... 

The syntax you are using is correct (In my case: set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:build_id.tcl") 

I have the tcl in the same directory like the qsf. 

Check the Messages in Quartus after starting a compile: 

 

Info (23030): Evaluation of Tcl script build_id.tcl was successful 

 

Just to see if Quartus recognize the preflow command try to remove the script from the project directory. Start a compile and you may see some error messages in Quartus: 

 

Error (23018): Tcl Script File build_id.tcl not found 

Error (23031): Evaluation of Tcl script build_id.tcl unsuccessful 

 

 

Best Regards 

Jens
0 Kudos
Altera_Forum
Honored Contributor II
1,931 Views

Jens, 

I never see the Info message after starting A&S in the messages window. Also, if the .tcl file is not in the top-level dir, there is no error shown. I think this is the heart of the problem, qts is just ignoring the set_global_assignment in the qsf. I kno it is being "looked at" because if I damage the command somehow, qts repairs the line in the .qsf, apparently from a cache somehwere. I even edited the .qsf file with qts not running, installed a set_global_assignment pointing to a non-existing file and A&S ran. I even tried entering the set_global_assignment in the tcl console in qts. It adds the entry to the qsf but still ignores it. This is why I think this feature is disabled somehow.  

 

 

Thanks, 

Ed 

 

 

 

 

 

--- Quote Start ---  

Hi Ed, 

 

I'm using a preflow script for generating a VHDL-file with tiem stamp, build id, ... 

The syntax you are using is correct (In my case: set_global_assignment -name PRE_FLOW_SCRIPT_FILE "quartus_sh:build_id.tcl") 

I have the tcl in the same directory like the qsf. 

Check the Messages in Quartus after starting a compile: 

 

Info (23030): Evaluation of Tcl script build_id.tcl was successful 

 

Just to see if Quartus recognize the preflow command try to remove the script from the project directory. Start a compile and you may see some error messages in Quartus: 

 

Error (23018): Tcl Script File build_id.tcl not found 

Error (23031): Evaluation of Tcl script build_id.tcl unsuccessful 

 

 

Best Regards 

Jens 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
1,931 Views

Ed, 

I don't know for sure but I don't think the pre-flow is executed with A&S. You need to do a full compile. At least that is how it works for me on Q17.
Altera_Forum
Honored Contributor II
1,931 Views

You are correct! Literally one minute before you posted this, I discovered just that. I was fooling around with signal tap and hit the compile button. It ran the entire compile flow, starting with my pre-compile script. 

 

And thats the answer.... 

 

 

--- Quote Start ---  

Ed, 

I don't know for sure but I don't think the pre-flow is executed with A&S. You need to do a full compile. At least that is how it works for me on Q17. 

--- Quote End ---  

0 Kudos
Reply