Tutorial - How to expand the on-chip memory for simulation

Technical questions regarding the XTC tools and programming with XMOS.
User avatar
johned
XCore Addict
Posts: 185
Joined: Tue Mar 26, 2013 12:10 pm

Tutorial - How to expand the on-chip memory for simulation

Post by johned »

When porting a large algorithm to XMOS from a PC application it is sometimes useful to be able to start with a large pool of memory and then optimize the memory down to the size available on a physical device.

Here is how to modify the memory of an xCORE-200 Explorer board to simulate 2 MBytes memory.

In your development folder, copy XCORE-200-EXPLORER.xn to XCORE-200-EXPLORER-2048.xn and modify line 12 :

- <Node Id="0" InPackageId="0" Type="XS2-L16A-512" OscillatorSrc="1" SystemFrequency="500MHz">
+ <Node Id="0" InPackageId="0" Type="XS2-L16A-2048" OscillatorSrc="1" SystemFrequency="500MHz">

And then in the tools configs folder, copy config_XS2-L16A-512.xml to config_XS2-L16A-2048.xml and make the following changes :

Line 8 :
- <Ram base="0x40000" size="0x40000"/>
+ <Ram base="0x100000" size="0x100000"/>

Line 13 :
- <Ram base="0x40000" size="0x40000"/>
+ <Ram base="0x100000" size="0x100000"/>

Compile hello world :

> xcc hello.xc -report XCORE-200-EXPLORER-2048.xn -o hello.xe
Constraint check for tile[0]:
Cores available: 8, used: 1 . OKAY
Timers available: 10, used: 1 . OKAY
Chanends available: 32, used: 0 . OKAY
Memory available: 1048576, used: 22304 . OKAY
(Stack: 1740, Code: 19312, Data: 1252)
Constraints checks PASSED.

> xsim hello.xe
Hello world !
You do not have the required permissions to view the files attached to this post.
User avatar
Bianco
XCore Expert
Posts: 754
Joined: Thu Dec 10, 2009 6:56 pm

Post by Bianco »

Interesting feature, thanks for sharing.
I also see an application for compiling large programs to use with an XMOS chip with external memory and on-the-fly resolving of memory access exceptions (like this)