SlideShare a Scribd company logo
MULTICORE
DEVELOPMENT
ENVIRONMENT
GETTING STARTED
RELEASE 2.0 BETA 1
DOC. NO. UG204
NOVEMBER 2008
TILERA CORPORATION
COPYRIGHT: 2008
COPYRIGHT HOLDER: TILERA® CORPORATION
CREATION DATE: 2008-10-15
REV DATE: 2008-10-22
KEYWORDS: TILE64™, TILEPRO64™, TILE PROCESSOR™, TILEXPRESS-64™, TILEXPRESS-20G™
PRODUCT NAME: MULTICORE DEVELOPMENT ENVIRONMENT (MDE)
VERSION/RELEASE/MODIFICATION: 2.0/BETA/1
DOCUMENT NUMBER: UG204
© 2006-2008 Tilera Corporation. All rights reserved.
Printed in the United States of America.
No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means,
electronic, mechanical, photocopying, recording, or otherwise, except as may be expressly permitted by the
applicable copyright statues or in writing by the Publisher.
The following are trademarks of Tilera Corporation: Tilera, Embedding Multicore, The Multicore Company, Tile
Processor, TILE64, TileDirect, TILExpress, TILExpress-64, iMesh, Multicore Development Environment, Gentle
Slope Programming, iLib, and the Tilera logo. All other trademarks and/or registered trademarks are the
property of their respective owners.
Third-party software: The Tilera IDE makes use of the BeanShell scripting library. Source code for the BeanShell
library can be found at the BeanShell website (http://www.beanshell.org/developer.html).
This document contains advance information on Tilera products that are in development, sampling or initial
production phases. This information and specifications contained herein are subject to change without notice at
the discretion of Tilera Corporation.
No license, express or implied by estoppels or otherwise, to any intellectual property is granted by this document.
Tilera disclaims any express or implied warranty relating to the sale and/or use of Tilera products, including
liability or warranties relating to fitness for a particular purpose, merchantability or infringement of any patent,
copyright or other intellectual property right.
Products described in this document are NOT intended for use in medical, life support, or other hazardous uses
where malfunction could result in death or bodily injury.
THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN “AS IS” BASIS. Tilera
assumes no liability for damages arising directly or indirectly from any use of the information contained in this
document.
MDE Getting Started i
Tilera Confidential — Subject to Change Without Notice
Preface
Intended Audience
This Getting Started guide is intended for new users of the
Multicore Development Environment (MDE) from Tilera
Corporation. It will help software developers install the MDE
and get up and running quickly.
This guide provides only a brief introduction to the MDE itself.
For more detailed information, see the MDE User's Guide.
System Requirements
See the Release Notes for hardware, software, and operating
system requirements for your particular MDE release.
Product Collateral
The following product documentation is available from Tilera
Corporation:
• MDE Release Notes, UG208
• MDE Getting Started, UG204
• Migrating to the TILEPro Processor Family, UG221
• MDE User's Guide, UG201
• Programming the Tile Processor, UG205
• MDE Optimization Guide, UG105
• iLib API Reference Manual, UG202
ii MDE Getting Started
Tilera Confidential — Subject to Change Without Notice
• MDE NetIO API Reference Manual, UG212
• MDE Tile Processor Application Binary Interface (ABI) Reference Manual,
UG213
• MDE Architecture-Specific API Reference, UG214
• MDE Profile Control API Reference, UG215
• MDE Simulator Control API Reference, UG216
• MDE Vector Library API Reference, UG217
• PCIe Driver Developer's Reference, UG219
• TILExpress-64 Card User's Guide, UG300
• TILExpress-20G Card User's Guide, UG301
• TILExpressPro-64 Card User's Guide, UG302
• TILExpressPro-20G Card User's Guide, UG303
• Tile Processor Architecture Overview, UG100
Notation Conventions
The following table lists notation conventions used in this document.
Convention Description
{this | that} Alternative required items in syntax descriptions appear within curly
brackets and separated by vertical bars. Read the example as this or that;
one or the other is required.
[this | that] Optional items in syntax descriptions appear within square brackets and
separated by vertical bars. Read the example as an optional this or that.
[this, ...] Optional item lists in syntax descriptions appear within brackets
delimited by commas and terminated with an ellipsis. Read the example
as an optional, comma-separated list of this.
$ This is the system prompt for the host. It appears for command-line
examples that are meant to run on the host PC.
MDE Getting Started iii
Tilera Confidential — Subject to Change Without Notice
Contact Information
# This is the system prompt for the Tile Processor. It appears for
command-line examples that are meant to run on the Tile Processor.
command Command names appear in the Minion Pro font.
system output System output appears in the Courier New font.
filename Non-keyword placeholders (whose values should be replaced with an
actual value) appear in italics.
GUI item Graphical User Interface (GUI) items, such as button or menu names,
appear in the Minion Pro font in bold.
new term Important words or phrases appear in italics the first time they are
introduced.
${TILERA_ROOT} This is the root of the Tilera MDE installation directory.
Tilera Corporation
Information: info@tilera.com
Web Site: http://www.tilera.com
Headquarters: Research and Development:
2333 Zanker Road
San Jose, CA 95131 USA
+408.383.9292 Phone
+408.383.9225 Fax
1900 West Park Drive, Suite 290
Westborough, MA 01581 USA
+508.616.9300 Phone
+508.616.9306
Customer Support:
Email your questions to: support @tilera.com
Convention Description
iv MDE Getting Started
Tilera Confidential — Subject to Change Without Notice
CONTENTS
MDE Getting Started v
Tilera Confidential — Subject to Change Without Notice
INSTALLING THE MDE .............................................................................................1
Installing the PCIe Driver for TILExpress Cards ..................................................................................3
Verifying the MDE Installation .............................................................................................................4
MDE Directory Structure ......................................................................................................................5
Using the Documentation ......................................................................................................................7
Using the Online Help ...........................................................................................................................8
GETTING STARTED WITH THE IDE .......................................................................11
Eclipse Terminology ...........................................................................................................................14
Tilera Extensions to Eclipse ................................................................................................................15
Tilera-Specific Perspectives .............................................................................................................15
Tilera-Specific Views .......................................................................................................................16
Launch Configuration Type ..............................................................................................................16
BUILDING PROJECTS IN THE IDE ........................................................................17
Setting Up MDE Installation Descriptions ..........................................................................................18
TILERA COMMAND-LINE INTERFACE ..................................................................23
Getting Help on MDE Commands ......................................................................................................23
Running Example Programs on the Hardware ....................................................................................24
Running the Single-Tile Example on Hardware ...............................................................................25
Running the Multi-Tile Example on Hardware ................................................................................25
Running Example Programs on the Simulator ....................................................................................26
Running the Single-Tile Example on the Simulator .........................................................................27
Running the Multi-Tile Example on the Simulator ..........................................................................27
Options Used in Example Programs ...................................................................................................28
FREQUENTLY ASKED QUESTIONS ......................................................................31
FAQs About the IDE ...........................................................................................................................31
FAQs About the Command-Line Tools ..............................................................................................34
vi MDE Getting Started
Tilera Confidential — Subject to Change Without Notice
1
1 Installing the MDE
PREREQUISITE
If your site has purchased a TILExpress™ card, install the card and verify that it
has been properly installed as described in the relevant Installation Sheet before
beginning the MDE software installation procedure outlined below.
TASK
1. Open an Xterm or terminal window.
2. Login as the root user.
3. Copy each tar archive that you plan to install to the directory where you
intend to install the MDE.
ADDITIONAL INFORMATION: If your site has purchased a TILExpress card, the direc-
tory where you are installing MDE must be cross-mounted so that it is acces-
sible fromboththe PC inwhich thecard is installed and any development host
on which the IDE or command-line tools are run. These two may not be the
same, depending on your particular site.
• One possible choice might be /home/tilera/.
• Another choice could be /opt/, which requires root access.
4. Go to your installation directory.
$ cd /installdir/
5. Do one of the following:
• If your tar file is encrypted, use the following GNU Privacy Guard (GPG)
command to decrypt it, substituting your software version number (for
example, 2.0.0) for version:
$ gpg TileraMDE-version.tar.bz2.gpg
• Otherwise, skip this step.
6. Unpack the installation tar file, passing the -j option to the tar
command. This option is required because Tilera installation files are
compressed using the bzip2 format.
INSTALLING THE MDE
2
$ tar -xjf TileraMDE-version.tar.bz2
STEP RESULT: Two MDE installation directories are installed, one for the TILE64™
chip architecture and one for the TILEPro (TILEPro64™ or TILEPro 36™) chip
architecture:
• /installdir/TileraMDE-version/tile64
• /installdir/TileraMDE-version/tilepro
7. Repeat steps 4 and 6, above for each archive you wish to install.
8. Decide which chip architecture should be the default:
• For hardware, this depends on the actual chip on which your applica-
tion will run, either TILE64 or TILEPro.
• For the simulator, this depends on the chip architecture you want to
simulate, again either TILE64 or TILEPro.
9. Command-line users: create the TILERA_ROOT environment variable
and point it to the MDE installation for the appropriate architecture
using one of the following commands, depending on the type of shell
you are using.
ADDITIONAL INFORMATION: The tiledir portion of the path in the following
examples refers to either the /tile64/ or the /tilepro/ subdirectory.
• Bourne shell:
$ export TILERA_ROOT=$HOME/installdir/TileraMDE-version/tiledir
• C shell:
$ setenv TILERA_ROOT $HOME/installdir/TileraMDE-version/tiledir
10. Command-line users: add the MDE installation binary directory to your
PATH environment variable using one of the following commands,
depending on the type of shell you are using.
ADDITIONAL INFORMATION: In the following examples, the PATH is set in two lines
so that these snippets can be run more than once (for example, in a login or
init script) without adding multiple copies of TILERA_ROOT to your PATH.
• Bourne shell:
$ if [-z "$PATH_BASE"] ; then export PATH_BASE=${PATH} ; fi
$ export PATH="${TILERA_ROOT}/bin:${PATH_BASE}"
• C shell:
$ if ( ! $?PATH_BASE ) setenv PATH_BASE $PATH
$ setenv PATH ${TILERA_ROOT}/bin:${PATH_BASE}
ADDITIONAL INFORMATION: Youcanalsocreatescriptsnamedtile64 ortilepro that
contain these commands and then invoke one or the other script based on
which chip you are using to configure the TILERA_ROOT and PATH environ-
ment variables correctly.
STEP RESULT: Running command-line tools like tile-cc and tile-gdb is now
essentially the same as prior to the introduction of the TILEPro chip.
INSTALLING THE MDE
INSTALLING THE PCIE DRIVER FOR TILEXPRESS CARDS
3
Remember that when switching between chip architectures (TILE64 or
TILEPro), it is always necessary to reset the TILERA_ROOT and PATH environ-
ment variables to the appropriate installation directory.
11. IDE users: Setup is slightly more flexible.
12. If upgrading from an earlier MDE release, rebuild any existing applica-
tions that were built with the earlier release with the current release.
RESULT:
The MDE software is installed on the host PC and the following environment
variables are properly set for the desired chip architecture (TILE64 or TILEPro):
1) The TILERA_ROOT environment variable is set to the location of the
MDE installation for the desired chip architecture.
2) The PATH environment variable includes the location of the MDE instal-
lation binaries for the desired chip architecture.
RELATED LINKS:
Running Example Programs on the Hardware
Installing the PCIe Driver for TILExpress Cards
This topic describes how to install the PCIe driver for TILExpress™ cards.
NOTE: The Tile Processor PCIe endpoint driver for the current MDE release is
incompatible with the host driver from earlier MDE versions. If your site has a
TILExpress card that is running software older than this release, you must update
the PCIe driver to a newer version. If you are using an OS version older than Red
Hat Enterprise Linux (RHEL) 4, you must run tile-module-compile to build the
PCIe driver for your OS version.
NOTE: Always run the PCIe driver installation script described below from the
installation that matches the Tile Processor™ chip (tile64 or tilepro) that you will
ultimately be using.
TASK
1. Login as root and run the PCIe device driver installation script.
$ ${TILERA_ROOT}/lib/modules/tile-module-install
ADDITIONAL INFORMATION: After running the PCIe driver installation script, a
power cycle of the PC is required.
INSTALLING THE MDE
VERIFYING THE MDE INSTALLATION
4
2. Power down the system, wait 10 seconds, and then power the system
back up.
3. Verify that the PCIe driver has been properly installed and the card is
available.
$ grep tilepci /proc/devices
ADDITIONAL INFORMATION: The file /proc/devices lists the currently available
devices.
STEP RESULT: If the card is installed and available, the above command returns
an entry such as:
254 tilepci
4. If you have connected a cable from the console output of the PCIe card
to the serial port on the host PC, create a file named /etc/tilepciN.conf,
where N is the PCIe card number (0, 1, etc.). This file is expected to
contain a line such as serial=/dev/ttySO.
ADDITIONAL INFORMATION: If the tilepciN.conf file exists at boot time, the PCIe
driver creates a symbolic link named /dev/tilepciN/serial (again where N is the
card number), which points to the serial device named above, in this case
/dev/ttySO. Tilera's tools now look for the /dev/tilepciN/serial symbolic link
instead of requiring you to specify --console-device /dev/ttySO on the
tile-monitor command line.
Installing a serial cable is not required to run applications on Tilera hardware.
However, it is required to see boot-time output from the operating system,
which is sent through the console serial port. This output can be helpful for
debugging boot-time issues in your application.
5. If you want to see boot-time output from the OS, change permissions
on /dev/ttyS0 to make it both readable and writeable to users.
$ chmod 666 /dev/ttyS0
RESULT:
The PCIe driver for the TILExpress card is properly installed and the card is
available. If you have made the serial port readable and writeable, boot-time
output from the OS is displayed on the console when the card is booted.
Verifying the MDE Installation
After installing the MDE software, verify the installation to ensure that it is
working properly.
INSTALLING THE MDE
MDE DIRECTORY STRUCTURE
5
NOTE: If your site has purchased a TILExpress™ card, you can verify the MDE
installation using both the hardware and the simulator. Even if you don't have the
hardware, you can still perform the verification using the simulator.
TASK
1. Do one of the following:
• If your site has purchased a TILExpress™ card, run the following
command on the PC in which the corresponding hardware is installed:
$ ${TILERA_ROOT}/bin/tile-monitor --pci -- cat /proc/version
• If your site did not purchase a TILExpress card, use this command to
verify the installation using the simulator:
$ ${TILERA_ROOT}/bin/tile-monitor --simulator --image 2x2 -- 
cat /proc/version
NOTE: The simulator test can be run anywhere.
2. If you are installing more than one chip architecture (tile64 and/or
tilepro), repeat the hardware or simulator verification command for
each platform, with the TILERA_ROOT environment variable set appro-
priately.
MDE Directory Structure
The MDE software is delivered as a compressed tar archive with a root directory
of /TileraMDE-version/, where version is the version number of the installation
(for example, 2.0).
The topmost directory in the unpacked directory structure for each tar file is the
chip architecture: /tile64/ or /tilepro/, depending on the type of chip in use. You
can unpack them both in the same parent directory without fear of one tar file
overwriting the content of the other.
Once the tar archive is unpacked, the result is a directory structure with the
following heirarchy:
• README file
• bin/: Tools for development using either the IDE or the command line:
– tile-as: Assembler
– tile-cc and tile-c++: Tilera C and C++ compilers
INSTALLING THE MDE
MDE DIRECTORY STRUCTURE
6
– tile-eclipse: Eclispe-based IDE
– tile-gdb: Debugger
– tile-ld: Linker
– tile-monitor: Command-line execution tool
– tile-opannotate: OProfile source code annotation tool
– tile-ophelp: Displays a list of Tilera hardware events that can be used
with OProfile.
NOTE: The displayed event list depends on the installation (tile64 or
tilepro) from which this command is launched.
– tile-opreport: OProfile reporting tool
– tile-trace-view: Tilera Trace Viewer, a GUI viewer
– Other miscellaneous tools
• doc/: Online documentation
– index.html: Tilera MDE Document Index, with links to the electronic
documentation, including user guides, application notes, technical
notes, tools documentation, and real-time library reference
manuals.
– html/: HTML documentation
– pdf/: PDF documents
• etc/:
– ProfileMetadata.xml
– sdk-version
– tile-trace-view-win32.zip
• examples/: Examples of code you can use to test the installation, and to
learn how to use some of Tilera' application programming interfaces.
– getting_started/: Single and multi-tile Hello World examples that are
explained in the Getting Started guide, UG204, and the MDE tutorial
provided in the IDE online help.
– hpi/: Example using the Host Port Interface (HPI), a high-speed
parallel port. The HPI driver is described in Section 6.7 and a code
listing of the example is provided in Appendix B of the the System
Programmer's Guide, UG209.
– ili_api/: Examples using the iLib API, explained in the iLib API
Reference Manual, UG202.
INSTALLING THE MDE
USING THE DOCUMENTATION
7
– netio/: Examples using the NetIO API, explained in the NetIO API
Reference Manual, UG212.
– pci/: An example of how to use the Fast PCIe API, explained in the
Fast PCIe API Application Note, AN024.
– programming_guide/: Examples used in the Programming the Tile
Processor manual, UG205.
• include/: Header files for programming with iLib and the standard C
library
• lib/: Libraries and software used by the development tools
– boot/: Operating system bootrom files and simulator platform image
files
• man/: Manual pages for development tools
• share/:
– oprofile/tile/tile*/: Events and unit masks used by the OProfile tool
• src/: Tar archive files with source code for various software components.
• tile/: Tile Processor architecture-specific files
– bin/, sbin/, usr/bin/, usr/sbin/: Native Linux commands
– boot/: Operating system components
– lib/: Libraries for programming with iLib, the standard C library, or
other libraries; Eclipse libraries, compiler support
– usr/lib/: Shared libraries
Using the Documentation
Tilera provides the following product documentation:
• IDE online help. See Using the Online Help.
• Man pages. Tilera provides man pages in the ${TILERA_ROOT}/man/
directory. To view a man page for a particular tool, type:
$ tile-man tool-name
• Tilera MDE Document Index
(${TILERA_ROOT}/doc/index.html). This HTML page has links
INSTALLING THE MDE
USING THE ONLINE HELP
8
to all of the MDE online documentation, including manuals, technical
notes, and documentation on tools and real-time libraries.
• User and reference manuals in PDF format that you can access from the
Tilera MDE Document Index. For a list of available documents, see the
Preface.
NOTE: You can use the free Adobe Reader to read, search, and print PDF
files. For information on how to download and install the Adobe Reader, go
to the Adobe website (http://www.adobe.com).
Using the Online Help
This topic describes how to access and use the online help available in the IDE.
PREREQUISITE
The Tilera IDE must be up and running before you can access the online help.
To start the IDE, assuming you have added ${TILERA_ROOT} to your path,
you can simply issue the following command:
$ tile-eclipse
To access the online help from the IDE, follow these steps.
TASK
1. Select the menu item Help > Help Contents to display the Eclipse Plat-
form Help window.
INSTALLING THE MDE
USING THE ONLINE HELP
9
2. View the user guides, available in the Contents pane:
• Tilera IDE User Guide—Provides an overview of how to get started:
setup, creating a project, running and debugging on the simulator, and
profiling an application.
• Workbench User Guide—Provides an introduction to using an
Eclipse-based IDE. Explains the workbench, perspectives, editors, views,
external tools, team programming, and accessibility features.
• C/C++ Development User Guide—Discusses using the CDT plugin exten-
sions to Eclipse for C program development.
AFTER COMPLETING THIS TASK:
Tilera recommends that new users begin with the Getting Started topic in the
Tilera IDE User Guide, which introduces the IDE and the extensions to Eclipse
that Tilera has added for multi-tile development and debugging.
INSTALLING THE MDE
USING THE ONLINE HELP
10
11
2 Getting Started with
the IDE
The Tilera Integrated Development Environment (IDE) provides an integrated
environment for developing, debugging, and profiling applications on Tilera
hardware and simulator platforms.
The Tilera IDE is based on the Eclipse development environment. Also known
as the Multicore Development Environment (MDE), the Tilera IDE extends
Eclipse by adding the C Development Toolkit (CDT) plugin, plus a number of
Tilera-proprietary extensions to both Eclipse and CDT.
If you have not used an IDE (or Eclipse) before, you might want to browse
through an introductory text, such as Eclipse Distilled by David Carlson.
NOTE: Eclipse is a Java-centric development environment, so most of the examples
in books on Eclipse tend to be Java-centric. Read such introductory material with
the goal of becoming comfortable with Eclipse as a development environment,
rather than as a guide for C/C++ programming in Eclipse.
The following figure shows an example of what the IDE main window (also
known as the workbench) looks like when an application is being debugged.
GETTING STARTED WITH THE IDE
12
Figure 1: Tilera IDE
TASK
1. To start the IDE for the first time, enter the following command at the
OS command prompt:
$ tile-eclipse
STEP RESULT: The standard Eclipse Welcome screen briefly appears.
GETTING STARTED WITH THE IDE
13
Figure 2: IDE Welcome Screen
NOTE: If you have multiple installation directories (for example, both
/tile64/ and /tilepro/ directories), there is a tile-eclipse binary in the
${TILERA_ROOT}/bin/ directory of each one. The IDE is designed so that
it can be used with any MDE installation from the same release, so it does
not matter which copy of tile-eclipse you use as long as it comes from one of
the installation directories from the current release. Do not use a tile-eclipse
from a newer or later MDE release.
2. The Tilera plug-in detects that you are running the IDE for the first time
and automatically loads a number of perspectives for you to use in
developing Eclipse applications.
STEP RESULT: A workspace directory is created for you in the following location:
${HOME}/.tilera/workspace
RESULT:
Once you have completed these initial setup steps, the IDE is ready to use in
developing, running, and profiling applications.
GETTING STARTED WITH THE IDE
ECLIPSE TERMINOLOGY
14
Eclipse Terminology
RELATED LINKS:
Tilera Extensions to Eclipse
Term Description
Workspace
directory
A default root directory that Eclipse uses as a
location for projects and the preferences, settings,
and project-related metadata that are generated as
you use the IDE. When you start up the Tilera IDE,
a workspace directory is automatically created for
you in ${HOME}/.tilera/workspace. If you have
multiple MDE installations (for example, both
/tile64/ and /tilepro/), tile-eclipse uses the same
.tilera/workspace for both. You can have projects in
the same workspace configured for either
installation, or for the Default installation (the one
from which tile-eclipse was launched).
Project
directory
A container for the sources, makefiles, and other
files that relate to a single application. Eclipse also
uses this directory to store some IDE metadata,
such as the project description and project-specific
settings.
View A specific window in the IDE, such as the Debug
view or the Tilera Grid view. A view typically has a
tab, on which the name of the view appears. See also
The Targets View and The Grid View in the IDE
online help.
Perspective A named set of views that serve a common
perspective, such as the Tilera Debug perspective
or the Tilera Profile perspective. See also Tilera
MDE Perspectives in the IDE online help.
Launch
configuration
A description of the applications you want to invoke
using the IDE's display and debugging facilities,
along with any arguments, settings, or environment
information needed to invoke it. You create a launch
configuration to run or debug an application in the
IDE. In debug mode, the launch configuration also
specifies any debugging-related options.
GETTING STARTED WITH THE IDE
TILERA EXTENSIONS TO ECLIPSE
15
Tilera Extensions to Eclipse
The Tilera IDE adds several user-interface elements to the default Eclipse IDE.
Tilera-Specific Perspectives
The Tilera MDE adds the following perspectives to the default Eclipse IDE.
You select a perspective using the Author, Debug, or Profile button in the
upper right corner of the IDE, as shown in the following figure.
Figure 3: Choosing a Perspective
Tilera-Specific
Perspective Description
Author
perspective
For authoring Tilera applications
Debug
perspective
For running and debugging code
Profile
perspective
For profiling code and examining the results of
profile runs
GETTING STARTED WITH THE IDE
TILERA EXTENSIONS TO ECLIPSE
16
Tilera-Specific Views
The Tilera MDE adds the following views to the default Eclipse IDE.
Launch Configuration Type
Tilera also adds a launch configuration type for cross-platform applications that
run on Tilera hardware. A launch configuration type defines a set of tabs that
appear in the Run/Debug dialog and allow you to specify parameters for
running or debugging a program.
Tilera-Specific
View Description
Tilera Grid view Displays the state of the Tile Processor for the
currently selected launch, if any
Tilera Profile
view
Displays and explores the content of profile XML
data files generated by applications running on
the Tilera hardware simulator
17
3 Building Projects in the
IDE
The MDE IDE supports two types of projects:
• A Standard Make project, for which you supply the C/C++ sources and
your own makefile to build them.
• A Managed Make project, for which you supply the C/C++ sources but let
the IDE take care of creating and updating the makefile structure for you.
The example programs in the software kit already have their own makefiles, so
this tutorial demonstrates how to build a Standard Make project.
The Hello World Multicore Tutorial describes how to create and build a simple
program called hello_world_multicore, which runs on multiple tiles.
The source files for this program are located in the $TILERA_ROOT/tile*/
examples/getting_started/hello_world_multicore/ directory. You can access the
Hello World Multicore Tutorial from the online help in the IDE by seleting the
menu item Help > Tilera IDE User Guide > 'Hello World Multicore' Tutorial.
BUILDING PROJECTS IN THE IDE
SETTING UP MDE INSTALLATION DESCRIPTIONS
18
Setting Up MDE Installation Descriptions
NOTE: If you have multiple MDE installations (for example, both /tile64/ and
/tilepro/), you can set up an MDE Installation Description for each one using the
MDE Installations Preference page in the IDE. This is only necessary if you have
multiple MDE installations and you want to be able to choose between them
within the IDE when building projects or running applications.
BUILDING PROJECTS IN THE IDE
SETTING UP MDE INSTALLATION DESCRIPTIONS
19
To create installation descriptions for multiple MDE installations, follows these
steps:
1) In the IDE, select the menu item Window > Preferences. This displays the
Preferences dialog.
2) In the tree view on the left-hand side of the Preferences dialog, select
Tilera MDE.
BUILDING PROJECTS IN THE IDE
SETTING UP MDE INSTALLATION DESCRIPTIONS
20
3) The default location is the MDE installation from which tile-eclipse was
launched. To add another installation location, click the Add button.
4) In the Name field of the Add MDE Installation dialog, enter a display
name for the installation.
5) For Pathname, either click Browse and select the desired installation
directory or manually enter the TILERA_ROOT path. (If the entered path-
name does not refer to an existing, valid installation directory, the entire
row is displayed in red.) Click OK.
The new MDE installation is added to the displayed list in the Preferences
dialog.
6) If you want to change the display name of an installation location, select it
and click the Edit button. This displays the Edit MDE Installation dialog
in which you can edit the display name as desired.
BUILDING PROJECTS IN THE IDE
SETTING UP MDE INSTALLATION DESCRIPTIONS
21
BUILDING PROJECTS IN THE IDE
SETTING UP MDE INSTALLATION DESCRIPTIONS
22
23
4 Tilera Command-Line
Interface
This topic explains how to use the makefiles and compiler supplied with MDE
together with the tile-monitor command to run the example programs. The
installation includes both single-tile and multi-tile examples for hardware and
simulator platforms.
The examples assume that you have already set up your TILERA_ROOT and
PATH environment variables.
Getting Help on MDE Commands
Online help is available for commands in the MDE command-line interface.
The commands generally follow the Linux convention of providing a --help
option, which summarizes the command's usage.
To see help for the tile-cc command, for example, use:
$ tile-cc --help
The tile-monitor command has three kinds of help:
$ tile-monitor --help-examples
$ tile-monitor --help-commands
$ tile-monitor --help-options
Most commands also have man pages. To see man pages for the tile-cc or
tile-monitor command, for example, use:
$ tile-man tile-cc
or
TILERA COMMAND-LINE INTERFACE
RUNNING EXAMPLE PROGRAMS ON THE HARDWARE
24
$ tile-man tile-monitor
Most commands also have HTML files explaining their purpose and usage in
the Tilera Multicore Development Environment (MDE) Document Index,
located at ${TILERA_ROOT}/tile*/doc/index.html.
Running Example Programs on the Hardware
The examples are provided in the following directories of the MDE install tree:
• /path/examples/getting_started/hello_world/
• /path/examples/getting_started/hello_world_multicore/
where /path/ refers to either the ${TILERA_ROOT}/tile64/ or the
${TILERA_ROOT}/tilepro/ subdirectory, depending on the chip you are using.
Before you can use the examples, you need to copy these two directories to your
own working directories. For example,
$ cp -r /path/examples/getting_started/ hello_world /tmp/single
$ cp -r /path/examples/getting_started/ hello_world_multicore 
/tmp/multi
To run the examples that follow, you will go to the /tmp/single/hello_world/
subdirectory:
$ cd /tmp/single/hello_world
and to the /tmp/multi/hello_world_multicore/ subdirectory:
$ cd /tmp/multi/hello_world_multicore
The multi-tile example uses iLib™ library functions to launch multiple instances
of itself across multiple tiles. It also uses an iLib barrier routine to ensure that
the ”hello world” messages from the various tiles are not intermixed.
The example programs for the hardware platform use the run_pci target. You
must have a PCIe card installed to run these example programs sucessfully.
RELATED LINKS:
Installing the PCIe Driver for TILExpress Cards
TILERA COMMAND-LINE INTERFACE
RUNNING EXAMPLE PROGRAMS ON THE HARDWARE
25
Running the Single-Tile Example on Hardware
To run the single-tile example program on the PCIe card, follow these steps:
TASK
1. Change to the /hello_world/ subdirectory in your working directory, for
example:
$ cd tmp/single/hello_world
2. Use the run_pci target of the provided makefile to build the example
and run it on the hardware.
$ make run_pci
RESULT:
/path/bin/tile-cc -g -c hello_world.c -o hello_world.o
/path/bin/tile-cc hello_world.o -lilib -ltmc -o hello_world
/path/bin/tile-monitor 
--pci 
--tile 2x2 
--batch-mode --mkdir /opt/test --cd /opt/test 
--upload hello_world hello_world -- hello_world
Hello World!
Running the Multi-Tile Example on Hardware
To run the multi-tile example program on the PCIe card, follow these steps:
TASK
1. Change to the /hello_world_multicore/ subdirectory in your working
directory, for example:
$ cd tmp/multi/hello_world_multicore
2. Use the run_pci target of the provided makefile to build the example
and run it on the hardware.
$ make run_pci
RESULT:
/path/bin/tile-cc -g -c hello_world.c -o hello_world.o
/path/bin/tile-cc hello_world.o -lilib -ltmc -o hello_world
TILERA COMMAND-LINE INTERFACE
RUNNING EXAMPLE PROGRAMS ON THE SIMULATOR
26
/path/bin/tile-monitor 
--pci 
--tile 4x2 
--batch-mode --mkdir /opt/test --cd /opt/test 
--upload hello_world hello_world -- hello_world
Process 0: Hello, Brave New World!
Process 1: Hello, Brave New World!
Process 4: Hello, Brave New World!
Process 6: Hello, Brave New World!
Process 5: Hello, Brave New World!
Process 7: Hello, Brave New World!
Process 3: Hello, Brave New World!
Process 2: Hello, Brave New World!
Process 3: Hello Again, World!
Process 1: Hello Again, World!
Process 4: Hello Again, World!
Process 2: Hello Again, World!
Process 7: Hello Again, World!
Process 6: Hello Again, World!
Process 5: Hello Again, World!
Process 0: Hello Again, World!
The output from each process is displayed.
NOTE: The output is generated in sequential order. Depending on how the printf()
output lines are buffered and returned from the chip to the tile-monitor host, the
lines may be interleaved in exactly the pattern shown above, but you should see
two lines from each process.
Running Example Programs on the Simulator
The example programs for the simulator platform use the run target.
Once you have run these simple examples, see the MDE User's Guide, UG201,
for more information on how to use the simulator.
TILERA COMMAND-LINE INTERFACE
RUNNING EXAMPLE PROGRAMS ON THE SIMULATOR
27
Running the Single-Tile Example on the Simulator
To run the single-tile example program on the simulator platform, follow these
steps:
TASK
1. Change to the /hello_world/ subdirectory in your working directory, for
example:
$ cd tmp/single/hello_world
2. Use the run target of the provided makefile to build the example and
run it on the simulator.
$ make run
RESULT:
/path/bin/tile-monitor 
--image 2x2 
--functional 
--batch-mode --mkdir /opt/test --cd /opt/test 
--upload hello_world hello_world -- hello_world
Hello World!
Running the Multi-Tile Example on the Simulator
To run the multi-tile example on the simulator platform, follow these steps:
TASK
1. Change to the /hello_world_multicore/ subdirectory in your working
directory, for example:
$ cd tmp/multi/hello_world_multicore
2. Use the run target of the provided makefile to build the example and
run it on the simulator.
$ make run
RESULT:
/bin/tile-monitor 
--image 4x4 --tile 4x2 
--functional
TILERA COMMAND-LINE INTERFACE
OPTIONS USED IN EXAMPLE PROGRAMS
28
--batch-mode --mkdir /opt/test --cd /opt/test 
--upload  hello_world hello_world -- hello_world
Process 0: Hello, Brave New World!
Process 4: Hello, Brave New World!
Process 3: Hello, Brave New World!
Process 5: Hello, Brave New World!
Process 2: Hello, Brave New World!
Process 7: Hello, Brave New World!
Process 1: Hello, Brave New World!
Process 6: Hello, Brave New World!
Process 0: Hello Again, World!
Process 1: Hello Again, World!
Process 2: Hello Again, World!
Process 5: Hello Again, World!
Process 4: Hello Again, World!
Process 7: Hello Again, World!
Process 3: Hello Again, World!
Process 6: Hello Again, World!
The output from each process is displayed.
NOTE: The output is generated in sequential order. Depending on how the printf()
output lines are buffered and returned from the chip to the tile-monitor host, the
lines may be interleaved in exactly the pattern shown above, but you should see
two lines from each process.
Options Used in Example Programs
The various options to the tile-monitor command used in the example
programs (hello_world and hello_world_multicore) have the
following effects:
1) The examples use one or the other of the following options, depending on
whether they are running on the hardware or the simulator platform:
--pci option (hardware platform only)—Connects to the PCIe card.
--image option (simulator platform only)—Requests a simulated chip of
the specified size (for example, 2x2 for single-tile or 4x4 for multi-tile).
TILERA COMMAND-LINE INTERFACE
OPTIONS USED IN EXAMPLE PROGRAMS
29
2) --tile option—Restricts the application to a grid of tiles of the specified size
(for example, 4x2 creates a grid 4 tiles wide and 2 tiles high).
3) --functional option (simulator platform only)—Enables functional mode,
which is faster than the default timing-accurate mode.
4) --batch-mode option—Runs the program in batch mode, which means
that tile-monitor exits when finished instead of entering interactive mode.
5) --mkdir option—Creates a directory (for example, /opt/test/) on the Linux
file system on either the hardware or the simulator target.
6) --cd option—Changes to the specified directory (for example, /opt/test/)
7) --upload option—Uploads the specified program (for example,
hello_world) from the source to the target.
8) -- option (two dashes followed by a space)—Runs the program specified
after the space (for example, hello_world) when the current process is
finished.
TILERA COMMAND-LINE INTERFACE
OPTIONS USED IN EXAMPLE PROGRAMS
30
31
5 Frequently Asked
Questions
This topic provides answers to frequently asked questions (FAQs) with regard
to the MDE.
FAQs About the IDE
When I try to start tile-eclipse, it says that the workspace is already in use.
What should I do in this case?
The tile-eclipse IDE is based on Eclipse, which has a guard mechanism to
enforce the rule that at most one Eclipse instance can be running on a
given workspace at any time.
First, make sure that you do not already have an instance of tile-eclipse
running on the same host. Remember that if you are running under X
Windows, the application window might be displayed on a different
screen. For example, if you are trying to run tile-eclipse from home and
have left an instance running at work, this would occur.
Next. check your process listing (for example, with ps -wx). Look for any
rogue eclipse or java instances. If Eclipse was not shut down properly, a
windowless process may have been left running. Kill any such processes.
When the Eclipse process is shut down, it should release its lock on the
workspace directory.
If the above does not work, or there are no eclipse or java processes
currently running, manually delete the .lock file from your workspace
directory. This file should be located in the following location:
${HOME}/.tilera/workspace/.metadata/.lock
You should now be able to start tile-eclipse normally.
FREQUENTLY ASKED QUESTIONS
FAQS ABOUT THE IDE
32
I am unable to edit or rename files in the /examples/ directory. What is
wrong?
The MDE files may have been installed read-only, or may be owned by
root. The simplest workaround for this is to make your own copy of the
/examples/ directory in your home directory. This also allows you to edit
and tweak the example without affecting other users.
If I delete a project from the workspace, can I get it back?
When you delete a project from the Eclipse workspace, if you answer 'no'
in the dialog that asks whether you want to delete the actual project files,
then the project content is still there but not visible to Eclipse.
To make the project visible again, you must reimport it as follows:
a) Select the menu item File > Import.
b) Select the menu item General > Existing Projects into Workspace
on the Import dialog, then click Next.
c) In the Select root directoryoption on the next tab, either tpye or
browse to the old project directory.
d) Verify that the project name appears in the Projects list.
e) Click Finish to import the project.
I have closed one of the perspectives, so its name is no longer visible. How do
I get it back?
To get back a closed perspective, follow these steps:
a) Select the menu item Window > Open Perspective > Other....
b) Select the desired perspective name from the list, and click OK.
NOTE: There are two Debug perspectives. Choose the one with the Tilera®
logo. The other is the generic Eclipse Debug perspective, which lacks
Tilera-specific debugging views.
I have rearranged views in one of the perspectives. How do I restore them to
their default positions?
Right-click on the perspective name in the top-right corner of the IDE
window, and select Reset from the menu.
I have closed a view in one of the perspectives. How can I get it back?
a) Select the perspective by clicking its name in the top-right corner of
the IDE window.
b) Select the menu items Window > Show View... and pick the view's
name from the menu. If the view is not displayed on the menu,
choose the Other... option and pick the view from the dialog.
FREQUENTLY ASKED QUESTIONS
FAQS ABOUT THE IDE
33
Why do Standard Make projects appear in the Make Targets view, while
Managed Make projects do not?
This is because with Managed Make projects, the IDE is managing the
makefile for you, and it knows which targets it has defined. To build a
Managed Make project, right-click the project and select Build Project
from the popup menu.
For Standard Make projects, you provide a makefile, so you need to tell the
IDE which targets in your makefile you wish to use to build the project. To
build a Standard Make project, select the appropriate target in the Make
Targets view and double-click it.
NOTE: The IDE automatically generates make targets only when a makefile
happens to be found in the top level of a Standard Make project directory at
project creation time.
How do I run a program that consists of multiple executables?
Specify the initial start-up executable in the Run/Debug dialog. This
executable should spawn instances of the others (for example, through
appropriate iLib™ calls).
If the program is running on hardware, remember that you need to use the
Files tab to upload all of the executables to the chip's virtual file system,
otherwise the program will fail when it attempts to spawn an instance of
an executable that is not there.
Can I run an executable without having to create a project?
Yes. To run an executable without creating a project, follow these steps:
a) Open the Run/Debug dialog, and double-click Tilera Executable to
create a launch configuration.
b) On the Run tab, select the No Project radio button, and then enter
the working directory and application path for your exectuable.
To be able to view source files while debugging your executable, go to the
Source tab and add the desired source directory paths.
When I run a program, why do I receive an error such as the following:
Error loading libcg.so: cannot restore segment prot after
reloc: Permission denied
You are probably running MDE on Fedora core 6 (or higher). This error
is likely caused by the Security Enhanced feature of Linux (SELinux).
There are two possible solutions:
• Change the security permissions for the shared library, for example:
$ cd ${TILERA_ROOT}/lib/tile-cc
$ chcon -t texrel_shlib_t libcg.so
FREQUENTLY ASKED QUESTIONS
FAQS ABOUT THE COMMAND-LINE TOOLS
34
• Disable SELinux altogether. (Check with your system administrator
first to make sure this is acceptable.) To disable SELinux, edit the
/etc/sysconfig/selinux file and set SELINUX=disabled.
FAQs About the Command-Line Tools
I received the following error with a command-line tool. What does it mean?
ERROR: The file '/dev/tilepci0/lock' is currently locked!
This error happens if you try to run a new instance of tile-monitor when
another instance of tile-monitor is already using the same PCIe card. Only
one instance of tile-monitor can use a PCIe card at any one time.
My application stopped for no apparent reason. Why is this?
It is possible that your Tile Processor™ or PCIe card has exceeded the
temperature threshold of 110° Celsius. The temperature monitoring
daemon, tempmond, automatically shuts down the card in this situation
to avoid damaging the hardware. Console messages provide advance
warning whenever the temperature reaches 100° Celsius.
To display console messages, run either the tile-console tool, or the
tile-monitor --console-device console-serial-port command. (The
console serial port typically is configured as /dev/ttySO.)

More Related Content

What's hot

Dell Vostro 3480 Laptops Trần Phát
Dell Vostro 3480 Laptops Trần PhátDell Vostro 3480 Laptops Trần Phát
Dell Vostro 3480 Laptops Trần Phát
LAPTOP TRẦN PHÁT
 
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân ĐộiLaptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
LAPTOP TRẦN PHÁT
 
Oracle database 12c application express installation guide
Oracle database 12c application express installation guideOracle database 12c application express installation guide
Oracle database 12c application express installation guide
bupbechanhgmail
 
Oracle® database 2 days security guide e10575
Oracle® database 2 days security guide e10575Oracle® database 2 days security guide e10575
Oracle® database 2 days security guide e10575
imranshahid7861
 
Dell Vostro 3568
Dell Vostro 3568Dell Vostro 3568
Dell Vostro 3568
LAPTOP TRẦN PHÁT
 
Sd sdio specsv1
Sd sdio specsv1Sd sdio specsv1
Sd sdio specsv1
borderj
 
Dell Vostro 5481 Laptop dành cho học sinh sinh viên
Dell Vostro 5481 Laptop dành cho học sinh sinh viênDell Vostro 5481 Laptop dành cho học sinh sinh viên
Dell Vostro 5481 Laptop dành cho học sinh sinh viên
LAPTOP TRẦN PHÁT
 
Dell Inspiron 7567 - Laptops Trần Phát
Dell Inspiron 7567 - Laptops Trần PhátDell Inspiron 7567 - Laptops Trần Phát
Dell Inspiron 7567 - Laptops Trần Phát
LAPTOP TRẦN PHÁT
 
Oracle timesten
Oracle timestenOracle timesten
Oracle timesten
vn_nguyenquang
 
Oracle database 12c 2 day + application express developer's guide
Oracle database 12c 2 day + application express developer's guideOracle database 12c 2 day + application express developer's guide
Oracle database 12c 2 day + application express developer's guide
bupbechanhgmail
 
E13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOKE13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOK
prathap kumar
 
Web logic installation document
Web logic installation documentWeb logic installation document
Web logic installation document
Taoqir Hassan
 
Oracle database gateway 11g r2 installation and configuration guide
Oracle database gateway 11g r2 installation and configuration guideOracle database gateway 11g r2 installation and configuration guide
Oracle database gateway 11g r2 installation and configuration guide
Farrukh Muhammad
 
E29632
E29632E29632
E29632
ssfdsdsf
 
Dell Vostro 3580 - Laptop Sinh Viên đáng mua
Dell Vostro 3580 - Laptop Sinh Viên đáng muaDell Vostro 3580 - Laptop Sinh Viên đáng mua
Dell Vostro 3580 - Laptop Sinh Viên đáng mua
LAPTOP TRẦN PHÁT
 
Oracle database 12c advanced security guide
Oracle database 12c advanced security guideOracle database 12c advanced security guide
Oracle database 12c advanced security guide
bupbechanhgmail
 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
LAPTOP TRẦN PHÁT
 
Security Guide for Oracle Fusion - E10543
Security Guide for Oracle Fusion - E10543Security Guide for Oracle Fusion - E10543
Security Guide for Oracle Fusion - E10543
aakash2meet
 
E10132
E10132E10132
Oracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guideOracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guide
bupbechanhgmail
 

What's hot (20)

Dell Vostro 3480 Laptops Trần Phát
Dell Vostro 3480 Laptops Trần PhátDell Vostro 3480 Laptops Trần Phát
Dell Vostro 3480 Laptops Trần Phát
 
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân ĐộiLaptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
Laptop Dell Latitude 5410: Laptop bền bỉ chuẩn Quân Đội
 
Oracle database 12c application express installation guide
Oracle database 12c application express installation guideOracle database 12c application express installation guide
Oracle database 12c application express installation guide
 
Oracle® database 2 days security guide e10575
Oracle® database 2 days security guide e10575Oracle® database 2 days security guide e10575
Oracle® database 2 days security guide e10575
 
Dell Vostro 3568
Dell Vostro 3568Dell Vostro 3568
Dell Vostro 3568
 
Sd sdio specsv1
Sd sdio specsv1Sd sdio specsv1
Sd sdio specsv1
 
Dell Vostro 5481 Laptop dành cho học sinh sinh viên
Dell Vostro 5481 Laptop dành cho học sinh sinh viênDell Vostro 5481 Laptop dành cho học sinh sinh viên
Dell Vostro 5481 Laptop dành cho học sinh sinh viên
 
Dell Inspiron 7567 - Laptops Trần Phát
Dell Inspiron 7567 - Laptops Trần PhátDell Inspiron 7567 - Laptops Trần Phát
Dell Inspiron 7567 - Laptops Trần Phát
 
Oracle timesten
Oracle timestenOracle timesten
Oracle timesten
 
Oracle database 12c 2 day + application express developer's guide
Oracle database 12c 2 day + application express developer's guideOracle database 12c 2 day + application express developer's guide
Oracle database 12c 2 day + application express developer's guide
 
E13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOKE13882== ORACLE SOA COOK BOOK
E13882== ORACLE SOA COOK BOOK
 
Web logic installation document
Web logic installation documentWeb logic installation document
Web logic installation document
 
Oracle database gateway 11g r2 installation and configuration guide
Oracle database gateway 11g r2 installation and configuration guideOracle database gateway 11g r2 installation and configuration guide
Oracle database gateway 11g r2 installation and configuration guide
 
E29632
E29632E29632
E29632
 
Dell Vostro 3580 - Laptop Sinh Viên đáng mua
Dell Vostro 3580 - Laptop Sinh Viên đáng muaDell Vostro 3580 - Laptop Sinh Viên đáng mua
Dell Vostro 3580 - Laptop Sinh Viên đáng mua
 
Oracle database 12c advanced security guide
Oracle database 12c advanced security guideOracle database 12c advanced security guide
Oracle database 12c advanced security guide
 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
Dell Inspiron 5370 Laptop Sinh Viên đáng mua 
 
Security Guide for Oracle Fusion - E10543
Security Guide for Oracle Fusion - E10543Security Guide for Oracle Fusion - E10543
Security Guide for Oracle Fusion - E10543
 
E10132
E10132E10132
E10132
 
Oracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guideOracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guide
 

Similar to UG204_MDE_GettingStarted_2_0_Beta_1

Comandos AT para Celulares
Comandos AT para CelularesComandos AT para Celulares
Comandos AT para Celulares
guest5b41fb
 
Comandos AT Para Celulares
Comandos AT Para CelularesComandos AT Para Celulares
Comandos AT Para Celulares
Victpr Sanchez
 
Triton rl1600-atm-owners-manual
Triton rl1600-atm-owners-manualTriton rl1600-atm-owners-manual
Triton rl1600-atm-owners-manual
pdfshearing
 
Release notes 180_enu
Release notes 180_enuRelease notes 180_enu
Release notes 180_enu
diegotardocchi1
 
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
Atmel Corporation
 
M2 m ehs6t_hardware
M2 m ehs6t_hardwareM2 m ehs6t_hardware
M2 m ehs6t_hardware
MarianoPenna
 
Tnx modeling guide_170_enu
Tnx modeling guide_170_enuTnx modeling guide_170_enu
Tnx modeling guide_170_enu
An Nam Education
 
Tekla
TeklaTekla
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
stannventures.Pvt.Ltd
 
Sc101 t um_10_jan07
Sc101 t um_10_jan07Sc101 t um_10_jan07
Sc101 t um_10_jan07
俊宏 賀
 
DTI Custom Publication, 2011
DTI Custom Publication, 2011DTI Custom Publication, 2011
DTI Custom Publication, 2011
joeldeer
 
3 com router 3cr858 91
3 com router 3cr858 913 com router 3cr858 91
3 com router 3cr858 91
José Luis Gomes
 
Tutorials mep metenu
Tutorials mep metenuTutorials mep metenu
Tutorials mep metenu
Eldos Rajan
 
Rb411ug a
Rb411ug aRb411ug a
Rb411ug a
Ronald Orbegoso
 
Dell Vostro 3671 datasheet
Dell Vostro 3671 datasheetDell Vostro 3671 datasheet
Dell Vostro 3671 datasheet
Mr Cuong
 
Ts training eng_drawings_170_enu
Ts training eng_drawings_170_enuTs training eng_drawings_170_enu
Ts training eng_drawings_170_enu
imaduddin91
 
Spectro Cloud Palette Edge datasheet
Spectro Cloud Palette Edge datasheetSpectro Cloud Palette Edge datasheet
Spectro Cloud Palette Edge datasheet
Spectro Cloud
 
Siemens catalog hmi-td 200 operator interface
Siemens catalog hmi-td 200 operator interfaceSiemens catalog hmi-td 200 operator interface
Siemens catalog hmi-td 200 operator interface
Dien Ha The
 
3 c16980 81_userguide
3 c16980 81_userguide3 c16980 81_userguide
3 c16980 81_userguide
ken
 
Siemens catalog hmi-td 200 operator interface 1
Siemens catalog hmi-td 200 operator interface 1Siemens catalog hmi-td 200 operator interface 1
Siemens catalog hmi-td 200 operator interface 1
Dien Ha The
 

Similar to UG204_MDE_GettingStarted_2_0_Beta_1 (20)

Comandos AT para Celulares
Comandos AT para CelularesComandos AT para Celulares
Comandos AT para Celulares
 
Comandos AT Para Celulares
Comandos AT Para CelularesComandos AT Para Celulares
Comandos AT Para Celulares
 
Triton rl1600-atm-owners-manual
Triton rl1600-atm-owners-manualTriton rl1600-atm-owners-manual
Triton rl1600-atm-owners-manual
 
Release notes 180_enu
Release notes 180_enuRelease notes 180_enu
Release notes 180_enu
 
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
Atmel - Designing Feature-Rich User Interfaces for Home and Industrial Contro...
 
M2 m ehs6t_hardware
M2 m ehs6t_hardwareM2 m ehs6t_hardware
M2 m ehs6t_hardware
 
Tnx modeling guide_170_enu
Tnx modeling guide_170_enuTnx modeling guide_170_enu
Tnx modeling guide_170_enu
 
Tekla
TeklaTekla
Tekla
 
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
Getting startedwithtallydeveloper9 | Tally Synchronisation | Tally Services |...
 
Sc101 t um_10_jan07
Sc101 t um_10_jan07Sc101 t um_10_jan07
Sc101 t um_10_jan07
 
DTI Custom Publication, 2011
DTI Custom Publication, 2011DTI Custom Publication, 2011
DTI Custom Publication, 2011
 
3 com router 3cr858 91
3 com router 3cr858 913 com router 3cr858 91
3 com router 3cr858 91
 
Tutorials mep metenu
Tutorials mep metenuTutorials mep metenu
Tutorials mep metenu
 
Rb411ug a
Rb411ug aRb411ug a
Rb411ug a
 
Dell Vostro 3671 datasheet
Dell Vostro 3671 datasheetDell Vostro 3671 datasheet
Dell Vostro 3671 datasheet
 
Ts training eng_drawings_170_enu
Ts training eng_drawings_170_enuTs training eng_drawings_170_enu
Ts training eng_drawings_170_enu
 
Spectro Cloud Palette Edge datasheet
Spectro Cloud Palette Edge datasheetSpectro Cloud Palette Edge datasheet
Spectro Cloud Palette Edge datasheet
 
Siemens catalog hmi-td 200 operator interface
Siemens catalog hmi-td 200 operator interfaceSiemens catalog hmi-td 200 operator interface
Siemens catalog hmi-td 200 operator interface
 
3 c16980 81_userguide
3 c16980 81_userguide3 c16980 81_userguide
3 c16980 81_userguide
 
Siemens catalog hmi-td 200 operator interface 1
Siemens catalog hmi-td 200 operator interface 1Siemens catalog hmi-td 200 operator interface 1
Siemens catalog hmi-td 200 operator interface 1
 

UG204_MDE_GettingStarted_2_0_Beta_1

  • 1. MULTICORE DEVELOPMENT ENVIRONMENT GETTING STARTED RELEASE 2.0 BETA 1 DOC. NO. UG204 NOVEMBER 2008 TILERA CORPORATION
  • 2. COPYRIGHT: 2008 COPYRIGHT HOLDER: TILERA® CORPORATION CREATION DATE: 2008-10-15 REV DATE: 2008-10-22 KEYWORDS: TILE64™, TILEPRO64™, TILE PROCESSOR™, TILEXPRESS-64™, TILEXPRESS-20G™ PRODUCT NAME: MULTICORE DEVELOPMENT ENVIRONMENT (MDE) VERSION/RELEASE/MODIFICATION: 2.0/BETA/1 DOCUMENT NUMBER: UG204 © 2006-2008 Tilera Corporation. All rights reserved. Printed in the United States of America. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, except as may be expressly permitted by the applicable copyright statues or in writing by the Publisher. The following are trademarks of Tilera Corporation: Tilera, Embedding Multicore, The Multicore Company, Tile Processor, TILE64, TileDirect, TILExpress, TILExpress-64, iMesh, Multicore Development Environment, Gentle Slope Programming, iLib, and the Tilera logo. All other trademarks and/or registered trademarks are the property of their respective owners. Third-party software: The Tilera IDE makes use of the BeanShell scripting library. Source code for the BeanShell library can be found at the BeanShell website (http://www.beanshell.org/developer.html). This document contains advance information on Tilera products that are in development, sampling or initial production phases. This information and specifications contained herein are subject to change without notice at the discretion of Tilera Corporation. No license, express or implied by estoppels or otherwise, to any intellectual property is granted by this document. Tilera disclaims any express or implied warranty relating to the sale and/or use of Tilera products, including liability or warranties relating to fitness for a particular purpose, merchantability or infringement of any patent, copyright or other intellectual property right. Products described in this document are NOT intended for use in medical, life support, or other hazardous uses where malfunction could result in death or bodily injury. THE INFORMATION CONTAINED IN THIS DOCUMENT IS PROVIDED ON AN “AS IS” BASIS. Tilera assumes no liability for damages arising directly or indirectly from any use of the information contained in this document.
  • 3. MDE Getting Started i Tilera Confidential — Subject to Change Without Notice Preface Intended Audience This Getting Started guide is intended for new users of the Multicore Development Environment (MDE) from Tilera Corporation. It will help software developers install the MDE and get up and running quickly. This guide provides only a brief introduction to the MDE itself. For more detailed information, see the MDE User's Guide. System Requirements See the Release Notes for hardware, software, and operating system requirements for your particular MDE release. Product Collateral The following product documentation is available from Tilera Corporation: • MDE Release Notes, UG208 • MDE Getting Started, UG204 • Migrating to the TILEPro Processor Family, UG221 • MDE User's Guide, UG201 • Programming the Tile Processor, UG205 • MDE Optimization Guide, UG105 • iLib API Reference Manual, UG202
  • 4. ii MDE Getting Started Tilera Confidential — Subject to Change Without Notice • MDE NetIO API Reference Manual, UG212 • MDE Tile Processor Application Binary Interface (ABI) Reference Manual, UG213 • MDE Architecture-Specific API Reference, UG214 • MDE Profile Control API Reference, UG215 • MDE Simulator Control API Reference, UG216 • MDE Vector Library API Reference, UG217 • PCIe Driver Developer's Reference, UG219 • TILExpress-64 Card User's Guide, UG300 • TILExpress-20G Card User's Guide, UG301 • TILExpressPro-64 Card User's Guide, UG302 • TILExpressPro-20G Card User's Guide, UG303 • Tile Processor Architecture Overview, UG100 Notation Conventions The following table lists notation conventions used in this document. Convention Description {this | that} Alternative required items in syntax descriptions appear within curly brackets and separated by vertical bars. Read the example as this or that; one or the other is required. [this | that] Optional items in syntax descriptions appear within square brackets and separated by vertical bars. Read the example as an optional this or that. [this, ...] Optional item lists in syntax descriptions appear within brackets delimited by commas and terminated with an ellipsis. Read the example as an optional, comma-separated list of this. $ This is the system prompt for the host. It appears for command-line examples that are meant to run on the host PC.
  • 5. MDE Getting Started iii Tilera Confidential — Subject to Change Without Notice Contact Information # This is the system prompt for the Tile Processor. It appears for command-line examples that are meant to run on the Tile Processor. command Command names appear in the Minion Pro font. system output System output appears in the Courier New font. filename Non-keyword placeholders (whose values should be replaced with an actual value) appear in italics. GUI item Graphical User Interface (GUI) items, such as button or menu names, appear in the Minion Pro font in bold. new term Important words or phrases appear in italics the first time they are introduced. ${TILERA_ROOT} This is the root of the Tilera MDE installation directory. Tilera Corporation Information: info@tilera.com Web Site: http://www.tilera.com Headquarters: Research and Development: 2333 Zanker Road San Jose, CA 95131 USA +408.383.9292 Phone +408.383.9225 Fax 1900 West Park Drive, Suite 290 Westborough, MA 01581 USA +508.616.9300 Phone +508.616.9306 Customer Support: Email your questions to: support @tilera.com Convention Description
  • 6. iv MDE Getting Started Tilera Confidential — Subject to Change Without Notice
  • 7. CONTENTS MDE Getting Started v Tilera Confidential — Subject to Change Without Notice INSTALLING THE MDE .............................................................................................1 Installing the PCIe Driver for TILExpress Cards ..................................................................................3 Verifying the MDE Installation .............................................................................................................4 MDE Directory Structure ......................................................................................................................5 Using the Documentation ......................................................................................................................7 Using the Online Help ...........................................................................................................................8 GETTING STARTED WITH THE IDE .......................................................................11 Eclipse Terminology ...........................................................................................................................14 Tilera Extensions to Eclipse ................................................................................................................15 Tilera-Specific Perspectives .............................................................................................................15 Tilera-Specific Views .......................................................................................................................16 Launch Configuration Type ..............................................................................................................16 BUILDING PROJECTS IN THE IDE ........................................................................17 Setting Up MDE Installation Descriptions ..........................................................................................18 TILERA COMMAND-LINE INTERFACE ..................................................................23 Getting Help on MDE Commands ......................................................................................................23 Running Example Programs on the Hardware ....................................................................................24 Running the Single-Tile Example on Hardware ...............................................................................25 Running the Multi-Tile Example on Hardware ................................................................................25 Running Example Programs on the Simulator ....................................................................................26 Running the Single-Tile Example on the Simulator .........................................................................27 Running the Multi-Tile Example on the Simulator ..........................................................................27 Options Used in Example Programs ...................................................................................................28 FREQUENTLY ASKED QUESTIONS ......................................................................31 FAQs About the IDE ...........................................................................................................................31 FAQs About the Command-Line Tools ..............................................................................................34
  • 8. vi MDE Getting Started Tilera Confidential — Subject to Change Without Notice
  • 9. 1 1 Installing the MDE PREREQUISITE If your site has purchased a TILExpress™ card, install the card and verify that it has been properly installed as described in the relevant Installation Sheet before beginning the MDE software installation procedure outlined below. TASK 1. Open an Xterm or terminal window. 2. Login as the root user. 3. Copy each tar archive that you plan to install to the directory where you intend to install the MDE. ADDITIONAL INFORMATION: If your site has purchased a TILExpress card, the direc- tory where you are installing MDE must be cross-mounted so that it is acces- sible fromboththe PC inwhich thecard is installed and any development host on which the IDE or command-line tools are run. These two may not be the same, depending on your particular site. • One possible choice might be /home/tilera/. • Another choice could be /opt/, which requires root access. 4. Go to your installation directory. $ cd /installdir/ 5. Do one of the following: • If your tar file is encrypted, use the following GNU Privacy Guard (GPG) command to decrypt it, substituting your software version number (for example, 2.0.0) for version: $ gpg TileraMDE-version.tar.bz2.gpg • Otherwise, skip this step. 6. Unpack the installation tar file, passing the -j option to the tar command. This option is required because Tilera installation files are compressed using the bzip2 format.
  • 10. INSTALLING THE MDE 2 $ tar -xjf TileraMDE-version.tar.bz2 STEP RESULT: Two MDE installation directories are installed, one for the TILE64™ chip architecture and one for the TILEPro (TILEPro64™ or TILEPro 36™) chip architecture: • /installdir/TileraMDE-version/tile64 • /installdir/TileraMDE-version/tilepro 7. Repeat steps 4 and 6, above for each archive you wish to install. 8. Decide which chip architecture should be the default: • For hardware, this depends on the actual chip on which your applica- tion will run, either TILE64 or TILEPro. • For the simulator, this depends on the chip architecture you want to simulate, again either TILE64 or TILEPro. 9. Command-line users: create the TILERA_ROOT environment variable and point it to the MDE installation for the appropriate architecture using one of the following commands, depending on the type of shell you are using. ADDITIONAL INFORMATION: The tiledir portion of the path in the following examples refers to either the /tile64/ or the /tilepro/ subdirectory. • Bourne shell: $ export TILERA_ROOT=$HOME/installdir/TileraMDE-version/tiledir • C shell: $ setenv TILERA_ROOT $HOME/installdir/TileraMDE-version/tiledir 10. Command-line users: add the MDE installation binary directory to your PATH environment variable using one of the following commands, depending on the type of shell you are using. ADDITIONAL INFORMATION: In the following examples, the PATH is set in two lines so that these snippets can be run more than once (for example, in a login or init script) without adding multiple copies of TILERA_ROOT to your PATH. • Bourne shell: $ if [-z "$PATH_BASE"] ; then export PATH_BASE=${PATH} ; fi $ export PATH="${TILERA_ROOT}/bin:${PATH_BASE}" • C shell: $ if ( ! $?PATH_BASE ) setenv PATH_BASE $PATH $ setenv PATH ${TILERA_ROOT}/bin:${PATH_BASE} ADDITIONAL INFORMATION: Youcanalsocreatescriptsnamedtile64 ortilepro that contain these commands and then invoke one or the other script based on which chip you are using to configure the TILERA_ROOT and PATH environ- ment variables correctly. STEP RESULT: Running command-line tools like tile-cc and tile-gdb is now essentially the same as prior to the introduction of the TILEPro chip.
  • 11. INSTALLING THE MDE INSTALLING THE PCIE DRIVER FOR TILEXPRESS CARDS 3 Remember that when switching between chip architectures (TILE64 or TILEPro), it is always necessary to reset the TILERA_ROOT and PATH environ- ment variables to the appropriate installation directory. 11. IDE users: Setup is slightly more flexible. 12. If upgrading from an earlier MDE release, rebuild any existing applica- tions that were built with the earlier release with the current release. RESULT: The MDE software is installed on the host PC and the following environment variables are properly set for the desired chip architecture (TILE64 or TILEPro): 1) The TILERA_ROOT environment variable is set to the location of the MDE installation for the desired chip architecture. 2) The PATH environment variable includes the location of the MDE instal- lation binaries for the desired chip architecture. RELATED LINKS: Running Example Programs on the Hardware Installing the PCIe Driver for TILExpress Cards This topic describes how to install the PCIe driver for TILExpress™ cards. NOTE: The Tile Processor PCIe endpoint driver for the current MDE release is incompatible with the host driver from earlier MDE versions. If your site has a TILExpress card that is running software older than this release, you must update the PCIe driver to a newer version. If you are using an OS version older than Red Hat Enterprise Linux (RHEL) 4, you must run tile-module-compile to build the PCIe driver for your OS version. NOTE: Always run the PCIe driver installation script described below from the installation that matches the Tile Processor™ chip (tile64 or tilepro) that you will ultimately be using. TASK 1. Login as root and run the PCIe device driver installation script. $ ${TILERA_ROOT}/lib/modules/tile-module-install ADDITIONAL INFORMATION: After running the PCIe driver installation script, a power cycle of the PC is required.
  • 12. INSTALLING THE MDE VERIFYING THE MDE INSTALLATION 4 2. Power down the system, wait 10 seconds, and then power the system back up. 3. Verify that the PCIe driver has been properly installed and the card is available. $ grep tilepci /proc/devices ADDITIONAL INFORMATION: The file /proc/devices lists the currently available devices. STEP RESULT: If the card is installed and available, the above command returns an entry such as: 254 tilepci 4. If you have connected a cable from the console output of the PCIe card to the serial port on the host PC, create a file named /etc/tilepciN.conf, where N is the PCIe card number (0, 1, etc.). This file is expected to contain a line such as serial=/dev/ttySO. ADDITIONAL INFORMATION: If the tilepciN.conf file exists at boot time, the PCIe driver creates a symbolic link named /dev/tilepciN/serial (again where N is the card number), which points to the serial device named above, in this case /dev/ttySO. Tilera's tools now look for the /dev/tilepciN/serial symbolic link instead of requiring you to specify --console-device /dev/ttySO on the tile-monitor command line. Installing a serial cable is not required to run applications on Tilera hardware. However, it is required to see boot-time output from the operating system, which is sent through the console serial port. This output can be helpful for debugging boot-time issues in your application. 5. If you want to see boot-time output from the OS, change permissions on /dev/ttyS0 to make it both readable and writeable to users. $ chmod 666 /dev/ttyS0 RESULT: The PCIe driver for the TILExpress card is properly installed and the card is available. If you have made the serial port readable and writeable, boot-time output from the OS is displayed on the console when the card is booted. Verifying the MDE Installation After installing the MDE software, verify the installation to ensure that it is working properly.
  • 13. INSTALLING THE MDE MDE DIRECTORY STRUCTURE 5 NOTE: If your site has purchased a TILExpress™ card, you can verify the MDE installation using both the hardware and the simulator. Even if you don't have the hardware, you can still perform the verification using the simulator. TASK 1. Do one of the following: • If your site has purchased a TILExpress™ card, run the following command on the PC in which the corresponding hardware is installed: $ ${TILERA_ROOT}/bin/tile-monitor --pci -- cat /proc/version • If your site did not purchase a TILExpress card, use this command to verify the installation using the simulator: $ ${TILERA_ROOT}/bin/tile-monitor --simulator --image 2x2 -- cat /proc/version NOTE: The simulator test can be run anywhere. 2. If you are installing more than one chip architecture (tile64 and/or tilepro), repeat the hardware or simulator verification command for each platform, with the TILERA_ROOT environment variable set appro- priately. MDE Directory Structure The MDE software is delivered as a compressed tar archive with a root directory of /TileraMDE-version/, where version is the version number of the installation (for example, 2.0). The topmost directory in the unpacked directory structure for each tar file is the chip architecture: /tile64/ or /tilepro/, depending on the type of chip in use. You can unpack them both in the same parent directory without fear of one tar file overwriting the content of the other. Once the tar archive is unpacked, the result is a directory structure with the following heirarchy: • README file • bin/: Tools for development using either the IDE or the command line: – tile-as: Assembler – tile-cc and tile-c++: Tilera C and C++ compilers
  • 14. INSTALLING THE MDE MDE DIRECTORY STRUCTURE 6 – tile-eclipse: Eclispe-based IDE – tile-gdb: Debugger – tile-ld: Linker – tile-monitor: Command-line execution tool – tile-opannotate: OProfile source code annotation tool – tile-ophelp: Displays a list of Tilera hardware events that can be used with OProfile. NOTE: The displayed event list depends on the installation (tile64 or tilepro) from which this command is launched. – tile-opreport: OProfile reporting tool – tile-trace-view: Tilera Trace Viewer, a GUI viewer – Other miscellaneous tools • doc/: Online documentation – index.html: Tilera MDE Document Index, with links to the electronic documentation, including user guides, application notes, technical notes, tools documentation, and real-time library reference manuals. – html/: HTML documentation – pdf/: PDF documents • etc/: – ProfileMetadata.xml – sdk-version – tile-trace-view-win32.zip • examples/: Examples of code you can use to test the installation, and to learn how to use some of Tilera' application programming interfaces. – getting_started/: Single and multi-tile Hello World examples that are explained in the Getting Started guide, UG204, and the MDE tutorial provided in the IDE online help. – hpi/: Example using the Host Port Interface (HPI), a high-speed parallel port. The HPI driver is described in Section 6.7 and a code listing of the example is provided in Appendix B of the the System Programmer's Guide, UG209. – ili_api/: Examples using the iLib API, explained in the iLib API Reference Manual, UG202.
  • 15. INSTALLING THE MDE USING THE DOCUMENTATION 7 – netio/: Examples using the NetIO API, explained in the NetIO API Reference Manual, UG212. – pci/: An example of how to use the Fast PCIe API, explained in the Fast PCIe API Application Note, AN024. – programming_guide/: Examples used in the Programming the Tile Processor manual, UG205. • include/: Header files for programming with iLib and the standard C library • lib/: Libraries and software used by the development tools – boot/: Operating system bootrom files and simulator platform image files • man/: Manual pages for development tools • share/: – oprofile/tile/tile*/: Events and unit masks used by the OProfile tool • src/: Tar archive files with source code for various software components. • tile/: Tile Processor architecture-specific files – bin/, sbin/, usr/bin/, usr/sbin/: Native Linux commands – boot/: Operating system components – lib/: Libraries for programming with iLib, the standard C library, or other libraries; Eclipse libraries, compiler support – usr/lib/: Shared libraries Using the Documentation Tilera provides the following product documentation: • IDE online help. See Using the Online Help. • Man pages. Tilera provides man pages in the ${TILERA_ROOT}/man/ directory. To view a man page for a particular tool, type: $ tile-man tool-name • Tilera MDE Document Index (${TILERA_ROOT}/doc/index.html). This HTML page has links
  • 16. INSTALLING THE MDE USING THE ONLINE HELP 8 to all of the MDE online documentation, including manuals, technical notes, and documentation on tools and real-time libraries. • User and reference manuals in PDF format that you can access from the Tilera MDE Document Index. For a list of available documents, see the Preface. NOTE: You can use the free Adobe Reader to read, search, and print PDF files. For information on how to download and install the Adobe Reader, go to the Adobe website (http://www.adobe.com). Using the Online Help This topic describes how to access and use the online help available in the IDE. PREREQUISITE The Tilera IDE must be up and running before you can access the online help. To start the IDE, assuming you have added ${TILERA_ROOT} to your path, you can simply issue the following command: $ tile-eclipse To access the online help from the IDE, follow these steps. TASK 1. Select the menu item Help > Help Contents to display the Eclipse Plat- form Help window.
  • 17. INSTALLING THE MDE USING THE ONLINE HELP 9 2. View the user guides, available in the Contents pane: • Tilera IDE User Guide—Provides an overview of how to get started: setup, creating a project, running and debugging on the simulator, and profiling an application. • Workbench User Guide—Provides an introduction to using an Eclipse-based IDE. Explains the workbench, perspectives, editors, views, external tools, team programming, and accessibility features. • C/C++ Development User Guide—Discusses using the CDT plugin exten- sions to Eclipse for C program development. AFTER COMPLETING THIS TASK: Tilera recommends that new users begin with the Getting Started topic in the Tilera IDE User Guide, which introduces the IDE and the extensions to Eclipse that Tilera has added for multi-tile development and debugging.
  • 18. INSTALLING THE MDE USING THE ONLINE HELP 10
  • 19. 11 2 Getting Started with the IDE The Tilera Integrated Development Environment (IDE) provides an integrated environment for developing, debugging, and profiling applications on Tilera hardware and simulator platforms. The Tilera IDE is based on the Eclipse development environment. Also known as the Multicore Development Environment (MDE), the Tilera IDE extends Eclipse by adding the C Development Toolkit (CDT) plugin, plus a number of Tilera-proprietary extensions to both Eclipse and CDT. If you have not used an IDE (or Eclipse) before, you might want to browse through an introductory text, such as Eclipse Distilled by David Carlson. NOTE: Eclipse is a Java-centric development environment, so most of the examples in books on Eclipse tend to be Java-centric. Read such introductory material with the goal of becoming comfortable with Eclipse as a development environment, rather than as a guide for C/C++ programming in Eclipse. The following figure shows an example of what the IDE main window (also known as the workbench) looks like when an application is being debugged.
  • 20. GETTING STARTED WITH THE IDE 12 Figure 1: Tilera IDE TASK 1. To start the IDE for the first time, enter the following command at the OS command prompt: $ tile-eclipse STEP RESULT: The standard Eclipse Welcome screen briefly appears.
  • 21. GETTING STARTED WITH THE IDE 13 Figure 2: IDE Welcome Screen NOTE: If you have multiple installation directories (for example, both /tile64/ and /tilepro/ directories), there is a tile-eclipse binary in the ${TILERA_ROOT}/bin/ directory of each one. The IDE is designed so that it can be used with any MDE installation from the same release, so it does not matter which copy of tile-eclipse you use as long as it comes from one of the installation directories from the current release. Do not use a tile-eclipse from a newer or later MDE release. 2. The Tilera plug-in detects that you are running the IDE for the first time and automatically loads a number of perspectives for you to use in developing Eclipse applications. STEP RESULT: A workspace directory is created for you in the following location: ${HOME}/.tilera/workspace RESULT: Once you have completed these initial setup steps, the IDE is ready to use in developing, running, and profiling applications.
  • 22. GETTING STARTED WITH THE IDE ECLIPSE TERMINOLOGY 14 Eclipse Terminology RELATED LINKS: Tilera Extensions to Eclipse Term Description Workspace directory A default root directory that Eclipse uses as a location for projects and the preferences, settings, and project-related metadata that are generated as you use the IDE. When you start up the Tilera IDE, a workspace directory is automatically created for you in ${HOME}/.tilera/workspace. If you have multiple MDE installations (for example, both /tile64/ and /tilepro/), tile-eclipse uses the same .tilera/workspace for both. You can have projects in the same workspace configured for either installation, or for the Default installation (the one from which tile-eclipse was launched). Project directory A container for the sources, makefiles, and other files that relate to a single application. Eclipse also uses this directory to store some IDE metadata, such as the project description and project-specific settings. View A specific window in the IDE, such as the Debug view or the Tilera Grid view. A view typically has a tab, on which the name of the view appears. See also The Targets View and The Grid View in the IDE online help. Perspective A named set of views that serve a common perspective, such as the Tilera Debug perspective or the Tilera Profile perspective. See also Tilera MDE Perspectives in the IDE online help. Launch configuration A description of the applications you want to invoke using the IDE's display and debugging facilities, along with any arguments, settings, or environment information needed to invoke it. You create a launch configuration to run or debug an application in the IDE. In debug mode, the launch configuration also specifies any debugging-related options.
  • 23. GETTING STARTED WITH THE IDE TILERA EXTENSIONS TO ECLIPSE 15 Tilera Extensions to Eclipse The Tilera IDE adds several user-interface elements to the default Eclipse IDE. Tilera-Specific Perspectives The Tilera MDE adds the following perspectives to the default Eclipse IDE. You select a perspective using the Author, Debug, or Profile button in the upper right corner of the IDE, as shown in the following figure. Figure 3: Choosing a Perspective Tilera-Specific Perspective Description Author perspective For authoring Tilera applications Debug perspective For running and debugging code Profile perspective For profiling code and examining the results of profile runs
  • 24. GETTING STARTED WITH THE IDE TILERA EXTENSIONS TO ECLIPSE 16 Tilera-Specific Views The Tilera MDE adds the following views to the default Eclipse IDE. Launch Configuration Type Tilera also adds a launch configuration type for cross-platform applications that run on Tilera hardware. A launch configuration type defines a set of tabs that appear in the Run/Debug dialog and allow you to specify parameters for running or debugging a program. Tilera-Specific View Description Tilera Grid view Displays the state of the Tile Processor for the currently selected launch, if any Tilera Profile view Displays and explores the content of profile XML data files generated by applications running on the Tilera hardware simulator
  • 25. 17 3 Building Projects in the IDE The MDE IDE supports two types of projects: • A Standard Make project, for which you supply the C/C++ sources and your own makefile to build them. • A Managed Make project, for which you supply the C/C++ sources but let the IDE take care of creating and updating the makefile structure for you. The example programs in the software kit already have their own makefiles, so this tutorial demonstrates how to build a Standard Make project. The Hello World Multicore Tutorial describes how to create and build a simple program called hello_world_multicore, which runs on multiple tiles. The source files for this program are located in the $TILERA_ROOT/tile*/ examples/getting_started/hello_world_multicore/ directory. You can access the Hello World Multicore Tutorial from the online help in the IDE by seleting the menu item Help > Tilera IDE User Guide > 'Hello World Multicore' Tutorial.
  • 26. BUILDING PROJECTS IN THE IDE SETTING UP MDE INSTALLATION DESCRIPTIONS 18 Setting Up MDE Installation Descriptions NOTE: If you have multiple MDE installations (for example, both /tile64/ and /tilepro/), you can set up an MDE Installation Description for each one using the MDE Installations Preference page in the IDE. This is only necessary if you have multiple MDE installations and you want to be able to choose between them within the IDE when building projects or running applications.
  • 27. BUILDING PROJECTS IN THE IDE SETTING UP MDE INSTALLATION DESCRIPTIONS 19 To create installation descriptions for multiple MDE installations, follows these steps: 1) In the IDE, select the menu item Window > Preferences. This displays the Preferences dialog. 2) In the tree view on the left-hand side of the Preferences dialog, select Tilera MDE.
  • 28. BUILDING PROJECTS IN THE IDE SETTING UP MDE INSTALLATION DESCRIPTIONS 20 3) The default location is the MDE installation from which tile-eclipse was launched. To add another installation location, click the Add button. 4) In the Name field of the Add MDE Installation dialog, enter a display name for the installation. 5) For Pathname, either click Browse and select the desired installation directory or manually enter the TILERA_ROOT path. (If the entered path- name does not refer to an existing, valid installation directory, the entire row is displayed in red.) Click OK. The new MDE installation is added to the displayed list in the Preferences dialog. 6) If you want to change the display name of an installation location, select it and click the Edit button. This displays the Edit MDE Installation dialog in which you can edit the display name as desired.
  • 29. BUILDING PROJECTS IN THE IDE SETTING UP MDE INSTALLATION DESCRIPTIONS 21
  • 30. BUILDING PROJECTS IN THE IDE SETTING UP MDE INSTALLATION DESCRIPTIONS 22
  • 31. 23 4 Tilera Command-Line Interface This topic explains how to use the makefiles and compiler supplied with MDE together with the tile-monitor command to run the example programs. The installation includes both single-tile and multi-tile examples for hardware and simulator platforms. The examples assume that you have already set up your TILERA_ROOT and PATH environment variables. Getting Help on MDE Commands Online help is available for commands in the MDE command-line interface. The commands generally follow the Linux convention of providing a --help option, which summarizes the command's usage. To see help for the tile-cc command, for example, use: $ tile-cc --help The tile-monitor command has three kinds of help: $ tile-monitor --help-examples $ tile-monitor --help-commands $ tile-monitor --help-options Most commands also have man pages. To see man pages for the tile-cc or tile-monitor command, for example, use: $ tile-man tile-cc or
  • 32. TILERA COMMAND-LINE INTERFACE RUNNING EXAMPLE PROGRAMS ON THE HARDWARE 24 $ tile-man tile-monitor Most commands also have HTML files explaining their purpose and usage in the Tilera Multicore Development Environment (MDE) Document Index, located at ${TILERA_ROOT}/tile*/doc/index.html. Running Example Programs on the Hardware The examples are provided in the following directories of the MDE install tree: • /path/examples/getting_started/hello_world/ • /path/examples/getting_started/hello_world_multicore/ where /path/ refers to either the ${TILERA_ROOT}/tile64/ or the ${TILERA_ROOT}/tilepro/ subdirectory, depending on the chip you are using. Before you can use the examples, you need to copy these two directories to your own working directories. For example, $ cp -r /path/examples/getting_started/ hello_world /tmp/single $ cp -r /path/examples/getting_started/ hello_world_multicore /tmp/multi To run the examples that follow, you will go to the /tmp/single/hello_world/ subdirectory: $ cd /tmp/single/hello_world and to the /tmp/multi/hello_world_multicore/ subdirectory: $ cd /tmp/multi/hello_world_multicore The multi-tile example uses iLib™ library functions to launch multiple instances of itself across multiple tiles. It also uses an iLib barrier routine to ensure that the ”hello world” messages from the various tiles are not intermixed. The example programs for the hardware platform use the run_pci target. You must have a PCIe card installed to run these example programs sucessfully. RELATED LINKS: Installing the PCIe Driver for TILExpress Cards
  • 33. TILERA COMMAND-LINE INTERFACE RUNNING EXAMPLE PROGRAMS ON THE HARDWARE 25 Running the Single-Tile Example on Hardware To run the single-tile example program on the PCIe card, follow these steps: TASK 1. Change to the /hello_world/ subdirectory in your working directory, for example: $ cd tmp/single/hello_world 2. Use the run_pci target of the provided makefile to build the example and run it on the hardware. $ make run_pci RESULT: /path/bin/tile-cc -g -c hello_world.c -o hello_world.o /path/bin/tile-cc hello_world.o -lilib -ltmc -o hello_world /path/bin/tile-monitor --pci --tile 2x2 --batch-mode --mkdir /opt/test --cd /opt/test --upload hello_world hello_world -- hello_world Hello World! Running the Multi-Tile Example on Hardware To run the multi-tile example program on the PCIe card, follow these steps: TASK 1. Change to the /hello_world_multicore/ subdirectory in your working directory, for example: $ cd tmp/multi/hello_world_multicore 2. Use the run_pci target of the provided makefile to build the example and run it on the hardware. $ make run_pci RESULT: /path/bin/tile-cc -g -c hello_world.c -o hello_world.o /path/bin/tile-cc hello_world.o -lilib -ltmc -o hello_world
  • 34. TILERA COMMAND-LINE INTERFACE RUNNING EXAMPLE PROGRAMS ON THE SIMULATOR 26 /path/bin/tile-monitor --pci --tile 4x2 --batch-mode --mkdir /opt/test --cd /opt/test --upload hello_world hello_world -- hello_world Process 0: Hello, Brave New World! Process 1: Hello, Brave New World! Process 4: Hello, Brave New World! Process 6: Hello, Brave New World! Process 5: Hello, Brave New World! Process 7: Hello, Brave New World! Process 3: Hello, Brave New World! Process 2: Hello, Brave New World! Process 3: Hello Again, World! Process 1: Hello Again, World! Process 4: Hello Again, World! Process 2: Hello Again, World! Process 7: Hello Again, World! Process 6: Hello Again, World! Process 5: Hello Again, World! Process 0: Hello Again, World! The output from each process is displayed. NOTE: The output is generated in sequential order. Depending on how the printf() output lines are buffered and returned from the chip to the tile-monitor host, the lines may be interleaved in exactly the pattern shown above, but you should see two lines from each process. Running Example Programs on the Simulator The example programs for the simulator platform use the run target. Once you have run these simple examples, see the MDE User's Guide, UG201, for more information on how to use the simulator.
  • 35. TILERA COMMAND-LINE INTERFACE RUNNING EXAMPLE PROGRAMS ON THE SIMULATOR 27 Running the Single-Tile Example on the Simulator To run the single-tile example program on the simulator platform, follow these steps: TASK 1. Change to the /hello_world/ subdirectory in your working directory, for example: $ cd tmp/single/hello_world 2. Use the run target of the provided makefile to build the example and run it on the simulator. $ make run RESULT: /path/bin/tile-monitor --image 2x2 --functional --batch-mode --mkdir /opt/test --cd /opt/test --upload hello_world hello_world -- hello_world Hello World! Running the Multi-Tile Example on the Simulator To run the multi-tile example on the simulator platform, follow these steps: TASK 1. Change to the /hello_world_multicore/ subdirectory in your working directory, for example: $ cd tmp/multi/hello_world_multicore 2. Use the run target of the provided makefile to build the example and run it on the simulator. $ make run RESULT: /bin/tile-monitor --image 4x4 --tile 4x2 --functional
  • 36. TILERA COMMAND-LINE INTERFACE OPTIONS USED IN EXAMPLE PROGRAMS 28 --batch-mode --mkdir /opt/test --cd /opt/test --upload hello_world hello_world -- hello_world Process 0: Hello, Brave New World! Process 4: Hello, Brave New World! Process 3: Hello, Brave New World! Process 5: Hello, Brave New World! Process 2: Hello, Brave New World! Process 7: Hello, Brave New World! Process 1: Hello, Brave New World! Process 6: Hello, Brave New World! Process 0: Hello Again, World! Process 1: Hello Again, World! Process 2: Hello Again, World! Process 5: Hello Again, World! Process 4: Hello Again, World! Process 7: Hello Again, World! Process 3: Hello Again, World! Process 6: Hello Again, World! The output from each process is displayed. NOTE: The output is generated in sequential order. Depending on how the printf() output lines are buffered and returned from the chip to the tile-monitor host, the lines may be interleaved in exactly the pattern shown above, but you should see two lines from each process. Options Used in Example Programs The various options to the tile-monitor command used in the example programs (hello_world and hello_world_multicore) have the following effects: 1) The examples use one or the other of the following options, depending on whether they are running on the hardware or the simulator platform: --pci option (hardware platform only)—Connects to the PCIe card. --image option (simulator platform only)—Requests a simulated chip of the specified size (for example, 2x2 for single-tile or 4x4 for multi-tile).
  • 37. TILERA COMMAND-LINE INTERFACE OPTIONS USED IN EXAMPLE PROGRAMS 29 2) --tile option—Restricts the application to a grid of tiles of the specified size (for example, 4x2 creates a grid 4 tiles wide and 2 tiles high). 3) --functional option (simulator platform only)—Enables functional mode, which is faster than the default timing-accurate mode. 4) --batch-mode option—Runs the program in batch mode, which means that tile-monitor exits when finished instead of entering interactive mode. 5) --mkdir option—Creates a directory (for example, /opt/test/) on the Linux file system on either the hardware or the simulator target. 6) --cd option—Changes to the specified directory (for example, /opt/test/) 7) --upload option—Uploads the specified program (for example, hello_world) from the source to the target. 8) -- option (two dashes followed by a space)—Runs the program specified after the space (for example, hello_world) when the current process is finished.
  • 38. TILERA COMMAND-LINE INTERFACE OPTIONS USED IN EXAMPLE PROGRAMS 30
  • 39. 31 5 Frequently Asked Questions This topic provides answers to frequently asked questions (FAQs) with regard to the MDE. FAQs About the IDE When I try to start tile-eclipse, it says that the workspace is already in use. What should I do in this case? The tile-eclipse IDE is based on Eclipse, which has a guard mechanism to enforce the rule that at most one Eclipse instance can be running on a given workspace at any time. First, make sure that you do not already have an instance of tile-eclipse running on the same host. Remember that if you are running under X Windows, the application window might be displayed on a different screen. For example, if you are trying to run tile-eclipse from home and have left an instance running at work, this would occur. Next. check your process listing (for example, with ps -wx). Look for any rogue eclipse or java instances. If Eclipse was not shut down properly, a windowless process may have been left running. Kill any such processes. When the Eclipse process is shut down, it should release its lock on the workspace directory. If the above does not work, or there are no eclipse or java processes currently running, manually delete the .lock file from your workspace directory. This file should be located in the following location: ${HOME}/.tilera/workspace/.metadata/.lock You should now be able to start tile-eclipse normally.
  • 40. FREQUENTLY ASKED QUESTIONS FAQS ABOUT THE IDE 32 I am unable to edit or rename files in the /examples/ directory. What is wrong? The MDE files may have been installed read-only, or may be owned by root. The simplest workaround for this is to make your own copy of the /examples/ directory in your home directory. This also allows you to edit and tweak the example without affecting other users. If I delete a project from the workspace, can I get it back? When you delete a project from the Eclipse workspace, if you answer 'no' in the dialog that asks whether you want to delete the actual project files, then the project content is still there but not visible to Eclipse. To make the project visible again, you must reimport it as follows: a) Select the menu item File > Import. b) Select the menu item General > Existing Projects into Workspace on the Import dialog, then click Next. c) In the Select root directoryoption on the next tab, either tpye or browse to the old project directory. d) Verify that the project name appears in the Projects list. e) Click Finish to import the project. I have closed one of the perspectives, so its name is no longer visible. How do I get it back? To get back a closed perspective, follow these steps: a) Select the menu item Window > Open Perspective > Other.... b) Select the desired perspective name from the list, and click OK. NOTE: There are two Debug perspectives. Choose the one with the Tilera® logo. The other is the generic Eclipse Debug perspective, which lacks Tilera-specific debugging views. I have rearranged views in one of the perspectives. How do I restore them to their default positions? Right-click on the perspective name in the top-right corner of the IDE window, and select Reset from the menu. I have closed a view in one of the perspectives. How can I get it back? a) Select the perspective by clicking its name in the top-right corner of the IDE window. b) Select the menu items Window > Show View... and pick the view's name from the menu. If the view is not displayed on the menu, choose the Other... option and pick the view from the dialog.
  • 41. FREQUENTLY ASKED QUESTIONS FAQS ABOUT THE IDE 33 Why do Standard Make projects appear in the Make Targets view, while Managed Make projects do not? This is because with Managed Make projects, the IDE is managing the makefile for you, and it knows which targets it has defined. To build a Managed Make project, right-click the project and select Build Project from the popup menu. For Standard Make projects, you provide a makefile, so you need to tell the IDE which targets in your makefile you wish to use to build the project. To build a Standard Make project, select the appropriate target in the Make Targets view and double-click it. NOTE: The IDE automatically generates make targets only when a makefile happens to be found in the top level of a Standard Make project directory at project creation time. How do I run a program that consists of multiple executables? Specify the initial start-up executable in the Run/Debug dialog. This executable should spawn instances of the others (for example, through appropriate iLib™ calls). If the program is running on hardware, remember that you need to use the Files tab to upload all of the executables to the chip's virtual file system, otherwise the program will fail when it attempts to spawn an instance of an executable that is not there. Can I run an executable without having to create a project? Yes. To run an executable without creating a project, follow these steps: a) Open the Run/Debug dialog, and double-click Tilera Executable to create a launch configuration. b) On the Run tab, select the No Project radio button, and then enter the working directory and application path for your exectuable. To be able to view source files while debugging your executable, go to the Source tab and add the desired source directory paths. When I run a program, why do I receive an error such as the following: Error loading libcg.so: cannot restore segment prot after reloc: Permission denied You are probably running MDE on Fedora core 6 (or higher). This error is likely caused by the Security Enhanced feature of Linux (SELinux). There are two possible solutions: • Change the security permissions for the shared library, for example: $ cd ${TILERA_ROOT}/lib/tile-cc $ chcon -t texrel_shlib_t libcg.so
  • 42. FREQUENTLY ASKED QUESTIONS FAQS ABOUT THE COMMAND-LINE TOOLS 34 • Disable SELinux altogether. (Check with your system administrator first to make sure this is acceptable.) To disable SELinux, edit the /etc/sysconfig/selinux file and set SELINUX=disabled. FAQs About the Command-Line Tools I received the following error with a command-line tool. What does it mean? ERROR: The file '/dev/tilepci0/lock' is currently locked! This error happens if you try to run a new instance of tile-monitor when another instance of tile-monitor is already using the same PCIe card. Only one instance of tile-monitor can use a PCIe card at any one time. My application stopped for no apparent reason. Why is this? It is possible that your Tile Processor™ or PCIe card has exceeded the temperature threshold of 110° Celsius. The temperature monitoring daemon, tempmond, automatically shuts down the card in this situation to avoid damaging the hardware. Console messages provide advance warning whenever the temperature reaches 100° Celsius. To display console messages, run either the tile-console tool, or the tile-monitor --console-device console-serial-port command. (The console serial port typically is configured as /dev/ttySO.)