Skip to content

Commit

Permalink
Merge branch 'master' into python-12
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardalee committed Dec 7, 2024
2 parents 928267d + b0dc6c9 commit afd045c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 30 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/c-embedded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ jobs:
# uses: ./.github/workflows/c-flexpret-tests.yml

# Run the C Patmos integration tests.
patmos:
uses: ./.github/workflows/c-patmos-tests.yml
# patmos:
# uses: ./.github/workflows/c-patmos-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,14 @@ CodeBuilder generateCMakeCode(
break;
case PATMOS:
cMakeCode.newLine();
cMakeCode.pr("SET(CMAKE_SYSTEM_NAME patmos)");
cMakeCode.pr("SET(CMAKE_SYSTEM_PROCESSOR patmos)");
cMakeCode.pr("# Include toolchain file and set project");
cMakeCode.pr(
"find_program(CLANG_EXECUTABLE NAMES patmos-clang REQUIRED DOC \"Path to the clang"
+ " front-end.\")");
cMakeCode.pr("set(CMAKE_C_FLAGS_INIT \"-O2 -DNDEBUG\")");

cMakeCode.pr("set(CMAKE_C_COMPILER ${CLANG_EXECUTABLE})");
cMakeCode.pr(
"set(CMAKE_C_FLAGS_RELEASE \"-O2 -DNDEBUG\")"); // patmos-clang cannot compiler -O3
Expand Down
27 changes: 0 additions & 27 deletions core/src/main/java/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
import org.lflang.target.property.TracingProperty;
import org.lflang.target.property.WorkersProperty;
import org.lflang.target.property.type.PlatformType.Platform;
import org.lflang.target.property.type.SchedulerType.Scheduler;
import org.lflang.util.ArduinoUtil;
import org.lflang.util.FileUtil;
import org.lflang.util.FlexPRETUtil;
Expand Down Expand Up @@ -741,31 +740,6 @@ else if (term.getParameter() != null)
return result.toString();
}

/** Set the scheduler type in the target config as needed. */
private void pickScheduler() {
// Don't use a scheduler that does not prioritize reactions based on deadlines
// if the program contains a deadline (handler). Use the GEDF_NP scheduler instead.
if (!targetConfig.get(SchedulerProperty.INSTANCE).prioritizesDeadline()) {
// Check if a deadline is assigned to any reaction
if (hasDeadlines(reactors)) {
if (!targetConfig.isSet(SchedulerProperty.INSTANCE)) {
SchedulerProperty.INSTANCE.override(targetConfig, Scheduler.GEDF_NP);
}
}
}
}

private boolean hasDeadlines(List<Reactor> reactors) {
for (Reactor reactor : reactors) {
for (Reaction reaction : allReactions(reactor)) {
if (reaction.getDeadline() != null) {
return true;
}
}
}
return false;
}

/**
* Copy all files or directories listed in the target property {@code files}, {@code
* cmake-include}, and {@code _fed_setup} into the src-gen folder of the main .lf file
Expand Down Expand Up @@ -2033,7 +2007,6 @@ protected boolean setUpGeneralParameters() {
CompileDefinitionsProperty.INSTANCE.update(targetConfig, Map.of("MODAL_REACTORS", "TRUE"));
}
if (!targetConfig.get(SingleThreadedProperty.INSTANCE)) {
pickScheduler();
CompileDefinitionsProperty.INSTANCE.update(
targetConfig,
Map.of(
Expand Down

0 comments on commit afd045c

Please sign in to comment.