Changes between Version 22 and Version 23 of QuickStartSoclib


Ignore:
Timestamp:
Feb 17, 2010, 8:16:35 PM (14 years ago)
Author:
becoulet
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • QuickStartSoclib

    v22 v23  
    11= MutekH quick start guide for SoCLib platform =
    22
    3 This guide explain how to run MutekH on a [wiki:Arch/Soclib SoCLib] hardware simulator. This is allow easy experimentation with advanced multi-processor programming.
     3SoCLib simulator allow easy experimentation with advanced multi-processor programming.
     4
     5This guide explains how to run MutekH on a [wiki:Arch/Soclib SoCLib] hardware simulator with native processor heterogeneity support.
     6
     7The SoCLib simulator used here is easy to use but has a complex internal design due to dynamic processors model instanciation.
     8This is really convenient if you want to experiment with different processors without modifying the simulator. This simulator allows processor heterogeneity.
     9
     10If you are interested in learning SoCLib hardware simulator, or plan to use SoCLib to model your own platform, you have better reading the [wiki:Arch/Soclib/Tutorial MutekH/SocCLib tutorial] first.
    411
    512You are '''highly encouraged''' to first follow the [wiki:QuickStartUnix MutekH as Unix process quick start guide] which introduce more basic concepts.
    6 
    7 MutekH for SoCLib can be compiled for Mips, Arm, PowerPC processors. Other processors are available with different platforms.
    813
    914== The SoCLib platform ==
     
    1318other relationships between the large set of available configuration tokens.
    1419
    15 The example below explains how to setup a SoCLib hardware simulator with 4 RISC processor (Mips, Arm or PowerPC).
    16 
    17 [[BR]][[BR]][[Image(arch_4proc.gif,nolink)]][[BR]][[BR]]
    18 
    1920=== Getting SoCLib ===
    2021
    21 We now need to have a working SoCLib install. SoCLib installation is explained here: https://www.soclib.fr/trac/dev/wiki/InstallationNotes
     22We now need to have a working SoCLib install. SoCLib installation is explained here: soclib:InstallationNotes
     23
     24Moreover, you'll need the MutekH source tree and its prerequisites. See InstallationNotes
    2225
    2326=== SoCLib platform description ===
     
    3134
    3235{{{
    33 svn co -r 1024 https://www-asim.lip6.fr/svn/mutekh/trunk/mutekh
     36svn co https://www-asim.lip6.fr/svn/mutekh/trunk/mutekh
    3437}}}
    3538
    3639=== Writing the example source code ===
    3740
    38 Note: This example is available directly from {{{examples/hello}}} directory in source tree: [source:trunk/mutekh/examples/hello]
     41Note: This example is available directly from {{{examples/hello_het}}} directory in source tree: [source:trunk/mutekh/examples/hello_het]
     42
     43What you need to do:
    3944
    4045 - Writing the source code in `hello.c`
    41 {{{
    42 #include <pthread.h>
    43 
    44 pthread_mutex_t m;
    45 pthread_t a, b;
    46 
    47 void *f(void *param)
    48 {
    49   while (1)
    50     {
    51       pthread_mutex_lock(&m);
    52       printf("(%i) %s", cpu_id(), param);
    53       pthread_mutex_unlock(&m);
    54       pthread_yield();
    55     }
    56 }
    57 int main()
    58 {
    59   pthread_mutex_init(&m, NULL);
    60   pthread_create(&a, NULL, f, "Hello ");
    61   pthread_create(&b, NULL, f, "World\n");
    62 }
    63 }}}
    64 
    6546 - Writing the `Makefile`
    66 {{{
    67 objs = hello.o
    68 }}}
     47 - Writing the `platform-mips+arm.dts` to describe hardware, see [FlattenedDeviceTree Flattened device trees].
    6948
    7049=== Getting the cross-compilers ===
     
    7453 $ tools/crossgen.mk
    7554 $ tools/crossgen.mk all TARGET=mipsel-unknown-elf
     55 $ tools/crossgen.mk all TARGET=arm-unknown-elf
    7656}}}
    7757
    7858=== Writing the MutekH configuration ===
    7959
    80 The MutekH configuration for the 4 Mips processors platform is in the [source:trunk/mutekh/examples/hello/config_soclib_mipsel] file.
     60The MutekH configuration for heterogeneous Mips/Arm processors platform is in the [source:trunk/mutekh/examples/hello_het/config] file.
    8161
    8262Have a look to the BuildSystem page for more information about configuration system and configuration file format.
     
    8767The MutekH software uses hardware enumeration to get details about available hardware in the platform, so the `CONFIG_ARCH_DEVICE_TREE` token is defined in the configuration file. It will let the kernel get the platform layout description from a FlattenedDeviceTree which will be built-in.
    8868
    89 Therefore, we have to provide the platform description FlattenedDeviceTree and add it to the Makefile to have it compiled in.
    90 The `hello/Makefile` file must contain:
     69=== Compiling the application along with MutekH ===
    9170
    9271{{{
    93 objs = hello.o platform-mips.o
    94 }}}
    95 
    96 The current FlattenedDeviceTree source file is [source:trunk/mutekh/examples/hello/platform-mips.dts].
    97 
    98 === Compiling the application along with MutekH ===
    99 
    100 The MutekH kernel and the application may be built out of the source tree.
    101 
    102 Change to the SoCLib platform directory and apply the following steps to experiment
    103 with out of tree compilation. You have to setup the following variables:
    104 
    105  `MUTEKH_DIR`::
    106    Path to MutekH source tree
    107  `APP`::
    108    Path to application source
    109  `CONFIG`::
    110    MutekH configuration file name
    111 
    112 {{{
    113 $ cd soclib/soclib/platform/topcells/caba-vgmn-mutekh_tutorial
    114 $ make MUTEKH_DIR=~/mutekh/ APP=~/mutekh/examples/hello CONFIG=config_soclib_mipsel all
     72$ cd path/to/mutekh
     73$ make kernel-het CONF=examples/hello_het/config BUILD=arm:mipsel
    11574}}}
    11675
    11776This will build the MutekH kernel along with the application.
    118 You can still build MutekH separately as explained in the first part. The simulator can then be built using:
     77The simulator can then be built using:
    11978
    12079{{{
    121 $ cd soclib/soclib/platform/topcells/caba-vgmn-mutekh_tutorial
     80$ cd path/to/soclib/soclib/platform/topcells/caba-vgmn-mutekh_tutorial
    12281$ make system.x
    12382}}}
     
    12786The simulator needs the MutekH executable file name and the processor type and the number of processors of this type:
    12887{{{
    129 $ ./system.x mutekh/kernel-soclib-mips.out:mips32:4
     88$ cd path/to/soclib/soclib/platform/topcells/caba-vgmn-mutekh_tutorial
     89$ ./system.x mips32el:2 path/to/mutekh/kernel-mipsel.het.out arm:2 path/to/mutekh/kernel-arm.het.out
    13090}}}
    13191