fix try_force_new_branches
This commit is contained in:
parent
d569df29a3
commit
0e5bf879e4
@ -74,13 +74,13 @@ pub fn try_force_new_branches(interrupt_ticks : &[u32], fbs: &STGFeedbackState,
|
||||
let mut new = false;
|
||||
let mut new_interrupt_times = Vec::new();
|
||||
for (num,&interrupt_time) in interrupt_ticks.iter().enumerate() {
|
||||
let lower_bound = interrupt_time + unsafe{MINIMUM_INTER_ARRIVAL_TIME};
|
||||
let lower_bound = if num==0 {FIRST_INT} else {interrupt_ticks[num-1].saturating_add(unsafe{MINIMUM_INTER_ARRIVAL_TIME})};
|
||||
let next = if interrupt_ticks.len()>num {interrupt_ticks[num+1]} else {u32::MAX};
|
||||
for exec_interval in meta.intervals.iter().filter(|x| x.start_tick >= lower_bound as u64 && x.start_tick < next as u64) {
|
||||
if !(exec_interval.start_capture.0==CaptureEvent::ISRStart) { // shortcut to skip interrupt handers without node lookup
|
||||
let node_index = fbs.state_abb_hash_index.get(&exec_interval.get_hash_index()).unwrap();
|
||||
if !has_interrupt_handler_non_systick(&fbs.graph, node_index.clone()) {
|
||||
new_interrupt_times.push(lower_bound);
|
||||
new_interrupt_times.push((exec_interval.start_tick.saturating_add((exec_interval.end_tick+exec_interval.start_tick)/4)).try_into().expect("ticks > u32"));
|
||||
new_interrupt_times.append(interrupt_ticks[num+2..].to_vec().as_mut());
|
||||
new=true;
|
||||
break;
|
||||
|
@ -430,6 +430,6 @@ where
|
||||
// TODO maybe enforce entry.exec_time().is_some()
|
||||
let et = entry.exec_time().expect("testcase.exec_time is needed for scheduler");
|
||||
let tns : i64 = et.as_nanos().try_into().expect("failed to convert time");
|
||||
Ok((tns as f64)/1000.0) //microseconds
|
||||
Ok(((tns as f64)/1000.0).powf(2.0)) //microseconds
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user