Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
klee_tutorial
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Niklas Lundberg
klee_tutorial
Commits
5f5852ee
Commit
5f5852ee
authored
4 years ago
by
Blinningjr
Browse files
Options
Downloads
Patches
Plain Diff
Made a analyse function
parent
ad24e21c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
srp_analysis/src/common.rs
+2
-3
2 additions, 3 deletions
srp_analysis/src/common.rs
srp_analysis/src/main.rs
+20
-3
20 additions, 3 deletions
srp_analysis/src/main.rs
with
22 additions
and
6 deletions
srp_analysis/src/common.rs
+
2
−
3
View file @
5f5852ee
...
...
@@ -2,7 +2,7 @@ use std::collections::{HashMap, HashSet};
// common data structures
#[derive(Debug)]
#[derive(Debug
,
Clone
)]
pub
struct
Task
{
pub
id
:
String
,
pub
prio
:
u8
,
...
...
@@ -11,8 +11,7 @@ pub struct Task {
pub
trace
:
Trace
,
}
//#[derive(Debug, Clone)]
#[derive(Debug)]
#[derive(Debug,
Clone)]
pub
struct
Trace
{
pub
id
:
String
,
pub
start
:
u32
,
...
...
This diff is collapsed.
Click to expand it.
srp_analysis/src/main.rs
+
20
−
3
View file @
5f5852ee
...
...
@@ -74,9 +74,8 @@ fn main() {
println!
(
"ip: {:?}"
,
ip
);
println!
(
"tr: {:?}"
,
tr
);
for
t
in
&
tasks
{
response_time
(
t
,
&
tasks
,
&
ip
,
&
tr
);
}
let
analysis
=
analyse
(
&
tasks
,
&
ip
,
&
tr
);
println!
(
"Analysis {:#?}"
,
analysis
);
}
...
...
@@ -234,3 +233,21 @@ fn busy_period(task: &Task) -> u32 {
}
/*
* Analyse tasks.
*
* Note: Finally, make a function that iterates over the task set and returns a vector with containing:
Vec<Task, R(t), C(t), B(t), I(t)>. Just a simple println! of that vector gives the essential information on the analysis.
*/
fn
analyse
(
tasks
:
&
Tasks
,
ip
:
&
IdPrio
,
tr
:
&
TaskResources
)
->
Vec
<
(
Task
,
u32
,
u32
,
u32
,
u32
)
>
{
let
mut
analysis
:
Vec
<
(
Task
,
u32
,
u32
,
u32
,
u32
)
>
=
vec!
();
for
t
in
tasks
{
let
r_t
=
response_time
(
t
,
tasks
,
ip
,
tr
);
let
c_t
=
wcet
(
&
t
.trace
);
let
b_t
=
block_time
(
t
,
tasks
,
ip
,
tr
);
let
i_t
=
interference_time
(
t
,
tasks
);
analysis
.push
((
t
.clone
(),
r_t
,
c_t
,
b_t
,
i_t
));
}
return
analysis
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment