Commandline Tools using XSCOPE and XTA

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Commandline Tools using XSCOPE and XTA

Post by Folknology »

As a long time command line user of Xmos tools, I tend to use a simple editor (vim), xmake, xgdb and xrun on linux and this works well for the majority of my work. However I have recently started reading about the XTA and XScope tools and would like to explore these further as they seem to offer some cool extra features form a test and simulation POV. Is it therefore possible to use these tools from the command line rather than just within xTIMEcomposer? Also is it possible to use these tools programatically via python scripting or similar, are there documented interfaces etc..?

regards
Al


User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

Did you check xrun --help? and also xta --help.
The are certainly available on the command line.
There is problably more about it in the xTIME Composer user manual
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

Thanks Bianco that helps for XTA commands, I also found the online guide fo XTA which covers both xTIMEcomposer and command line usage which is helpful.

However the xScope manual seems completely xTIMEcomposer centric and I cannot find command line references anywhere for it. I have used the standard IO redirection which is really useful in conjunction with xrun but was looking for something a little deeper and more scope like i.e. waveforms and traces.

I am also not sure how up to date the xScope manual is as when I added things like state tracking it advised me these were depreciated in favour of 'int' probes so I am really wondering if I am just missing the right up to date docs?


P.S. xrun --help reveals some nice looking options :

Code: Select all

  --xscope                 Enable a XSCOPE server with the target
  --xscope-realtime        Enable a XSCOPE server with the target via a socket connection
  --xscope-file <filename> Specify the filename for XSCOPE data collection
  --xscope-port <ip:port>  Specify the ip address and port for realtime capture
  --xscope-limit <limit>   Specify the record limit for XSCOPE data collection
  --xscope-io-only         Specify that only i/o messages will be captured via XSCOPE
But I cannot find documentation for it, what comes across the socket or ip:port (guessing it's records) is it xml like the files? if so a schema for xmt would also come in handy

*Update I am also getting errors trying to use xta:

Code: Select all

xta 1>load ./bin/app_pedestroid.xe
xta: error: the file '/home/awood/.xmos/repos/sw_startkit_examples/app_pedestroid/bin/app_pedestroid.xe' could not be loaded: null.
xta 2>version
Version: 13.0.0beta2 (build 8439, Oct-16-2013)
xta 3>
Tried this with several files BTW (Perhaps I am missing some xta compile flags?).
I added:

Code: Select all

-fno-xta-info -g
flags to Makefile but still no joy.

I also notice that xta has a jython library (presumably for xTIMEcomposer), does it also have a python version?

regards
Al
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm
Contact:

Post by Bianco »

to do a simple trace the following will work i believe (its been a while):

xrun --io --xscope --xscope-file trace.xml myapp.xe

After running you find the XML file that you can parse using your own application.
Looks like you can also open a socket interface to do fancy stuff
User avatar
Folknology
XCore Legend
Posts: 1274
Joined: Thu Dec 10, 2009 10:20 pm
Contact:

Post by Folknology »

I have tried using :

Code: Select all

xrun --io --xscope-xscope-port 127.0.0.1:8080 bin/app_pedestroid.xe 
Then:

Code: Select all

telnet 127.0.0.1 8080
I can then get redirected stdio fine.

However when I switch to the lower level probes like :

Code: Select all

xscope_int(0,ctx.state);
My telnet just gives me the 1st state output:

Code: Select all

awood@Al:~$ telnet 127.0.0.1 8080
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.

��Statepsst
Obviously the unicode isn't being translated here by telnet/copy/paste (or is this a binary com channel?) , but more importantly it appears to be waiting for some sort of handshake or something before it sends each probe record as I am only getting a single one, any clues from the knowing?

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

Post by mozcelikors »

Hello Folknology,

Were you able to solve the following issue?

Code: Select all

xta 1>load ./bin/app_pedestroid.xe
xta: error: the file '/home/awood/.xmos/repos/sw_startkit_examples/app_pedestroid/bin/app_pedestroid.xe' could not be loaded: null.
I am having the same issue using Windows version 14.2.0 of xTimeComposer

Code: Select all

xta: error: the file 'C:\Program Files (x86)\XMOS\xTIMEcomposer\Community_14.2.0\RCCarBuild13.xe' could not be loaded: null.
xta 12>
peter
XCore Addict
Posts: 230
Joined: Wed Mar 10, 2010 12:46 pm

Post by peter »

Hi Folknology,

You can most certainly use all the tools on the command-line. I work in a similar manner, but I do find that the one place I revert to the GUI is for viewing xscope output files. For my applications I will define a config.xscope file which means that you don't need to do any registration within you application.

An example of this file is here: https://github.com/xmos/lib_startkit_su ... fig.xscope

The printing is controlled using the line:

Code: Select all

<xSCOPEconfig enabled="true" ioMode="basic">
The remaining lines control the probes which are defined by name. These names can have any capitalisation and spaces. They create defines which can be used within your code. The defines will be all caps and with '_' instead of spaces.

Code: Select all

  <Probe name="ADC0" type="CONTINUOUS" datatype="INT" units="n" enabled="true"/>
  <Probe name="ADC1" type="CONTINUOUS" datatype="INT" units="n" enabled="true"/>
  <Probe name="ADC2" type="CONTINUOUS" datatype="INT" units="n" enabled="true"/>
  <Probe name="ADC3" type="CONTINUOUS" datatype="INT" units="n" enabled="true"/>
In your application you can simply do:

Code: Select all

xscope_int(ADC0, value);
If you have a file like this in your project then you can build it without having to add any other xscope initialisation or flags to your Makefile. You can then run it with:

Code: Select all

xrun --xscope YOUR_BINARY
and it will create an xscope.xmt file which I find is best viewed using the Analyze->Offline xSCOPE view in the GUI.

The xSCOPE probes are very low overhead and so can be used in most applications to do some real profiling of what is happening from a timing perspective.

Depending on your application, you could run with

Code: Select all

xrun --xscope-port localhost:10101 YOUR_BINARY
and then in the GUI use the Analyze->Realtime xSCOPE to connect to this application (plug-like button top right). This is particularly good with things like audio signals which can be meaningfully viewed in realtime.

Hope that helps. We'll try to look into what is happening with the XTA issue soon.

Peter
robertxmos
XCore Addict
Posts: 169
Joined: Fri Oct 23, 2015 10:23 am

Post by robertxmos »

Hi Folknology,
I would be interested to look into the xta error with app_pedestroid.xe.
Is the sw_startkit_examples/app_pedestroid your code?
Could you upload it?
Robert
Post Reply