CoRE Simulation Models for Real-time Networks

Changes between Version 1 and Version 2 of ANDL_Documentation


Ignore:
Timestamp:
05/04/16 13:51:14 (3 years ago)
Author:
pmeyer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ANDL_Documentation

    v1 v2  
    11= ANDL Documentation =
    22
    3 Website work in progress...
     3== Basics ==
     4* '''Create new project:'''
     5   Create a new Project (File->New->Project). Choose a name.
     6* '''Create andl file:'''
     7   Right click on the src folder and select new->other->General->File. The filename must end with ``.andl''. When Eclipse asks to add the Xtext Nature to the project select yes.
     8* '''Configure network:'''
     9   The network configuration takes place in the empty andl file. Autocompletion (Ctrl+Space) is a great tool to support the process. It shows all possibilities the can be placed in the editing area.
     10* '''Generate simulation files:'''
     11   If the Process did not start automatically after saving the build process must be started (Ctrl+B) (right click on .andl file->Generate Network). After the build process is finished the simulation files can be found in the simulations folder of the project.
     12* '''Autoformatting:'''
     13   To initate the Autoformatting press Ctrl+Shift+F.
     14
     15== Language ==
     16The language contains three main components. They are types, settings and network. The first two are optional. The last one is the mandatory network description.
     17
     18=== types ===
     19Major elements of the network can instantiate a type to reduce the parameter redundancy in the network description part.  This major elements are ethernetLink, canLink, node, switch, gateway and message.
     20{{{
     21#!sh
     22types std {
     23    ethernetLink ETH_100MBIT {
     24        bandwidth 100Mb/s;
     25    }
     26       
     27    canLink CANBUS_500KBIT {
     28        bandwidth 500Kb/s;
     29    }
     30       
     31    switch ETH_SWITCH {
     32        hardwareDelay 8us;
     33    }
     34   
     35    message MAX_CANMSG {
     36        payload 8B;
     37    }
     38}
     39
     40types sntypes{
     41    message MSG extends std.MAX_CANMSG{
     42        sender canNode1;
     43        receivers canNode2;
     44    }
     45}
     46}}}
     47
     48=== settings ===
     49The optional settings part configures simulation file generation related parameters. For example the behavior of the automatic time-triggered scheduler. The following code shows how to deactivate the scheduling of time-triggered messages for the simulation configuration.
     50{{{
     51#!sh
     52settings{
     53    tteScheduling false;
     54}
     55}}}
     56
     57=== network ===
     58This is the mandatory part of the ANDL. It contains of 3 mandatory subsections. They are devices, connections and communication. The first one is used to describe the network participants. The second one sets the connection between them. In the last section all messages are defined that should traverse the network. The next example shows the start of the network component. The network name is specified as smallNetwork.
     59{{{
     60#!sh
     61network smallNetwork {
     62}}}
     63
     64==== devices ====
     65In the devices section network participants are configured. The syntax is like in the types component. On device can extend an device type.  In the following example are 2 canLink(canbus1, canbus2),1 ethernetLink(ethcable1), 1 switch(switch1), 2 gateways(gateway1, gateway2) and 2 nodes(canNode1, canNode2) defined. The semicolons can be replaced with an ``\{\}'' block for the definition of additional parameters.
     66{{{
     67#!sh
     68devices {
     69    canLink canbus1 extends std.CANBUS_500KBIT;
     70    canLink canbus2 extends std.CANBUS_500KBIT;
     71
     72    switch switch1 extends std.ETH_SWITCH;
     73    gateway gateway1;
     74    gateway gateway2;
     75       
     76    node canNode1;
     77    node canNode2;
     78}
     79}}}
     80
     81==== connections ====
     82The elements in the devices section can be used now to build the network infrastructure. Each connection is a member of a segment. Segments are later be used to define the different message representations. For Ethernet connections there are two network participants connected via one ethernetLink. For CAN connections one participant plugged to one canLink. The connections example shows to segements(backbone and canbus) for the individual connections. A special feature for ethernetLink is the ``new'' keyword. It enables the possibility to instance a new ethernetLink with a defined type. This reduces the configuration effort instead of defining each cable in the devices section.
     83{{{
     84#!sh   
     85connections{
     86    segment backbone {
     87        gateway1 <--> {new std.ETH_100MBIT} <--> switch1;
     88        gateway2 <--> {new std.ETH_100MBIT} <--> switch1;
     89    }
     90    segment canbus {
     91        gateway1 <--> canbus1;
     92        canNode1 <--> canbus1;
     93        gateway2 <--> canbus2;
     94        canNode2 <--> canbus2;
     95    }
     96}
     97}}}
     98
     99==== communication ====
     100Communication is defined over messages. Each message can enxtend a message type and has parameters like the devices. Additionaly a message has a mapping section. In this section the represantation in different parts of the networks is defined. There is no neccassary order of the mapping entires. At the moment parts are segements and gateways. In the following example are three messages(canmsg1, canmsg2 and canmsg3). All parameterize an period and extends a parameterized message type.  For canmsg1 the mapping says that the message is represented thrue the CAN id 1 in the canbus segment. In the backbone segment the message is represented by a best effort ethernet frame. Additionally the involved gateway are gateway1 and gateway2.
     101{{{
     102#!sh   
     103communication{
     104    message canmsg1 extends sntypes.MSG{
     105        period 10ms;
     106        mapping {
     107            canbus : can{id 1;};
     108            gateway1;
     109            backbone : be;
     110            gateway2;
     111        }
     112    }
     113               
     114    message canmsg2 extends sntypes.MSG{
     115        period 15ms;
     116        mapping {
     117            canbus : can{id 2;};
     118            gateway1;
     119            backbone : be;
     120            gateway2;
     121        }
     122    }
     123               
     124    message canmsg3 extends sntypes.MSG{
     125        period 20ms;
     126        mapping {
     127            canbus : can{id 3;};
     128            gateway1;
     129            backbone : be;
     130            gateway2;
     131        }
     132    }
     133}
     134}}}
     135At last the network section must be closed and it is ready for the generation process.
     136{{{
     137#!sh   
     138}
     139}}}
     140