This tutorial respects some writing conventions: •menus, buttonsetc.are written inbold (eg.Algorithm / New Algorithm Window,OK,Denition list); •command lines, SynDEx les, examplesetc.are written inComputer Modern (eg.-libs libs,amexesplloria/tut,! int o); To create an application workspace, run the SynDEx executab le, located at the root of your installation folder, with option-libs libs. See theSynDEx v7 User Manualfor more information. The examples presented in this tutorial are located in the su b-folderxemalpes/tutorial example is lo-. Each cated in its sub-folder. The example 7 is located in thel/iaamex/tesorut7elpmalpxe,elpmut/saxexample7_torial/eomon, andexamples/tutorial/example7 bifolders. _
Example 1 Algorithm, architecture, and adequation: •we create a sensor denition, an actuator denition, and a function denition. Then, we create an algorithm and dene it as main. Finally, we create in the main algorithm two references to the sensor denition, three references to the actuator denition, and one reference to the function denition, and we create data dependences between these references by connecting their p orts; •we create four different architectures: an architecture with one operator, an architecture with two operators and a SAM point-to-point communication medium, an architecture with three operators and a SAM multipoint co mmunication medium, an architecture with three operators and a RAM communicatio n medium; •we create constraints on the third architecture; •we perform the adequation of the main algorithm onto the thir architecture dened as main, without con- d straint and then with constraints. Example 2 Hierarchy in algorithm: •we create a function denition and a constant. Inside the function we create a reference to another function; inthatwaythisdenitionisdenedbyhierarchy.Then,wecreateathirdfunctionthatreferencesboth previous ones. Finally, we create an algorithm that referen ces the third function and dene it as main. In that way, the main algorithm references a hierarchical func tion; •we create parameters names for an operation, and assign valu to these parameters. es
5
Example 3 Delay in algorithm: •we create a delay denition; •we create a actuator, and a function and by connecting nmain algorithm by referencing a delay, a sensor, a them. Example 4 Repetition and library in algorithm: •by repeating a multiplication function on scalars:we create a multiplication function of a vector by a scalar rstly without any library, secondly with a library; •by repeating a multiplication function on vectors.we create a multiplication function of a matrix by a vector Example 5 Condition and nested condition in algorithm: •we create an algorithm conditioned by a data dependence, the value of which indicates the operation to be executed; •we create an algorithm conditioned by a data dependence, one operation of which is in turn conditioned (nested condition) by the same data dependence. Example 6 Algorithm, architecture, adequation, and code generation : • three functions, and a constant and by tors,we create a main algorithm by referencing a sensor, two actua connecting them; •we create an architecture with two operators of typeUand a communication medium of typeu/TCP; •we perform the adequation; •we perform the code generation, then we create manualy thelempxaex4m.6le (for operations not dened in libraries); •we create manualy them4mepmax.6elle (to dene the hostname) and theortom.x4le (for the main oper-ator); •we create manualy theileakefNGmU, then we execute the executives created after compilation. Example 7 Denition of the source code into the code editor window: •we add parameters to theconvfunction ofExample 6; • a generic processor then in case of an ofwe modify the code associated with this function rst in case architecture with heterogenous processors; •we create manualy theelpm4m.7mexale (to dene the hostname) and thero.mot4xle (for the main oper-ator); •we create manualy theeilefNGmUka;
6
•we perform the adequation, then we perform compilation, nally we compile the executives and launch the executables.
Denition of the source code in separateCles: •we dene the code of a new function in a.cle, •we dene the code of a new function in a.cle and we use a.hle.
Example 8 A complete realistic application from adequation to execution:
•the model of a complete application for two cars;we build •we perform the adequation; •we generate the code for each processor; •we compile and execute the code associated with each processor.
Example 9 A multiperiodic application:
•we build a basic multi-periodic application •we realize a mono-phase schedule •we realize a multi-phase schedule
7
Chapter 1
Example 1: algorithm, architecture, and adequation
1.1 The main algorithm
Figure 1.1:Algorithm / New Algorithm Window From the main window, choose theFile / Save asoption and save your rst application under a new folder (eg.rtiuatlomy_) with the namexemalp1e. ChooseAlgorithm / New Algorithm Window(cf.gure 1.1). It opens the edition window for algorithm denitions.
1.1.1 Denition of a sensor To create aninputsensor denition: •from the algorithm window, click on the+green button. It opens a dialog window, checkSensor(cf.gure 1.2). Type the sensor name and optionally a list of parameters for the sensor. For example typeinput, then
8
Figure 1.2:Dene Sensor
Figure 1.3:
Figure 1.4:
Name of the new sensor
Sensor denition window
9
Figure
1.5:
Contextual
Figure
1.6:
menu
Create
10
→
Add
Port
port
Figure 1.7: Sensor denition window after output port created
clickOK(cf.gure 1.3). It creates the denition of theinputsensor. To open it in denition mode, double click oninputin theDenition list(cf.gure 1.4); •ininputdenition mode, right click on the background and selectAdd port(cf.gure 1.5). It opens a dialog window for the port's direction, type, name and optio nally its size. For example type o! int, then clickOK(cf.gure 1.6). It creates the integer output porto(cf.gure 1.7) in the sensor denition window.
1.1.2 Denition of an actuator To create anoutputactuator denition: •from the algorithm window, click on the+green button→dialog window: checkActuatorthen typeoutput and clickOK; •double click onoutputin theDenition list. Then right click on its background and selectAdd port→ dialog window: i? int. ClickOK. It creates the integer input portiin the sensor denition window.
1.1.3 Denition of a function To create aitnoucpamtofunction denition: •from the algorithm window, click on the+green button→ checkdialog window:Functionthen type computationand clickOK; •double click oncnoatitmoupin theDenition list. Thenright click on its background and selectAdd port →dialog window: o int b ! int a ?? int. ClickOK. It creates the integer portsa,b, andoin the function denition window.
1.1.4 Denition of the main algorithm To create antimhglroAMainfunction denition: