From 0e5bf879e4e6c31187858c913cb99a063199fefc Mon Sep 17 00:00:00 2001 From: Alwin Berger Date: Thu, 4 Jul 2024 12:49:09 +0200 Subject: [PATCH] fix try_force_new_branches --- fuzzers/FRET/src/systemstate/mutational.rs | 4 ++-- fuzzers/FRET/src/time/worst.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fuzzers/FRET/src/systemstate/mutational.rs b/fuzzers/FRET/src/systemstate/mutational.rs index d1e73022ca..62b4bc69a9 100644 --- a/fuzzers/FRET/src/systemstate/mutational.rs +++ b/fuzzers/FRET/src/systemstate/mutational.rs @@ -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; diff --git a/fuzzers/FRET/src/time/worst.rs b/fuzzers/FRET/src/time/worst.rs index f7ddae3bdb..69f7cd3c30 100644 --- a/fuzzers/FRET/src/time/worst.rs +++ b/fuzzers/FRET/src/time/worst.rs @@ -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 } } \ No newline at end of file