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: 
Voyager
Voyager
4,246 Views
Registered: ‎04-10-2012

Logging Vivado debugger values to file

I have a situation that I would think would be common, but I can't seem to find how to do it (which might mean it can't be done).  I am trying to log a counter's value (just before it gets reset) so that I plot a histogram offline of the data.  I thought that there would be a way to do this via JTAG and the debugger in VIvado 2015.4, but I can't seem to figure it out.  I know when the reset of the counter is going to occur (I am resetting it), so I can create an enable for when I want to capture the data if that helps.

 

Is there any way to pull this off so that I can set it up and let it run for an hour, logging all the way?

0 Kudos
8 Replies
Explorer
Explorer
4,241 Views
Registered: ‎07-18-2011

Re: Logging Vivado debugger values to file

Hi @garengllc,

 

I can think of a couple ways to accomplish this over JTAG. 

 

As you suggested, one way is with the Vivado debugger. Take a look at the section "Saving and Restoring Captured Data from the ILA Core" in the Vivado Programming and Debugging Users Guide (UG908).

 

Another idea is to instantiate a Virtual I/O core in your design that has access to the signals that you're interested in. You can then write a Tcl script to read the values and write them to a file. You can find the VIO core in Vivado's IP library. Also, if you have a lot of data you can FIFO it in your design and then use a VIO core to read from the FIFO.

 

Regards,

David

 

 

0 Kudos
Voyager
Voyager
4,238 Views
Registered: ‎04-10-2012

Re: Logging Vivado debugger values to file

@david.hoffman, thanks for jumping in!

 

I actually was investigating the VIO, but I couldn't find any documentation on how to periodically write the value to a log automatically (meaning on an enable or triggger).  The counter will only be resetting once a second, so it won't be very fast data changes, but I would like to log for numerous hours.

0 Kudos
Explorer
Explorer
4,232 Views
Registered: ‎07-18-2011

Re: Logging Vivado debugger values to file

@garengllc

 

Based on your requirements I think using the ILA is the better solution (as opposed to the VIO).

 

Set up your ILA to sample/capture the counter only when enable is asserted (just prior to reset). Dump the resulting counter samples to file when the ILA buffer is full. If you've got enough spare block ram in your device you might be able to do it all in one shot.

 

Regards,

David

 

Voyager
Voyager
4,226 Views
Registered: ‎04-10-2012

Re: Logging Vivado debugger values to file

@david.hoffman,

 

OK, thanks.  I'll give that a shot and report back.

0 Kudos
Voyager
Voyager
4,211 Views
Registered: ‎04-10-2012

Re: Logging Vivado debugger values to file

@david.hoffman

I have the ILA working to trigger and I see where they hid the auto re-trigger in Vivado (I hadn't used it since the chipscope days), but I don't see how to "Dump the resulting counter samples to file when the ILA buffer is full."  I assume that this is the tcl command that you talked about previously?

 

I am guessing that I maybe need to do something like:

run_hw_ila hw_ila_1

write_hw_ila_data -csv_file ~/design1_ila_data [current_hw_ila_data]

 

in a TCL while loop (if there is such a thing)?

0 Kudos
Explorer
Explorer
4,206 Views
Registered: ‎07-18-2011

Re: Logging Vivado debugger values to file

@garengllc

 

I think you might also need to use wait_on_hw_ila, so something like this:

 

 

for {set i 0} {$i < 10} {incr i} {
    run_hw_ila hw_ila_1
wait_on_hw_ila hw_ila_1 write_hw_ila_data -csv_file ~/design1_ila_data_$i [current_hw_ila_data] }

 

 

Note that the loop variable 'i' is appended to the end of the file name so that you don't overwrite the data from the previous iteration.

 

I don't currently have a design with an ILA so I can't try this right now, but if this doesn't work just let me know.

 

Regards,

David

 

 

0 Kudos
Voyager
Voyager
4,197 Views
Registered: ‎04-10-2012

Re: Logging Vivado debugger values to file

@david.hoffman

 

Awesome, thanks!  I had to make a change to absolute path as it seemed to be complaining about that.

 

I then added the line:

set_property CONTROL.DATA_DEPTH 1 [get_hw_ilas -of_objects [get_hw_devices xc7k410t_0] -filter {CELL_NAME=~"u_ila_0"}]

to the beginning of the file to make sure I only get one value on each capture, but that doesn't seem to be working.  Is there something else I need to do to get only one clock's worth of data on each capture?

 

Also, I don't suppose I could append all the data to one file instead of making new ones could I?

 

Thanks again!

0 Kudos
Explorer
Explorer
4,193 Views
Registered: ‎07-18-2011

Re: Logging Vivado debugger values to file

@garengllc

 

Sorry I must have been unclear. I didn't mean for you to make every capture have just one sample/value. Rather, I was suggesting to only sample data for the capture when the enable signal is asserted (once a second or whatever its period is). Every capture will still contain hundreds or thousands of samples (depending on the depth of the ILA's buffer) but each sample will only be counter values at the times you care about. You can do this using the 'capture control' feature; it's discussed in the users guide I referenced earlier.

 

Your favorite Internet search tool can tell you "how to concatenate files in Tcl". ;)

 

Regards,

David

 

 

 

 

0 Kudos