How to analyze a code portion with XTA (Defining routes)

Technical questions regarding the XTC tools and programming with XMOS.
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Thanks for the screen shots. Unfortunately, it looks like it is fundamentally an issue with XTA not supporting interface calls. I will see whether there is a work-around or a script that can be created to make this easier.

In the mean-time, in order to time functions with memcpy in them you can add a local version of memcpy to your code by redefining memcpy:

Code: Select all

// Create local version of memcpy
#undef memcpy
#define memcpy(a,b,c) local_memcpy(a,b,c)
extern void * unsafe local_memcpy(void * unsafe dest, void * unsafe src, int len);
And include the attached source for memcpy. That should allow you to time code with memcpy calls.


mozcelikors
Experienced Member
Posts: 75
Joined: Sat May 07, 2016 11:47 am

Post by mozcelikors »

Hi again,

Unfortunately the problem with memcpy continues (also memset)

Code: Select all

     12032.0: ( 16.0ns) 0x480de memcpy + 6             bau (1r)     r11          [UNRESOLVED]
Regards
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

It doesn't look like you are actually using the local_memcpy definition. It shouldn't be calling the 'memcpy' function because the should have been re-defined with the #undef / #define. The code that should be called is the one it looks like I failed to attach last time (I had failed to notice that it didn't want to attach a .S file. Rename the .txt to a .S).

So, make sure that the #undef / #define are affecting the code you are trying to time, and include the local_memcpy code.
You do not have the required permissions to view the files attached to this post.
Last edited by peter on Fri Jan 13, 2017 3:39 pm, edited 1 time in total.
Reason: Adding attachment
mozcelikors
Experienced Member
Posts: 75
Joined: Sat May 07, 2016 11:47 am

Post by mozcelikors »

I have attached a screenshot. Would this be an error related to .S file or inclusion error?
Image

Code: Select all

In file included from /home/mozcelikors/XTimeComposerWorkspace3/lib_ethernet/src/mii_buffering.c:4:
In file included from /home/mozcelikors/XTimeComposerWorkspace3/lib_logging/lib_logging/api/debug_print.h:74:
.././src/local_memcpy.S:1:1: error: expected identifier or '('
.text
^
.././src/local_memcpy.S:21:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
memcpy_bytewise:
^
.././src/local_memcpy.S:21:16: error: expected ';' after top level declarator
memcpy_bytewise:
               ^
               ;
.././src/local_memcpy.S:22:3: error: expected identifier or '('
  { sub r1, r1, 1 ; bru r2 }
  ^
.././src/local_memcpy.S:39:3: error: unknown type name 'st8'
  st8 r11, r0[r2]
  ^
.././src/local_memcpy.S:39:15: error: use of undeclared identifier 'r2'
  st8 r11, r0[r2]
              ^
.././src/local_memcpy.S:39:18: error: expected ';' after top level declarator
  st8 r11, r0[r2]
                 ^