blob: 2fff68040386950697c30512d45d6f30100f7fd6 [file] [log] [blame]
/*
* Copyright 2008 Sony Corporation of America
*
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
MARS Samples README
Overview
========
The MARS samples are a collection of various applications written using the
MARS (Multicore Application Runtime System) library. They are provided to show
the basic usage of the MARS API.
The samples provided are explained briefly below. More specific details and
explanations about each sample program are displayed when running the samples.
/samples
|
|---/barrier Basic usage of the MARS task barrier
| synchronization between the host program and
| multiple MPU programs.
|
|---/compare Compares the performance of running multiple
| task contexts between libspe and libmars. This
| sample aims to show the high cost of libspe's
| context switching.
|
|---/event_flag Basic usage of the MARS task event flag
| synchronization between the host program and
| multiple MPU programs.
|
|---/exit_code A simple example of scheduling MARS tasks and
| checking the exit code after waiting for its
| completion.
|
|---/grayscale A grayscale image conversion program that uses
| multiple MARS tasks and MARS task
| synchronization methods to do conversion of an
| input image and output the resulting grayscale
| image to a file.
|
|---/hello A simple example to show how to execute a task
| that prints "Hello". This sample is the most
| basic of all samples.
|
|---/host_callback A simple example to show how to execute a task
| that calls a host callback function.
|
|---/mandelbrot A mandelbrot program that uses multiple MARS
| tasks to do computations for each frame and
| displays the output on to the screen using the
| frame buffer.
|
|---/partial_context_save A simple example to show how to create and
| execute a task that does context switches
| optimized by specifying partial context save
| paramters during task creation.
|
|---/priority A simple example of how various priorities can
| be assigned to different MARS tasks to give them
| greater or lower priorities during task
| scheduling.
|
|---/queue Basic usage of the MARS task queue
| synchronization to show how you can communicate
| data between the host and MARS task efficiently.
|
|---/schedule A simple example of how various MARS tasks can
| be scheduled for execution from both the host or
| from other MARS tasks.
|
|---/semaphore Basic usage of the MARS task semaphore
| synchronization to show how you can protect a
| shared resource from being accessed by multiple
| MPU programs.
|
|---/shared_context A simple example of how to create and use a
| shared MARS context.
|
|---/signal Basic usage of the MARS task signal
| synchronization between the host-processor main
| program and multiple MPU programs.
|
|---/unschedule A simple example of how MARS tasks can be
| unscheduled from execution from both the host or
| from other MARS tasks.
|
|---/workload_module A simple example of how to create a custom
| workload module.
|
|---/yield A simple example of how MARS tasks can yield the
execution right of the MPU program to let other
MPU programs execute on the MPU.
Building
========
To build all the samples, run ./make from the top-level directory.
To build each individual sample, run ./make in each sample directory.
The build supports both native and cross compiling.
Make sure MARS is installed in the standard paths.
If MARS is not installed in the standard paths, you must modify the config.mk
file accordingly.
[mars-samples]$ make
If you have both the 32-bit and 64-bit MARS libraries installed on your
system, you can specify CFLAGS to build either 32-bit or 64-bit samples.
For 32-bit samples:
[mars-samples]$ make CFLAGS=-m32
For 64-bit samples:
[mars-samples]$ make CFLAGS=-m64
Running
=======
Running the samples is just a matter of executing the host program on the
target platform.
The host programs will be created in each sample's directory when compiling
is complete.
Make sure you run the host program and not the MPU programs that are created
in the sample directories.