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: 
Scholar embedded
Scholar
3,862 Views
Registered: ‎06-09-2011

Export ILA captured Data in Vivado2014.4 as a Text file

Hi all,

I have searched this topic in the forum and I know there has been some solutions using tcl command: write_hw_ila_data.

As all other folks pointed out, the problem is that this format - csv- needs some extra work to convert to some useful data that can be easily read by Matlab. I am wondering why Xilinx have discontinued the support of .prn file in Vivado a great fantastic file format which was easily readable by Matlab. When I open that generated file I see that its data has been rounded by Excel tool:

Exported.jpg

 

Besides, the whole trig data is exported as a column. But, I need to have separate signals just like what I have separated them in ILA.

Thanks in advance,

Hossein

3 Replies
Scholar brimdavis
Scholar
3,839 Views
Registered: ‎04-26-2012

Re: Export ILA captured Data in Vivado2014.4 as a Text file

@embedded "When I open that generated file I see that its data has been rounded by Excel tool:"

 

My recollection is that the output format is a simple csv file with a header, using binary strings for the data fields- your 'rounding' is just Excel interpreting the binary string as a big decimal number, take a look at the file with a text editor instead.

 

The format is easy to parse in Matlab or octave, IIRC I used the textscan command; just a few lines of code will read all the data into a cell array, then you have to convert the binary strings to the proper Matlab datatype (don't have an example at hand here at home, but I've done this from scratch a couple times as needed)

 

-Brian

Scholar embedded
Scholar
3,815 Views
Registered: ‎06-09-2011

Re: Export ILA captured Data in Vivado2014.4 as a Text file

Hi @brimdavis,

 

Regarding your explanation about Excel I agree with you. I know that there would a way of extracting data from this text string as well. I am wondering why Xilinx decided to remove that nice, easy to use feature - saving bus plot data - in new ILA.

The main big question in my mind is that why Xilinx have removed many nice features in Vivado?!.

You maybe agree with me that this format needs more work to do in Matlab in comparison to previous one.

 

 

Thanks for your comment,

Hossein

0 Kudos
Highlighted
Scholar brimdavis
Scholar
3,765 Views
Registered: ‎04-26-2012

Re: Export ILA captured Data in Vivado2014.4 as a Text file

@embedded "You maybe agree with me that this format needs more work to do in Matlab in comparison to previous one."

 

Yes, I would agree that Vivado provides less functionality in this area than did ISE.

 

For your data format, the file parsing would probably look something like this (this untested!!! example uses two data fields to show cell array indexing):

%
% untested rough outline of Matlab parser code for reading ILA .csv output format saved with:
%    write_hw_ila_data -force -csv_file ila_data_file.csv hw_ila_data_1
%
fid=fopen('ila_data_file.csv');

% format skips first three fields, reads next two fields as strings
alldat=textscan(fid,'%*f %*f %*f %s %s',  'delimiter', ',' , 'HeaderLines',1);

% convert binary strings to arrays of unsigned integer values, note curly braces for cell indexing
data_a = bin2dec(alldat{1});
data_b = bin2dec(alldat{2});

% would then need to do any two's complement conversion or normalization as needed

-Brian

Tags (1)