Timing Analysis using XTA or ASM

Technical questions regarding the XTC tools and programming with XMOS.
DemoniacMilk
XCore Addict
Posts: 191
Joined: Tue Jul 05, 2016 2:19 pm

Timing Analysis using XTA or ASM

Post by DemoniacMilk »

I have an I/O process that is limited in its speed/clock frequency due to the CPU response time (want to react to an event within half a clock cycle).
Through testing different clock dividers, I was able to find out that the I/O operations run fine at 8,3 MHz and fail at 10 MHz port Clock on a tile with less than 5 cores being occupied.

Just trying different speeds and havin a look at the result is not a very scientific approach. I would like to back up the measured values with some theoretical thoughts.

To do this, I wanted to check the assembly code generated for my software and count the number of instructions from an event occuring to a certain operation. There are some topics telling me to go to 'Run -> time as -> xCore Application', what seems to not exist. I was not able to find any asm version of my code.

As an alternative approach, I downloaded the asm examples and checked app_asm_event_port_clocked, but that did not really help me.

The final approach was to use XTA, but the code section I would like to check is one path of an event and XTA seems to not be able to help me on that.

Where can I find the assembler code generated for my program and what approach would you think is suitable to estimate the time/instructions needed?


User avatar
johned
XCore Addict
Posts: 185
Joined: Tue Mar 26, 2013 12:10 pm

Post by johned »

Our compiler uses a slight variant of the gcc command line options.
To generate an asm source code listing you can use the following command :
xcc -O3 -S %1.xc XEF216-512-TQ128-C20.xn

Also, have you checked out the XTA app notes at the bottom of this page ? : http://www.xmos.com/support/examples
"AN10104: How to use the XTA to time a loop" might be useful.

Best regards,
John
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am

Post by infiniteimprobability »

what approach would you think is suitable to estimate the time/instructions needed?
Some other ideas:

- This link has a general discussion about ways to measure performance http://www.xcore.com/forum/viewtopic.ph ... iming+ways

- You can also disassemble the whole app with mixed source/ASM using:

Code: Select all

xobjdump -S <my_bin_file.xe>
Instruction counting *can* work but you have to be careful of FNOPS which happen when you get bus contention (instruction fetch vs data access). Rather than using pragmas in your code and have to account for the loops etc., you can select your functions in XTA and right click -> trace in console. This will simulate and take account of any FNOPS and give you the real (and guarranteed) cycle count.