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

USER_THREADS specifiable in platform options #1721

Merged
merged 37 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2db62e8
Make USER_THREADS possible to specify as a target property in platfor…
siljesu Apr 28, 2023
09814ff
Merge branch 'master' into zephyr-target-prop
lhstrh Apr 29, 2023
d311497
Fix enum name after naming convention
siljesu May 12, 2023
62c39cd
Use enum for setting compile definition
siljesu May 12, 2023
166227a
Add user thread test for Zephyr
siljesu May 12, 2023
73e3824
Merge branch 'master' into zephyr-target-prop
siljesu May 12, 2023
5bf8a00
Fix error and warning reports
siljesu May 15, 2023
9c1959d
Merge branch 'master' into zephyr-target-prop
siljesu May 16, 2023
2c84028
Merge branch 'master' into zephyr-target-prop
erlingrj May 16, 2023
20ec644
Merge branch 'master' into zephyr-target-prop
siljesu May 18, 2023
def5022
Format test
siljesu May 18, 2023
917ea83
Fix always getting user thread warning
siljesu May 18, 2023
003840c
Merge branch 'master' into zephyr-target-prop
erlingrj May 18, 2023
f017482
Add threading check to validation of property
siljesu May 19, 2023
69258c4
Add threaded Zephyr test functionality
siljesu May 19, 2023
37765e3
Merge branch 'master' into zephyr-target-prop
siljesu May 21, 2023
94f1c54
Merge branch 'master' into zephyr-target-prop
siljesu May 22, 2023
242ce41
Fix UserThreads test
erlingrj May 23, 2023
5f181ff
Bump reactorc
erlingrj May 23, 2023
f6faf09
Apply formatter (ratched only)
lhstrh May 23, 2023
1ebc4f0
Merge master into siljesu:zephyr-target-prop
lhstrh May 23, 2023
9dd2401
Merge branch 'zephyr-target-prop' of github.com:siljesu/lingua-franca…
lhstrh May 23, 2023
a3a6d5b
Add makeZephyrCompatible configurator
erlingrj May 23, 2023
24e581a
Run formatter
erlingrj May 23, 2023
bf4ac76
Try qemu_riscv32 instead
erlingrj May 25, 2023
aad2ef3
Update reactor-c submodule
lhstrh May 26, 2023
597cdd7
Use qemu_riscv32 with debug logging turned of for Zephyr tests
erlingrj May 25, 2023
5ddabe0
Merge branch 'zephyr-target-prop' of https://github.com/siljesu/lingu…
erlingrj May 28, 2023
3128b20
Bump reactor-c
erlingrj May 29, 2023
fa0fa3e
Bump reactor-c again
erlingrj May 29, 2023
62b7dd0
Add ConcurrentTests to Zephyr and exclude the tracing specific concur…
erlingrj May 29, 2023
05f4045
Print all skipped tests in RunZephyrTests.sh
erlingrj May 29, 2023
a4a9fee
spotless
erlingrj May 29, 2023
0d731fb
Bump reactor-cpp
erlingrj May 29, 2023
ea2a2d6
Merge branch 'master' into zephyr-target-prop
erlingrj May 29, 2023
eec9cd8
Remove mistaken commit
erlingrj May 30, 2023
52091e3
Merge branch 'zephyr-target-prop' of https://github.com/siljesu/lingu…
erlingrj May 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions org.lflang/src/org/lflang/TargetConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,11 @@ public static class PlatformOptions {
* port values depending on the infrastructure you use to flash the boards.
*/
public boolean flash = false;

/**
* The int value is used to determine the number of needed threads for the user application in Zephyr.
*/
public int userThreads = 0;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion org.lflang/src/org/lflang/TargetProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ public enum TargetProperty {
case PORT:
pair.setValue(ASTUtils.toElement(config.platformOptions.port));
break;
case USERTHREADS:
pair.setValue(ASTUtils.toElement(config.platformOptions.userThreads));
break;
}
kvp.getPairs().add(pair);
}
Expand Down Expand Up @@ -472,6 +475,9 @@ public enum TargetProperty {
case PORT:
config.platformOptions.port = ASTUtils.elementToSingleString(entry.getValue());
break;
case USERTHREADS:
config.platformOptions.userThreads = ASTUtils.toInteger(entry.getValue());
break;
default:
break;
}
Expand Down Expand Up @@ -1659,7 +1665,8 @@ public enum PlatformOption implements DictionaryElement {
BAUDRATE("baud-rate", PrimitiveType.NON_NEGATIVE_INTEGER),
BOARD("board", PrimitiveType.STRING),
FLASH("flash", PrimitiveType.BOOLEAN),
PORT("port", PrimitiveType.STRING);
PORT("port", PrimitiveType.STRING),
USERTHREADS("user_threads", PrimitiveType.NON_NEGATIVE_INTEGER);

public final PrimitiveType type;

Expand Down
8 changes: 8 additions & 0 deletions org.lflang/src/org/lflang/generator/c/CGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,14 @@ protected void setUpGeneralParameters() {
System.out.println("To enable compilation for the Arduino platform, you must specify the fully-qualified board name (FQBN) in the target property. For example, platform: {name: arduino, board: arduino:avr:leonardo}. Entering \"no-compile\" mode and generating target code only.");
targetConfig.noCompile = true;
}

if (targetConfig.platformOptions.platform == Platform.ZEPHYR && targetConfig.platformOptions.userThreads >= 0) {
targetConfig.compileDefinitions.put(
"USER_THREADS",
String.valueOf(targetConfig.platformOptions.userThreads)
);
}

if (targetConfig.threading) { // FIXME: This logic is duplicated in CMake
pickScheduler();
// FIXME: this and pickScheduler should be combined.
Expand Down