cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor
Visitor
344 Views
Registered: ‎01-29-2019

Passing an integer variable as a parameter to an IP using tcl script

Jump to solution

Hi,

I'm trying to create a block ram IP "using the tcl script" and my code segment would look like this;

set A 32

create_ip -name blk_mem_gen -vendor xilinx.com -library ip -version 8.4 -module_name blk_mem_gen_0
set_property -dict [list CONFIG.Write_Width_A {$A} CONFIG.Write_Depth_A {1024} CONFIG.Read_Width_A {$A} ] [get_ips blk_mem_gen_0]

and when I run it I get this error

can't use non-numeric string as operand of "%"
ERROR: [IP_Flow 19-3477] Update of parameter 'PARAM_VALUE.READ_WIDTH_A' failed for IP 'blk_mem_gen_0'. can't use non-numeric string as operand of "%"
can't use non-numeric string as operand of "/"

Please help me to correct this. It seems the variable is not passed as an integer?

 

Thank you

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
313 Views
Registered: ‎03-03-2009

Re: Passing an integer variable as a parameter to an IP using tcl script

Jump to solution
2 Replies
Highlighted
Xilinx Employee
Xilinx Employee
314 Views
Registered: ‎03-03-2009

Re: Passing an integer variable as a parameter to an IP using tcl script

Jump to solution
Highlighted
Visitor
Visitor
307 Views
Registered: ‎01-29-2019

Re: Passing an integer variable as a parameter to an IP using tcl script

Jump to solution

Thank you so much. That solved the problem


@tonys wrote:

The braces disables variable subsitution. Use double quote "$A"

https://www.tcl.tk/man/tcl8.5/tutorial/Tcl4.html 

https://forums.xilinx.com/t5/Vivado-TCL-Community/Configure-generic-parameters-of-a-custom-IP-based-on-variable/m-p/843008 


 

0 Kudos