Skip to content

Commit 32963f2

Browse files
committed
Make a pass over the README
1 parent a7d9dc4 commit 32963f2

File tree

7 files changed

+31
-46
lines changed

7 files changed

+31
-46
lines changed

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.PHONY: clean test coverage asan format format-check ci lf-test lib proto examples
1+
.PHONY: clean test coverage asan format format-check ci lf-test lib proto
22

3-
test: unit-test lf-test examples
3+
test: unit-test lf-test
44

55
# Generate protobuf code
66
proto:
@@ -12,11 +12,6 @@ lib:
1212
cmake --build build
1313
make -C build
1414

15-
# Build federated example
16-
examples:
17-
cmake -Bbuild/posix/federated/ examples/posix/federated
18-
make -C build/posix/federated/
19-
2015
# Build and run the unit tests
2116
unit-test:
2217
cmake -Bbuild -DBUILD_TESTS=ON

README.md

Lines changed: 18 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ model-of-computation target at embedded and resource-constrained systems.
88
NB: reactor-uc is still work-in-progress and sevearal reactor features are not supported
99
yet. Moreover, the runtime has not been thoroughly tested so if you find any bugs or issues, please report them.
1010

11-
Setup the environment
11+
12+
Initialize submodules
1213

1314
```shell
14-
source env.bash
15+
git submodule update --init
1516
```
1617

17-
Initialize submodules
18+
Setup the environment
1819

1920
```shell
20-
git submodule update --init
21+
source env.bash # or env.zsh or env.fish
2122
```
2223

2324
Compile and run unit tests:
@@ -31,19 +32,20 @@ make test
3132
### Linux/POSIX
3233

3334
```shell
34-
make examples
35-
build/examples/posix/timer_ex
35+
cd examples/posix
36+
./buildAll.sh
37+
hello/build/app
3638
```
3739

3840
### Zephyr
3941
Compile and run a simple test on Zephyr. This requires a correctly configured
4042
Zehyr environment, with West installed in a Python virtual environment which is
4143
activated. Inspect `.github/actions/zephyr/action.yml` for an example of how to setup your Zephyr workspace.
4244

43-
First a simple HelloWorld on the qemu_cortex_m3 target:
45+
First a simple HelloWorld on the `native_posix` target:
4446
```shell
4547
cd examples/zephyr/hello
46-
west build -b qemu_cortex_m3 -p always -t run
48+
west build -b native_posix -p always -t run
4749
```
4850

4951
Then a simple blinky targeting NXP FRDM K64F. This will run with most boards supporting Zephyr that has a user LED.
@@ -52,8 +54,6 @@ cd examples/zephyr/blinky
5254
west build -b frdm_k64f -p always
5355
west flash
5456
```
55-
For more information on running LF programs using the reactor-uc runtime on
56-
Zephyr take a look at this template: <https://github.com/lf-lang/lf-west-template/tree/reactor-uc>
5757

5858
### RIOT
5959
Compile and run a simple blinky example on RIOT.
@@ -76,39 +76,21 @@ make
7676
```
7777

7878
### Lingua Franca
79-
NB: We are currently not keeping `lfc` up-to-date. We will probably do so again when the APIs have stabilized.
80-
81-
We have copied a very limited version of the Lingua Franca Compiler (lfc) into
82-
`~/lfc` of this repo. In the future, the `reactor-uc` specific code-generation
83-
will be merged back upstream. By sourcing `env.bash` or `env.fish` the Lingua
84-
Franca Compiler will be aliased by `lfcg` for Lingua Franca Generator since this
85-
limited version mainly oes does code-generat
79+
Reactor-uc includes a limited version of the Lingua Franca Compiler (lfc) found in `~/lfc`. In the future, the
80+
`reactor-uc` specific code-generation will be merged back upstream. By sourcing `env.bash`, `env.fish` or `env.zsh` the
81+
Lingua Franca Compiler will be aliased by `lfcg`.
8682

8783
```shell
88-
cd examples/lf
89-
lfcg src/HelloUc.lf
84+
lfcg test/lf/src/HelloUc.lf
9085
```
9186

92-
Since a target platform is not specified, we will target POSIX in which case
93-
`lfc` will generate a main function and invoke CMake directly on the generated
94-
sources. Run the program with:
87+
Since the target platform is set to `Native`,`lfc` will generate a main function and invoke CMake directly on the
88+
generated sources. Run the program with:
9589

9690
```shell
97-
bin/HelloUc
91+
test/lf/bin/HelloUc
9892
```
9993

100-
## Goals
101-
102-
- Incorporate unit testing and test-driven development from the start
103-
- Optimized for single-core 32-bit systems
104-
- Backend for LF
105-
- Standalone library
106-
- Use clang-format and clang-tidy to write safe code from the start.
107-
- CMake-based
108-
- Optimized for single-threaded runtime, but support for federated execution
109-
which enable distributed embedded systems.
110-
- Avoid malloc as much as possible (or entirely?)
111-
11294
## References
11395

11496
`reactor-uc` draws inspiration from the following existing open-source projects:
@@ -134,4 +116,4 @@ CMake Error at CMakeLists.txt:7 (message):
134116
env.bash in reactor-uc.
135117
```
136118

137-
Please source `env.bash` or `env.fish`.
119+
Please source `env.bash`, `env.fish` or `env.zsh` to get the REACTOR_UC_PATH environment variable defined.

env.zsh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env zsh
2+
3+
# Get the directory of the current script
4+
script_dir=$(dirname "$0:A")
5+
6+
export REACTOR_UC_PATH=$script_dir
7+
alias lfcg='${REACTOR_UC_PATH}/lfc/bin/lfc-dev'

examples/common/timer_source.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
DEFINE_TIMER_STRUCT(TimerSource, t, 1, 0);
44
DEFINE_TIMER_CTOR(TimerSource, t, 1, 0);
5-
DEFINE_REACTION_STRUCT(TimerSource, r, 1);
5+
DEFINE_REACTION_STRUCT(TimerSource, r, 0);
66
DEFINE_REACTION_CTOR(TimerSource, r, 0);
77

88
typedef struct {

examples/posix/federated/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ set(NETWORK_CHANNEL_TCP_POSIX ON CACHE STRING "")
66
add_subdirectory(../../../ reactor-uc)
77

88
add_executable(sender sender.c)
9-
target_compile_definitions(sender PRIVATE "SCHEDULER_${SCHEDULER}")
109
target_link_libraries(sender PRIVATE reactor-uc)
1110

1211
add_executable(receiver receiver.c)

examples/riot/blinky/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ DEFINE_REACTION_BODY(TimerSource, r) {
1313

1414
int main() {
1515
lf_start();
16+
return 0;
1617
}

examples/zephyr/hello/src/hello.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ DEFINE_REACTION_BODY(TimerSource, r) {
99

1010
int main() {
1111
lf_start();
12-
}
12+
exit(0);
13+
}

0 commit comments

Comments
 (0)