Parallella Chronicles Part Three: “Hello World”

Over the last two blogs I have provided a simple overview of the Parallella board and the software development environment. The next logical step is to create a simple application which is run on each core of the epiphany device in turn and performs a simple hello world type application.

chron3

Achieving this will ensure we understand how to:

  1. Use of the epiphany hardware abstraction layer to initialize, reset, open and load the target Epiphany device
  2. Use of basic commands within the epiphany hardware utility library
  3. Develop a build script to create the host & target ELF executables
  4. Develop a run script to execute the application on the host and target.

Assuming you have the eSDK correctly installed the first step it to create two directories within your chosen development directory mine I created under “/home/linaro/adams_parallella/chronicles_3” these directories should are called Debug and Src. Within the Src directory we will store the application source code for the host and target (epiphany).  The Debug folder is where the build process will store the resultant ELF.

The application will use the shared DRAM memory to communicate between the host and target application. At a predefined memory location known to both applications the target application will write a string using the sprint function while the host application will look for, retrieve and print out that message.

The main file for this demonstration is going to be the host application this application will

  1. Initialize the system – using the e_init() function
  2. Reset the system – using the e_reset_system() function
  3. Obtain the platform information – using the e_get_platform_info() this defines the core configuration, number of devices within the system and number of external memories.
  4. Allocate the location of the shared memory used for communication
  5. Address each core in turn and retrieve its printed string. To do this the host must:
    1. Define a single core work group using e_open()
    2. Reset the workgroup using e_reset_group()
    3. Load the s record into the working group using e_load(), when doing this it will also check for the success of the operation
    4. Wait for the target to finish execute its application
    5. Read the shared memory location using e_read() to obtain the message from the target
    6. Output the message
  6. Having finally completed addressing each core the host application will then close and tidy up the epiphany and allocated memory before exiting

By comparison the epiphany target application is much simpler, it just gets the core ID for the core it is currently running upon, formats this into a string and writes it into the shared memory location.

I have created a git hub repository which contains all of the code and scripts used to create the above example.

https://github.com/ATaylorCEngFIET/Parallella-Chronicles

Previous Installments

http://www.parallella.org/parallella-chronicles-part-two-2/

http://www.parallella.org/parallella-chronicles-part-one-2/

6 Comments

Leave a Reply