UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
4,864 Views
Registered: ‎09-25-2015

Bug? TCL: config_interface

Jump to solution

I have problems to set the parameters of config_interface with a variable:

 

set axi_addr "-m_axi_offset off -register_io off"
puts "axi_addr=$axi_addr"
config_interface "$axi_addr"

gives me errors:

axi_addr=-m_axi_offset off -register_io off
ERROR: [HLS 200-101] 'config_interface': Unknown option '-m_axi_offset off -register_io off'.

FORMAT
  config_interface [OPTIONS]
    -clock_enable
    -expose_global
    -m_axi_addr64
    -m_axi_offset ( *off* | direct | slave )
    -register_io ( *off* | scalar_in | scalar_out | scalar_all )
    -trim_dangling_port

command 'config_interface' returned error code
    while executing
"config_interface "$axi_addr""

What happens here ?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Scholar pratham
Scholar
8,800 Views
Registered: ‎06-05-2013

Re: Bug? TCL: config_interface

Jump to solution

@jesko I think you missed my last reply.

 

When executing a Tcl command, you can use variable substitution to replace some of the command line arguments accepted or required by the Tcl command. In this case, you must use the Tcl eval command to evaluate the command line with the Tcl variable as part of the command.

http://wiki.tcl.tk/1017

 

With the TCL command config_interface $axi_addr, you are passing multiple arguments to a command config_interface using a $axi_addr variable which is not a case when you are running  open_project TCL command. 

 

I hope this helps.

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
8 Replies
Scholar pratham
Scholar
4,820 Views
Registered: ‎06-05-2013

Re: Bug? TCL: config_interface

Jump to solution

@jesko What happens is you must use the Tcl eval command to evaluate the command line with the Tcl variable as part of the
command.

 

eval config_interface $axi_addr.

 

 

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
4,816 Views
Registered: ‎09-25-2015

Re: Bug? TCL: config_interface

Jump to solution

@prathamEven if this works, what is the difference to for example the "open_project" command?

There it is no problem to write

 

set proj_name       AFAProcessHW

open_project $proj_name

0 Kudos
Scholar pratham
Scholar
4,810 Views
Registered: ‎06-05-2013

Re: Bug? TCL: config_interface

Jump to solution

@jesko That's because you are not passing any arguments. In an example which is failing you are passing two arguments (

-m_axi_offset off -register_io off

) and when arguments are passed through a variable you must use eval.

 

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
4,803 Views
Registered: ‎09-25-2015

Re: Bug? TCL: config_interface

Jump to solution

@pratham

What else if not a parameter is the name ???

 

open_project $proj_name

0 Kudos
Scholar pratham
Scholar
4,799 Views
Registered: ‎06-05-2013

Re: Bug? TCL: config_interface

Jump to solution

@jesko What do you mean? Sorry, I did not get your question.

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
4,791 Views
Registered: ‎09-25-2015

Re: Bug? TCL: config_interface

Jump to solution

@pratham

I have two commands

  1. open_project $proj_name
  2. config_interface $axi_addr

Why do they behave differently?

 

open_proj with no problems, config_interface with error ...

Thats all.

 

Regards

/Jesko

 

0 Kudos
Scholar pratham
Scholar
8,801 Views
Registered: ‎06-05-2013

Re: Bug? TCL: config_interface

Jump to solution

@jesko I think you missed my last reply.

 

When executing a Tcl command, you can use variable substitution to replace some of the command line arguments accepted or required by the Tcl command. In this case, you must use the Tcl eval command to evaluate the command line with the Tcl variable as part of the command.

http://wiki.tcl.tk/1017

 

With the TCL command config_interface $axi_addr, you are passing multiple arguments to a command config_interface using a $axi_addr variable which is not a case when you are running  open_project TCL command. 

 

I hope this helps.

-Pratham

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
----------------------------------------------------------------------------------------------
Adventurer
Adventurer
4,756 Views
Registered: ‎09-25-2015

Re: Bug? TCL: config_interface

Jump to solution

Thanks to your link I found the right answer:

 

Cite:

set a $b

Prior to invoking set, Tcl performs its substitutions, so the command becomes

set a {the total is $20}

so if I have only one parameter, this is evaluated correctly, if I have more it fails, because all parameters are seen as a single one through the angel braces.

 

Thanks again!

0 Kudos