cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
15,375 Views
Registered: ‎03-21-2013

Tcl 'for' loop : issues with radix (Error 20-1474)

This is a followup on this question

 

http://forums.xilinx.com/t5/Vivado-TCL-Community/Automating-VIO-interaction-using-TCL-in-Vivado-2014-1/td-p/466740

 

Issue

 

I want to run a loop in tcl and use the loop variable as an argument in the 'set_property' command. However I keep getting an error which I have searched for, but cant figure out yet.

 

Code I use

 

for {set i 0} {$i < 2} {incr i} {

set vio_output $i

set_property OUTPUT_VALUE $vio_output [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]

 

}

 

The shell gives me this error

 

ERROR: [Designutils 20-1474] The hw_probe VIO value [0] has [1] value characters. The required number of value characters for radix [HEX], is [2].

 

 

Addendum 

 

I understand the error, but I dont know how to solve it. I was under the impression that TCL uses strings to represent everything and there inherently should not be a concept of a radix. 

 

Please note that 

set_property OUTPUT_VALUE 02 [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]

OR 

set_property OUTPUT_VALUE 50 [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]

 

works fine.

Tags (4)
0 Kudos
10 Replies
Highlighted
Xilinx Employee
Xilinx Employee
15,369 Views
Registered: ‎04-16-2012

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hi,

 

The issue is occuring because the output_value is set to hexadecimal.

You can change radix to binary, octal,...

See the page no. 78 of the following user guide: http://www.xilinx.com/support/documentation/sw_manuals/xilinx2014_1/ug908-vivado-programming-debugging.pdf

 

Thanks,

Vinay

--------------------------------------------------------------------------------------------
Have you tried typing your question in Google? If not you should before posting. Also, MARK this is as an answer in case it helped resolve your query/issue.Give kudos to the post that helped you to find the solution.
0 Kudos
Highlighted
Visitor
Visitor
15,345 Views
Registered: ‎03-21-2013

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hello Vinay,

 

Yes, I understood that the issue is the radix, But I want to keep the hexadecimal radix, so I have to figure out a way to generate 'hex' values in the loop itself which feeds the set_property command. 

 

Thanks,

Dip

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
15,343 Views
Registered: ‎04-16-2012

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hi,

Try changing the i value to hexadecimal using the below command:

format %x $i

Thanks,
Vinay
--------------------------------------------------------------------------------------------
Have you tried typing your question in Google? If not you should before posting. Also, MARK this is as an answer in case it helped resolve your query/issue.Give kudos to the post that helped you to find the solution.
0 Kudos
Highlighted
Visitor
Visitor
15,341 Views
Registered: ‎03-21-2013

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hello Vinay,

 

Thanks again for the prompt response. I read up on the format command, and realized what it does.  However, when I am doing this :

 

for {set t 0} {$t < 5} {incr t} {

set_property OUTPUT_VALUE [format %x $t] [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]

}

 

 

 

I keep getting the same error. I have tried several variations of this, including something like 

 

 

set dummy [format %x $i]
set_property OUTPUT_VALUE $dummy [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]

 

 

but i still keep getting the same error. Any ideas on why ?

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
15,338 Views
Registered: ‎04-16-2012

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hi,

Try this:

for {set t 0} {$t < 5} {incr t} {
format %x $t
set_property OUTPUT_VALUE [format %x $t] [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]
}

Thanks,
Vinay
--------------------------------------------------------------------------------------------
Have you tried typing your question in Google? If not you should before posting. Also, MARK this is as an answer in case it helped resolve your query/issue.Give kudos to the post that helped you to find the solution.
0 Kudos
Highlighted
Visitor
Visitor
15,335 Views
Registered: ‎03-21-2013

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Same issue persists. I have also tried 

 

for {set z [format %x 0]} {$z < [format %x 5]} {incr z} {
format %x $z
set_property OUTPUT_VALUE [format %x $z] [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]
}

 but to no avail

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
15,332 Views
Registered: ‎04-16-2012

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hi,

Typo mistake. Try this:

for {set t 0} {$t < 5} {incr t} {
set i [format %x $t]

set m $i
set_property OUTPUT_VALUE $m [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]
}

Thanks,
Vinay

--------------------------------------------------------------------------------------------
Have you tried typing your question in Google? If not you should before posting. Also, MARK this is as an answer in case it helped resolve your query/issue.Give kudos to the post that helped you to find the solution.
0 Kudos
Highlighted
Visitor
Visitor
15,326 Views
Registered: ‎03-21-2013

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

Hello,

 

It looks like you are setting variable i as a hex format of . That is similar to what I have been trying. 

Then you set another variable as . I did not really understand what is gained by this extra variable assignment.

 

Anyways, I tried the same and this is what my log looks like

 

# set fp [ open vio_data.dat w+ ]
# for {set t 0} {$t < 2} {incr t} {
#     
#    
#     set i [format %x $t]
#     set vio_output $i
#     
#     # setting VIO output to the design
#     
#     set_property OUTPUT_VALUE $vio_output [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]
#     commit_hw_vio [get_hw_probes {probe_debug_read_select} -of_objects [get_hw_vios hw_vio_2]]
# 
#     #refreshing and reading vio_inputs
#     refresh_hw_vio [get_hw_vios {hw_vio_2}]
#     set vio_input [get_property INPUT_VALUE [get_hw_probes probe_debug_read_data]]
#     
#     puts $fp "vio_select $vio_output vio_data $vio_input"
# 
# }
ERROR: [Designutils 20-1474] The hw_probe VIO value [0] has [1] value characters. The required number of value characters for radix [HEX], is [2].

    while executing
"rdi::set_property OUTPUT_VALUE 0 probe_debug_read_select"
    invoked from within
"set_property OUTPUT_VALUE $vio_output [get_hw_probes probe_debug_read_select -of_objects [get_hw_vios hw_vio_2]]"
    ("for" body line 9)
    invoked from within
"for {set t 0} {$t < 2} {incr t} {
    
   
    set i [format %x $t]
    set vio_output $i
    
    # setting VIO output to the design
    
    set_pro..."
    (file "/var/lib/jenkins/workspace/board_program/debug_vio.tcl" line 34)
INFO: [Common 17-206] Exiting Vivado at Wed Jun  4 16:22:07 2014...

 

 

0 Kudos
Highlighted
Visitor
Visitor
15,312 Views
Registered: ‎03-21-2013

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

To clarify, I still get the same error as before. This is not resolved yet.

0 Kudos
Highlighted
Guide
Guide
9,383 Views
Registered: ‎01-23-2009

Re: Tcl 'for' loop : issues with radix (Error 20-1474)

The "format" command takes C-style formatting strings.

 

The %x format says "put it in hex"

 

The %2x format says "put it in hex and use two characters", but unused leading characters will be spaces

 

The %02x format says "put it in hex and use two characters, with leading 0's to fill in the space"

 

So, if you use

 

[format %02x $i]

 

it should work.

 

Avrum

0 Kudos