Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
E
EMADL2CPP
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 0
    • Merge Requests 0
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • monticore
    • EmbeddedMontiArc
  • generators
  • EMADL2CPP
  • Issues
  • #1

Closed
Open
Opened Jul 30, 2018 by Svetlana Pavlitskaya@svetlana.pavlitskayaContributor

Missing variable reassignment in generated cpp code

Expected: different values assigned to the variable c two times.

Actual: c gets value assigned only first time.

Model:

component Add{
    ports
        in Q(0 : 10) a,
        out Q(0 : 20) c;

    implementation Math{
        Q b = 42 + a;
        c = 1 + b;

        b = 43;
        c = 1 + b;
    }
}

Generated code:

#ifndef ADD
#define ADD
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#include "armadillo"
using namespace arma;
class add{
public:
double a;
double c;
void init()
{
}
void execute()
{
double b = 2+a;
c = 1+b;
b = 3;
}
};
#endif

Missing c = 1 + b; as the last statement in the execute() block.

Problem occurs only when c has two identical assignments.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: monticore/EmbeddedMontiArc/generators/EMADL2CPP#1