Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The translation from the SCG with prioIDs to SCL_P is straightforward. Assignments and Conditionals are translated to their corresponding C-Code. Labels and gotos are used, if such a node is visited twice. Surface and their corresponding depth nodes are translated to pause statements. If the assigned prioID changes from one node to another, a prio(p) statement added. However, join, fork and entry nodes need more attention. For each fork node it is important to ensure, that the node, which has the highest prioID is translated first and the node which performs the join, which is the node with the lowest prioID assigned to its exit node is translated last. Additionally, for The labels for the threads are the names of the corresponding regions, if they exist and are unique. Otherwise a number is added to the region name or a new label is created. For each forkn with n < 1 a corresponding macro has to be generated. Likewise, a macro needs to be generated, if joinn joins more than one prioID. If another thread has a higher prioID than the exit node of the joining thread, this prioID will be scheduled first and therefore, join does not have to wait for that prioID to finish. However it might happen, that a thread stops because of a pause statement, then the prioID indicated by the corresponding depth node has to be considered by the join. If the prioID of a parallel thread is lower than the prioID of the joining node, it has to be considered as well.

 

 the prioID of a parallel thread is lower than the prioID of the joining node, it has to be considered as well. Entry nodes hand the corresponding labels of the threads over to the next node, if this is not an exit node or a surface node with a depth node, which results in a prioID switch. This avoids the generation of unnecessary labels.

Code Block
/*****************************************************************************/
/*                 G E N E R A T E D       C    C O D E                               */
/*****************************************************************************/
/* KIELER - Kiel Integrated Environment for Layout Eclipse RichClient                 */
/*                                                                                    */
/* http://www.informatik.uni-kiel.de/rtsys/kieler/                                    */
/* Copyright 2014 by                                                                  */
/* + Christian-Albrechts-University of Kiel                                           */
/*   + Department of Computer Science                                                 */
/*     + Real-Time and Embedded Systems Group                                         */
/*                                                                                    */
/* This code is provided under the terms of the Eclipse Public License (EPL).         */
/*****************************************************************************/

#define _SC_ID_MAX 2
#include "scl_p.h"
#include "sc.h"                      
                                             
bool A;
bool B;
bool O1;
bool O2;
                                                          
int tick()
{
    tickstart(2);
    O1 = false;
    O2 = false;
    fork1(HandleB,1){
        HandleA:
        if (A){
            label_0:
            B = true;
            O1 = true;
        } else {
            label_1:
            pause;
            if (A){
                goto label_0;
            } else {
                goto label_1;
            }
        }
    } par {
        HandleB:
        pause;
        if (B){
            O1 = true;
        } else {
            goto HandleB;
        }
    } join1(2);
    O1 = false;
    O2 = true;
    tickreturn();
}

The compilation result for ABO.

Packages belonging to this Project:

...

  • The node priorities, thread segment ids and prioIDs are now shown in the SCG

 

 

...