-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8b9b641
commit 2886bf5
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* Pipeline pattern where a periodic source feeds a chain of reactors that can all execute in | ||
* parallel at each logical time step. This example shows how a deadline can interfere with | ||
* parallelism if the GEDF_NP scheduler is used. The target parameter `scheduler` overrides | ||
* the default scheduler to use the NP scheduler, which results in fully parallel execution. | ||
* | ||
* @author Edward A. Lee | ||
*/ | ||
target C { | ||
scheduler: NP, | ||
timeout: 1 sec | ||
} | ||
|
||
import SendCount, Receive from "lib/SendersAndReceivers.lf" | ||
import TakeTime from "lib/TakeTime.lf" | ||
|
||
reactor Deadline extends TakeTime { | ||
reaction(in) {= | ||
=} deadline (100 ms) {= | ||
=} | ||
} | ||
|
||
federated reactor { | ||
r0 = new SendCount(period = 100 msec) | ||
r1 = new TakeTime(approximate_time = 100 msec) | ||
r2 = new TakeTime(approximate_time = 100 msec) | ||
r3 = new TakeTime(approximate_time = 100 msec) | ||
r4 = new Deadline(approximate_time = 100 msec) | ||
r5 = new Receive() | ||
r0.out -> r1.in after 100 msec | ||
r1.out -> r2.in after 100 msec | ||
r2.out -> r3.in after 100 msec | ||
r3.out -> r4.in after 100 msec | ||
r4.out -> r5.in after 100 msec | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.