Giter VIP home page Giter VIP logo

mbeddr.core's Introduction

Mbeddr core

Mbeddr

To install: please, visit http://mbeddr.com for instructions!

mbeddr aims at creating a different way of developing embedded software systems. Instead of using archaic modeling tools and manually written C code, we use the open source JetBrains MPS language workbench to create an integrated approach to embedded development, where C programming, DSLs, domain specific extensions to C, product line variability, requirements traceability and model checking are supported directly.

At this point we are well ahead in developing an implementation of C in MPS which can then be used as a basis for domain-specific extensions. The development progress can be see from our blog page.

For more details please visit the mbeddr landing page.

Old demos

Maven Dependencies

To use mbeddr or the mbeddr platform in your own project, you one of the following dependencies in your maven or gradle build script. The latest support MPS version is 2023.2:

mbeddr mbeddr platform

Mbeddr

MPS version nexus status
2023.2 artifacts.itemis.cloud
2022.3 artifacts.itemis.cloud
2022.2 artifacts.itemis.cloud
2021.3 artifacts.itemis.cloud
2021.2 artifacts.itemis.cloud
2021.1 artifacts.itemis.cloud
2020.3 artifacts.itemis.cloud
2020.2 artifacts.itemis.cloud
2020.1 artifacts.itemis.cloud
2019.3 artifacts.itemis.cloud

Mbeddr platform

MPS version nexus status
2022.3 artifacts.itemis.cloud
2022.2 artifacts.itemis.cloud
2021.3 artifacts.itemis.cloud
2021.2 artifacts.itemis.cloud
2021.1 artifacts.itemis.cloud
2020.3 artifacts.itemis.cloud
2020.2 artifacts.itemis.cloud
2020.1 artifacts.itemis.cloud
2019.3 artifacts.itemis.cloud

Contributing to the mbeddr.platform

To contribute your module to the mbeddr platform for reuse, you probably want to add it to the mps utils (com.mbeddr.mpsutils). After some incubation time, it may be considered to move it to the MPS-extensions, if the motivation, and implementation have grown mature.

  • name your language "com.mbeddr.mpsutil.$yourLanguageName"
  • add it to the MPS project in code/languages/com.mbeddr.mpsutil inside a virtual folder "$yourLanguageName"
  • all dedicated modules (like the ones you create below) should go into this virtual folder "$yourLanguageName"
  • add a test solution with automated tests, named "test.com.mbeddr.mpsutil.$yourLanguageName" and make sure they pass
  • if your module is an extension to an MPS language
    • add a language named "com.mbeddr.mpsutil.$yourLanguageName.sandbox" that demos how to use your language
    • add a "com.mbeddr.mpsutil.$yourLanguageName.sandbox.sandbox" solution that demonstrates the effect of what the sandbox language implemented
  • open the MPS project "code/languages/com.mbeddr.build"
    • open the build script at "com.mbeddr.platform" named "com.mbeddr.platform"
    • add a group named "group.$yourLanguageName"
    • add a plugin that bundles your extension based on this group with the needed dependencies
    • add your plugin to the default layout
    • open the test build script at "platform/com.mbeddr.platform/com.mbeddr.platform.mpsutils.ts.tests.build" and add your tests
    • add your test solution and its dependencies to the group "com.mbeddr.platform.tests"
    • add it to the default layout
    • add it to the test modules configuration
  • run the build locally with ./gradlew publishMbeddrPlatformPublicationToMavenLocal and check if your project functions with it

mbeddr.core's People

Contributors

3nigma avatar abstraktor avatar alexanderpann avatar alexeiq avatar andrei-avram avatar apyshkin avatar arimer avatar artem-tikhomirov avatar ashatalin avatar bkolb avatar bmerkle avatar coolya avatar danielratiu avatar dineshlms avatar domenikp avatar github-actions[bot] avatar heikobecker avatar huibo-shi avatar joswarmer avatar kbirken avatar krinara86 avatar lhartl avatar markusvoelter avatar mmatzat avatar rhmsoft avatar sergej-koscejev avatar slisson avatar stephaneberle9 avatar szabta89 avatar wsafonov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbeddr.core's Issues

Allow expressions in ArraySizeSpecs

In smartmeter we have simple calculations (additions) Currently we don't support this

In our case they are very simple as there are number literals which are added:

int[1+ 2] x

__com_itemis_smartmeter_parse__emeter-structs___struct_1 is an invalid name

GCC doesn't compile with this struct name

this was created from

typedef struct
{
int32_t v2;
int32_t v3;
} goertzel_state_t;

and resulted in

struct __com_itemis_smartmeter_parse__emeter-structs___struct_1 {
int32_t v2;
int32_t v3;
};

typedef __com_itemis_smartmeter_parse__emeter-structs___struct_1 as goertzel_state_t;

Variables must not be initialized in headers

Exported variables must remain in the .c file, however there needs to be a corresponding extern-declaration in the .h file

Otherwise the linker may find symbols multiple times

Allow struct init

It should be possible to init a struct using the C syntax

TODO copy the example from smartMeter

Right transformation broken for ->

I have something like this
phase->metrology.V_history[phase]

now I want to add a -> after the phase in the array access

the result is
phase[]->

Mbeddr Developer Guide

Create a document that contains information on our development process:

  • How do we run tests?
  • When do we run them?
  • Tips and pitfalls that appear when using MPS
  • ...

Handing down Defines to the CDT Parser

From the Header Import Spec we have to hand down the #defines to the CDT Parser. The CDT Parser seems to be able to accept these defines, but they have to be handed down.

Use Dependency Injection in the Debugger Core

In our current implementation all dependencies are wired statically in the code.

In order to improve the testability and the design of the debugger architecture, we plan to decouple classes and interfaces with the Google Guice dependency injection framework.

FM support & components do not work well together

Scenario:

Variability from FM: legoFeatureModel
Rendering Mode: product line
module MainWithComp from Lego imports {Debug} , {Production} {

instance configuration ComponentConfig extends nothing {
instances:
{Production}
instance EcRobotImpl robotImpl
{Debug}
instance EcRobotDebugImpl robotDebugImpl
connectors:
<< ... >>
adapter:
{Debug}
adapt robotDebugImpl.robot as robot ------------------------->
{Production}
adapt robotImpl.robot as robot ----------------------------------->
}

extern void ecrobot_device_initialize() {
robot.displayText("Hello Robot"); -----------------------------------> I want to call displayText here on the adapter, depending on which adapter is available

} ecrobot_device_initialize (function)

This should work I think as we are (or should) not using labels in the generator, shouldn't it? How can we solve the issue?

Type string is not a subtype of int8_t*

external module extModule:
void xxy(char* someText);

module aModule imports extModule

void aFct(){
xxy("Hello World"); -----> Here I am getting the message "Type string is not a subtype of int8_t*"
}

In the type size config however a char is mapped to an int8_t. So this should be possible

NuSMV equals shows up in SM

NuSMV Eq Expression is currently allowed in the StatementList of a Transition. This should not be the case.

HexLiteral editor

it is not possible to type on the right side of the > of a hex literal

Operator precedence broken

If I am typing
++phase->metrology.dot_prod.sample_count

left to right

the result should be
++(phase->metrology.dot_prod.sample_count)

This is nto the case

Export Logic for dependent Elements broken

If an IModuleCOntent is exported, then all other module contents referenced from it (in the same module!) must be exported as well. Write constraint using allReferencedModuleCOntents() built for the sorting algo.

allReferencedModuleCOntents().where( it.parent == this.module ) ...

"Wizard" for creating a runnable solution

Currently people have to create

  • a model
  • an impl module
  • a type size config
  • and a build config to get started.

Can we create a shortcut/intention/wizard to simplify this to one step?

Remove "var" for global variables

It would be good to get rid of the "var" for global vars. Instead if I type a Type a var should be created. If I type a "(" it should be transformed into a function

For unparseable expressions, use OpaquExprWithType

If a #define defines an "unparseable expressions" such as

2 * 0x32u

or

(SOMEDEFINE + 2 * SOMEOTHERDEFINE)

we have the problem that we don't know the type of the thing. Currently it is parsed into a String, and the type is a String.

Instead, the following thing should happen:

  • an instance of OpaqueExprWithType must be created (this concept already exists in the core.lefacy language)
  • its expr property contains the "unparseable" expression as a string, for example
  • its type property remains empty.

This way we get an error in the imported header file and the user is prompted to fill in the type manually. This is better than erroneously making it a string.

Delete action für parens expression

Currently you cannot easily remove unnecessary parens (e.g. around if ( (x>10) ) )
A Delete Action, e.g. on the leading parens, should be supported.

Returntype of runnables not checked

int32_t robot_displayText(string text) ⬅ op robot.displayText {
counter++;
report(0) debugMessages.displayText(text) on/if;
}

This should lead to an error as nothing is returned. This is however not the case

Copy to text does not work for elements annotated with PresCond

The instances and adapters are placed somewhere entirely out of context. See below

instance configuration ComponentConfig extends nothing {
instances:
{Production}
{Debug}
connectors:
<< ... >>
adapter:
{Debug}
{Production}
}

----> the next line should be under Production/Debug
instance EcRobotImpl robotImpl instance EcRobotDebugImpl robotDebugImpl adapt robotDebugImpl.robot as robot adapt robotImpl.robot as robot

MPS2.5 migration problem?

int8_t/C/ temp2 = ⟦20 F ⇾ C⟧ + 10 C; in Some Module is broken

It is not allowed to add the two expressions

NullPointerException in typeof_NumberLiteral_InferenceRule

an error occurred while applying rule to node NumberLiteral
java.lang.NullPointerException
at com.mbeddr.core.expressions.typesystem.typeof_NumberLiteral_InferenceRule.applyRule(typeof_NumberLiteral_InferenceRule.java:21)
at jetbrains.mps.newTypesystem.operation.ApplyRuleOperation.execute(ApplyRuleOperation.java:44)
at jetbrains.mps.newTypesystem.state.State.executeOperation(State.java:320)
at jetbrains.mps.newTypesystem.state.State.applyRuleToNode(State.java:150)
at jetbrains.mps.newTypesystem.TypeSystemComponent.applyRulesToNode(TypeSystemComponent.java:436)
at jetbrains.mps.newTypesystem.TypeSystemComponent.computeTypesForNode(TypeSystemComponent.java:337)
at jetbrains.mps.newTypesystem.TypeSystemComponent.computeTypes(TypeSystemComponent.java:228)
at jetbrains.mps.newTypesystem.TypeSystemComponent.computeTypes(TypeSystemComponent.java:418)
at jetbrains.mps.newTypesystem.NodeTypesComponent.computeTypes(NodeTypesComponent.java:178)
at jetbrains.mps.newTypesystem.TypeCheckingContextNew.checkRoot(TypeCheckingContextNew.java:86)
at jetbrains.mps.newTypesystem.TypeCheckingContextNew.checkRoot(TypeCheckingContextNew.java:70)
at jetbrains.mps.newTypesystem.TypeCheckingContextNew.checkIfNotChecked(TypeCheckingContextNew.java:497)
at jetbrains.mps.typesystem.checking.TypesEditorChecker$1.run(TypesEditorChecker.java:67)
at jetbrains.mps.newTypesystem.TypeCheckingContextNew.runTypeCheckingAction(TypeCheckingContextNew.java:460)
at jetbrains.mps.typesystem.checking.TypesEditorChecker.createMessages(TypesEditorChecker.java:60)
at jetbrains.mps.nodeEditor.checking.BaseEditorChecker$1.run(BaseEditorChecker.java:36)
at jetbrains.mps.nodeEditor.checking.BaseEditorChecker.performUninterruptableAction(BaseEditorChecker.java:116)
at jetbrains.mps.nodeEditor.checking.BaseEditorChecker.createMessagesProtected(BaseEditorChecker.java:34)
at jetbrains.mps.nodeEditor.Highlighter$11.compute(Highlighter.java:497)
at jetbrains.mps.nodeEditor.Highlighter$11.compute(Highlighter.java:480)
at jetbrains.mps.nodeEditor.Highlighter$13.compute(Highlighter.java:561)
at jetbrains.mps.ide.smodel.WorkbenchModelAccess$3.compute(WorkbenchModelAccess.java:135)
at com.intellij.openapi.application.impl.ApplicationImpl$10.run(ApplicationImpl.java:798)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:770)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:796)
at jetbrains.mps.ide.smodel.WorkbenchModelAccess.runReadAction(WorkbenchModelAccess.java:131)
at jetbrains.mps.nodeEditor.Highlighter.runLoPrioRead(Highlighter.java:557)
at jetbrains.mps.nodeEditor.Highlighter.updateEditor(Highlighter.java:480)
at jetbrains.mps.nodeEditor.Highlighter.access$1000(Highlighter.java:55)
at jetbrains.mps.nodeEditor.Highlighter$9.compute(Highlighter.java:438)
at jetbrains.mps.nodeEditor.Highlighter$9.compute(Highlighter.java:401)
at jetbrains.mps.nodeEditor.Highlighter.runUpdateMessagesAction(Highlighter.java:396)
at jetbrains.mps.nodeEditor.Highlighter.updateEditorComponent(Highlighter.java:401)
at jetbrains.mps.nodeEditor.Highlighter.doUpdate(Highlighter.java:327)
at jetbrains.mps.nodeEditor.Highlighter$HighlighterThread.run(Highlighter.java:603)

Only Import those headers that are not yet in the model

When running the import from the Import Header Spec, the importer must only add external modules for those header that do not yet have an external module. This way, we can reimport a header by just deleting this single one external module.

Unable to run rebuildLanguagesAfterCheckout.sh

When running the rebuildLanguagesAfterCheckout.sh script under Mac, the following error message appears:

client-0x15:languages domenik$ ./rebuildLanguagesAfterCheckout.sh
Buildfile: /Users/domenik/mbeddr.core/code/languages/com.mbeddr.mpsutil/build.xml
[taskdef] Could not load definitions from resource jetbrains/mps/build/ant/antlib.xml. It could not be found.

BUILD FAILED
/Users/domenik/mbeddr.core/code/languages/com.mbeddr.mpsutil/build.xml:11: Problem: failed to create task or type jvmargs
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Total time: 0 seconds
Buildfile: /Users/domenik/mbeddr.core/code/languages/com.mbeddr.core/build.xml
[taskdef] Could not load definitions from resource jetbrains/mps/build/ant/antlib.xml. It could not be found.

BUILD FAILED
/Users/domenik/mbeddr.core/code/languages/com.mbeddr.core/build.xml:15: Problem: failed to create task or type jvmargs
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Total time: 0 seconds
Buildfile: /Users/domenik/mbeddr.core/code/languages/com.mbeddr.cc/build.xml
[taskdef] Could not load definitions from resource jetbrains/mps/build/ant/antlib.xml. It could not be found.

BUILD FAILED
/Users/domenik/mbeddr.core/code/languages/com.mbeddr.cc/build.xml:15: Problem: failed to create task or type jvmargs
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Total time: 0 seconds
Buildfile: /Users/domenik/mbeddr.core/code/languages/com.mbeddr.ext/build.xml
[taskdef] Could not load definitions from resource jetbrains/mps/build/ant/antlib.xml. It could not be found.

BUILD FAILED
/Users/domenik/mbeddr.core/code/languages/com.mbeddr.ext/build.xml:17: Problem: failed to create task or type jvmargs
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any / declarations have taken place.

Total time: 0 seconds

mpsutils.outline missing in master branch

When I try to rebuild languages from the master branch, the ext.components and ext.statemachines languages do not build, because mpsutils.outline is missing.
I'll try to use the one from the builder branch, but this probably needs a more structural fix.

copying a commentModuleContent to the clipboard broken

Result:

/* [JComponent javax.swing.JLabel[,51,145,499x96,alignmentX=0.0,alignmentY=0.0,border=,flags=8388736,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,horizontalAlignment=LEADING,horizontalTextPosition=TRAILING,iconTextGap=4,labelFor=,text=! This switch enables the sending of the current readings, through a UART port,
for use in cooperative calibration with other meters.
! This switch selects single phase mode. If SINGLE_PHASE is not set the
software will be built for 3-phase operation.
! This switch enables mains frequency measurement. This may be used as a
meter feature. It may be a requirement, if non-linear CT sensors are used.,verticalAlignment=CENTER,verticalTextPosition=CENTER] ] */

Priorities broken for ! and >

If I try to enter
if (! x>10)
the prios are broken. It is built as (!x) > (10) and it should be !(x>10)

At this point, ! has no prio level. Is that correct?

Always using ( ) after the ! makes no sense for simple cases like !b.
So we have to fix the prios.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.