XSIM usage from outside XDE

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

XSIM usage from outside XDE

Post by octal »

Hello,
I just wanted to know if there were any possibility to use XSIM from outside the Eclipse IDE?
Is there any API or documented way to got XSIM load a bin file, trace and do program steping and got feedback from the simulator directly (from outside the Eclipse ide)?

The idea is that I'm going to make a visual dev tool (using flowcharting like technique), and I found all the doc for command line compiler to compile and link the generated program, but I want also to offer the possibility to run final program in the simulator. Have I to use XSim for that or GDB?

Regards


User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Post by kris »

Hi Octal

Yep, xsim can be run from the command line.

Run 'xsim --help' or see the command line tools -> xsim chapter of the tools user guide
(https://www.xmos.com/download/public/To ... 0.4%29.pdf)
for more details.

Hope this helps,
Cheers,
Kris.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

Hello Kris,
thank for your answer, I already saw that. But the problem is how to control the simulator?
is there any API (like on GDB) to ask the simulator to dump for example memory vars, pins state, ... to advance one step ...

On most simulator there is a socket api to control them and exchange messages with them from a host program. I want to be able to launch the simulator from my program and manipulate it through my program.

Regards
User avatar
kris
Experienced Member
Posts: 84
Joined: Mon Jan 18, 2010 2:52 pm

Post by kris »

Hi Octal,

Xsim is really just a simple front end for the simulator which allows a single program to be run in a non-interactive mode, until completion. The only way to configure it is via the command line options, and it has built in support for tracing,statistics, etc. However, if you want to be able to work interactively (i.e. single step), then xgdb can be used as the front end (the 'connect -s' command will set the target to be the simulator).

We also release the simulator in dll form, the intention being that it can then be integrated into a larger simualtion environment/testbenches. There are some more details of this in the following thread: https://www.xcore.com/forum/viewtopic.php?f=26&t=635. Maybe this is closer to what you require?

Cheers,
Kris.
ale500
Respected Member
Posts: 259
Joined: Thu Sep 16, 2010 9:15 am

Post by ale500 »

The simulator outputs a very detailed trace file (if asked to). There you can see how memory/registers changed their value according to instructions. The output of sigmnals to pins sounds intriging. I'll have to dig into it too.
User avatar
octal
XCore Addict
Posts: 228
Joined: Thu Jan 27, 2011 3:30 pm
Location: Argenteuil - France

Post by octal »

Hello ale500,
I need to use XGDB. XSim is not the solution for me. I dont need to analyze final result of trace files, I need to interactively walk through the program step by step, and be able to dum variables values and pins states. This cannot be done in XSim as it does not seem to be done for such things (statistics and traces cannot be analyzed until the program stops).
User avatar
paul
XCore Addict
Posts: 169
Joined: Fri Jan 08, 2010 12:13 am

Post by paul »

You can connect to the simulator using xgdb. I don't know off the top of my head how to do this in the command line, but from the XDE you can create a debug run configuration (by using the menu on the button with a picture of an insect/bug on it) which uses the simulator rather than hardware.

Hope that helps...
Paul

On two occasions I have been asked, 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.