Embecosm ESP1 patch: embecosm-esp1_patch_reentrant_20090326.bz2
> svn co http://opencores.org/ocsvn/or1k/or1k/tags/rel-0-3-0/or1ksimEnter the directory and apply the patch:
> cd or1ksim > bzcat -dc ../or1ksim_patch_reentrant_0.3.0_20090326.bz2 | patch -p1From the main directory build the simulator as described here.
> mkdir builddir_or1ksim > cd builddir_or1ksim > ../or1ksim/configure --target=or32-uclinux --prefix=/opt/or1ksim > make allYou may install it globally, but that is not necessary for testing. The building process was tested with Ubuntu 8.10 and gcc 4.3.
#include "or1ksim.h" .. or1ksim *sim = or1ksim_instance()Your instance is automatically registered globally during or1ksim_init()(for book-keeping, might be used in future).
Finally I tested the library patch with the vmlinux binary, that I created as described here. I applied these changes to the sim.cfg. Create the directory under the main directory:
> mkdir or1ksim_simpletest > cd or1ksim_simpletestAdd the example file main.c:
#include "or1ksim.h" #includeFinally compile this simple test:int main() { or1ksim* sim1 = or1ksim_instance(); or1ksim* sim2 = or1ksim_instance(); or1ksim_init( sim1, "sim.cfg", "vmlinux", NULL, NULL, NULL ); or1ksim_init( sim2, "sim.cfg", "vmlinux", NULL, NULL, NULL ); double dt = 1.0 / (double) or1ksim_clock_rate( sim1 );; while ( 1 ) { or1ksim_run( sim1, dt ); or1ksim_run( sim2, dt ); } return 0; }
> gcc -o simple_test -I../or1ksim/ -lsim -L../builddir_or1ksim/.libs main.cExecute it:
> LD_LIBRARY_PATH=../builddir_or1ksim/.libs ./simple_testIf vmlinux is present and everything worked out fine until now, two xterm windows will open booting linux on two simulator instances.
The fact, that no segmentation faults appear and both linux boot seems good, but since both instances now run synchronously it is thinkable that they do not interfere negatively. To put more stress on the check whether I missed a global variable (that is pretty unlikely thanks to objdump and eclipse) I also put the code in threads and ran five threads in parallel. Also here, all instances booted.
Apparently this is very trivial, further testing is required. I hope, you can contribute to this, since I am still at the start of the understanding of or1ksim.
Future work involves the setup of MPSoC environments.
Last update: March 26, 2009, Stefan Wallentowitz