01-22-2019 04:31 AM
I am using chipscope ILA for record data and then analyze it using python.
I need to use hw_ila_data window with more than 5 signals (due to trigger option) but i want to export just one of them alone to CSV file.
When i use write_hw_ila_data as describes in UG385 , i didn't see any option to specify the signal i want to export, this TCL command export the whole ila_data_hw window.
Is there any suggestion for me to export a specific signal from the ILA to EXCEL?
01-22-2019 05:45 AM
itamare@foresight "I need to use hw_ila_data window with more than 5 signals (due to trigger option) but i want to export just one of them alone to CSV file."
I don't know of any way to export just a single signal using write_hw_ila_data.
However, the CSV format is straightforward to parse to extract a given column of data; although I haven't done this in python, I posted a Matlab/Octave code snippet using textscan() a while back:
A search on github turned up the following python I2C ILA parser code, which looks like a good starting point; although it is presently written to extract I2C transactions, the I2cParser() class looks easy to modify to extract a given column by name as binary or hex data:
01-22-2019 05:58 AM
thank you brian
i thought to use the Matlab textscan function as you mentioned but i have met a problem with the EXCEL raw data when using Hexadecimal format.
what i mean is the conversion of hex number which include E digit , to something like +E0... - for instance : hex value of 0123E0000 will be converted by EXCEL to 0123E+02...., any of cell format option provided by EXCEL didn't help me.
so i need to open the ILA exported EXCEL file with text editor and cut the wanted data
do you have any suggestion?
01-22-2019 07:36 AM - edited 01-22-2019 07:57 AM
itamare@foresight "any of cell format option provided by EXCEL didn't help me. <snip> do you have any suggestion?"
I don't use Excel for this sort of processing; it will mangle hex and binary fields.
The following Perl one-liner will extract the fourth column (#3, as indexed from 0) of an ILA csv into another text file:
perl -nlaF/,/ -e "print\"$F\"" ila_data_file.csv > column.txt
Note that this script doesn't strip the title header found in the first line.
Note that the above command line quoting works for a Windows command shell; on linux it would be something like this:
perl -nlaF/,/ -e 'print"$F"' ila_data_file.csv > column.txt