Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
告知
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 ディスカッション

passing value to tcl

s002wjh
新規コントリビューター I
2,476件の閲覧回数

is there anyway to pass value to a variable in side the tcl.  either from tcl console under quartus or using quartus_sh under linux?

for example

i have text.tcl, inside is

   set test  0

 

in my cmd line  i want to     

quartus_sh  -t test.tcl  test =5  

or in tcl console/

source test.tcl test=5

0 件の賞賛
1 解決策
s002wjh
新規コントリビューター I
2,420件の閲覧回数

thx.  seem "exec" would work but everytime i try

exec quartus_sh -t top.tcl 5   it just freeze quartus

元の投稿で解決策を見る

7 返答(返信)
Heiko
初心者
2,463件の閲覧回数

You could do

quartus_sh -t test.tcl 5

And in test.tcl have

set test [lindex $argv 0]

 

That takes the zeroth input argument, in this case 5, and assigns it to a variable test.

RichardTanSY_Altera
モデレーター
2,440件の閲覧回数

May I know whether the suggestion from Heiko help in your case?
Do you need further help on this?

Best Regards,
Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos. 

s002wjh
新規コントリビューター I
2,437件の閲覧回数

it help on linux side, but what about tcl console in quartus?

when i try quartus_sh i got these errors

 

Error:invalid command name "quartus_sh"

Error:    while executing
Error:"unknown_original quartus_sh -t top_all.tcl 5"
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 -t top_all.tcl 5"
Heiko
初心者
2,428件の閲覧回数

If you're running it from the tcl console the quartus_sh is not a valid command. Because (*I think) the tcl console in the quartus user interface is actually just the quartus_sh executable running in interactive mode.

To call quartus_sh from the tcl  console  you could use the exec command.

Following your example

exec quartus_sh -t top_all.tcl 5

 

Not sure if that is the most elegant solution to your problem. But it should work.

s002wjh
新規コントリビューター I
2,421件の閲覧回数

thx.  seem "exec" would work but everytime i try

exec quartus_sh -t top.tcl 5   it just freeze quartus

RichardTanSY_Altera
モデレーター
2,391件の閲覧回数

You may need to run it using command prompt. For best results, run shell commands and Intel® Quartus® Prime executables from a system command prompt outside of the Intel® Quartus® Prime software GUI. 

Best Regards,
Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos. 

RichardTanSY_Altera
モデレーター
2,365件の閲覧回数

I believe that you got the answer to your inquiry. With that, I will now transition this thread to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.

Best Regards,
Richard Tan

p/s: If any answer from the community or Intel support are helpful, please feel free to give Kudos. 

返信