response_time_analysis/
lib.rs

1/*!
2# Response-Time Analysis (RTA)
3
4This crate collects interfaces, definitions, and algorithms for the
5response-time analysis of real-time systems.
6
7## Scope
8
9The crate does *not* provide a ready-made tool itself, is not specific
10to any particular input format or set of assumptions, and does not offer
11or require a canonical task representation. Rather, it is intended as a
12low-level library of reusable definitions and analyses, held together by
13a bunch of traits.  Based on this foundation, higher-level facilities
14(and one-off research tools) may be built.
15
16## Citations
17
18Some of the algorithms and analyses implemented in this crate come from
19published papers, as mentioned in the documentation. If you use this
20crate for academic work, please cite the paper(s) corresponding to the
21analysis that you are using.
22
23
24
25*/
26
27pub mod arrival;
28pub mod demand;
29pub mod edf;
30pub mod fifo;
31pub mod fixed_point;
32pub mod fixed_priority;
33pub mod ros2;
34pub mod supply;
35pub mod time;
36pub mod wcet;
37
38#[cfg(test)]
39mod tests {
40    use crate::time::{Duration, Offset, Service};
41
42    // helper function for typed duration values
43    pub fn d(val: u64) -> Duration {
44        Duration::from(val)
45    }
46
47    // helper function for typed offset values
48    pub fn o(val: u64) -> Offset {
49        Offset::from(val)
50    }
51
52    // helper function for vectors of typed duration values
53    pub fn dv(vals: &[u64]) -> Vec<Duration> {
54        vals.iter().map(|t| d(*t)).collect()
55    }
56
57    // helper function for typed service values
58    pub fn s(val: u64) -> Service {
59        Service::from(val)
60    }
61
62    // helper function for vectors of typed service values
63    pub fn sv(vals: &[u64]) -> Vec<Service> {
64        vals.iter().map(|t| s(*t)).collect()
65    }
66}