Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Modal Models #501

Merged
merged 82 commits into from
Mar 1, 2022
Merged

Added support for Modal Models #501

merged 82 commits into from
Mar 1, 2022

Conversation

a-sr
Copy link
Collaborator

@a-sr a-sr commented Sep 13, 2021

Prototype for modal reactors. See also reactor-c PR #6
Currently only supports C code generation + non-federated.

ToDo:

  • Fix test models that use new keywords (e.g. initial in SendersAndReceivers.lf)
  • Fix current implementation of suspending events that breaks next references that model super dense time
  • Fix current implementation of suspending events that does not take microsteps into account when re-enqueuing (history)
  • Fix handling of after delay on connections
  • Fix build
  • Reset state variables
  • Allow mixing writers on output ports if they are in mutually exclusive modes
  • Adjust cycle analysis to allow mutually exclusive modes to separate ordered reactions
  • Turn examples into tests

ToDiscuss:

  • Compatibility to federated?
  • Assess experimental multi-threaded implementation?

a-sr added 18 commits May 4, 2021 14:45
Conflicts:
	org.lflang.diagram/src/org/lflang/diagram/synthesis/LinguaFrancaSynthesis.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/util/UtilityExtensions.xtend
	org.lflang/src/org/lflang/scoping/LFScopeProvider.xtend
Conflicts:
	org.lflang/src/org/lflang/LinguaFranca.xtext
@a-sr a-sr requested a review from lhstrh September 13, 2021 08:52
Conflicts:
	org.lflang/src/org/lflang/generator/c/CGenerator.xtend
@a-sr a-sr marked this pull request as ready for review February 8, 2022 17:38
a-sr added 3 commits February 11, 2022 14:28
Conflicts:
	org.lflang/src/lib/c/reactor-c
	org.lflang/src/org/lflang/federated/FederateInstance.xtend
Conflicts:
	org.lflang.diagram/src/org/lflang/diagram/synthesis/LinguaFrancaSynthesis.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/action/AbstractAction.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/action/CollapseAllReactorsAction.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/action/ExpandAllReactorsAction.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/action/MemorizingExpandCollapseAction.xtend
	org.lflang.diagram/src/org/lflang/diagram/synthesis/styles/LinguaFrancaShapeExtensions.xtend
@a-sr
Copy link
Collaborator Author

a-sr commented Feb 11, 2022

This PR now includes changes of PR #940

Copy link
Member

@lhstrh lhstrh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks ready to me! A very cool feature that I think will find lots of use.

* This methods needs to be overridden in target specific code generators that support modal reactors.
*/
protected def void transformConflictingConnectionsInModalReactors(Collection<Connection> transform) {
errorReporter.reportError("The currently selected code generation is missing an implementation for conflicting transforming connections in modal reactors.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
errorReporter.reportError("The currently selected code generation is missing an implementation for conflicting transforming connections in modal reactors.")
errorReporter.reportError("This code generator is missing an implementation for transforming conflicting connections in modal reactors.")

@lhstrh lhstrh requested a review from edwardalee February 27, 2022 03:42
Copy link
Collaborator

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a real tour de force! I have not reviewed much, but I think we should merge because almost anything we do will lead to more conflicts.

@edwardalee edwardalee merged commit c344185 into master Mar 1, 2022
@edwardalee edwardalee deleted the modal-models branch March 1, 2022 23:57
@lhstrh lhstrh changed the title Modal Models Added support for Modal Models Mar 17, 2022
@lhstrh lhstrh added the enhancement Enhancement of existing feature label Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c Related to C target enhancement Enhancement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants