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

Test to help ensure that level-based scheduling does not cause deadlock #1703

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Changes from 1 commit
Commits
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
47 changes: 47 additions & 0 deletions test/C/src/federated/LevelPattern.lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* This test verifies that the artificial dependencies introduced by level-based
* scheduling do not, by themselves, introduce deadlocks in federated execution.
*
* @author Edward A. Lee
*/
target C {
timeout: 1s
}
import Count from "../lib/Count.lf"
import TestCount from "../lib/TestCount.lf"
reactor Through {
input in:int
output out:int
reaction(in) -> out {=
lf_set(out, in->value);
=}
}
reactor A {
input in1:int
input in2:int
output out1:int
output out2:int

i1 = new Through()
reaction(in1) -> i1.in {=
lf_set(i1.in, in1->value);
=}
i1.out -> out1

i2 = new Through()
reaction(in2) -> i2.in {=
lf_set(i2.in, in2->value);
=}
i2.out -> out2
}
federated reactor {
c = new Count()
test = new TestCount(num_inputs = 2)
b = new A()
t = new Through()

c.out -> b.in1
b.out1 -> t.in
t.out -> b.in2
b.out2 -> test.in
}