pub(super) fn measure_replay_harness(
    input: &MeasureInput,
    core: &mut Core,
    ktests: &Vec<KTest>,
    app: &AppInfo,
) -> Result<Vec<Vec<MeasurementResult>>> {
    let mut measurements: Vec<Vec<MeasurementResult>> = Vec::new();
    let halt_timeout = input.halt_timeout.unwrap_or(DEFAULT_HALT_TIMEOUT_SECONDS);

    // Measure the replay harness using all generated test vectors
    for ktest in ktests {
        // Continue until reaching BKPT 255 (replaystart)
        run_to_replay_start(core, halt_timeout)
            .context("Could not continue to the ReplayStart breakpoint")?;
        write_replay_objects(core, &app.variables, &ktest)
            .with_context(|| format!("Could not write to memory with KTest: {:?}", &ktest))?;

        let bkpts = read_breakpoints(core, &ktest, app, halt_timeout)?;
        measurements.push(bkpts);
    }

    Ok(measurements)
}
/// Runs the replay harness and measures the clock cycles.
///
/// * `core` - A connected probe-rs _core_
/// * `ktests` - The generated test vectors
/// * `app` - Relevant information of the replay binary
Runs the replay harness and measures the clock cycles.
Runs the replay harness and measures the clock cycles .
pub(super) fn measure_replay_harness(
    input: &MeasureInput,
    core: &mut Core,
    ktests: &Vec<KTest>,
    app: &AppInfo,
) -> Result<Vec<Vec<MeasurementResult>>> {
    let mut measurements: Vec<Vec<MeasurementResult>> = Vec::new();
    let halt_timeout = input.halt_timeout.unwrap_or(DEFAULT_HALT_TIMEOUT_SECONDS);
    // Measure the replay harness using all generated test vectors
    for ktest in ktests {
        // Continue until reaching BKPT 255 (replaystart)
        run_to_replay_start(core, halt_timeout)
            .context("Could not continue to the ReplayStart breakpoint")?;
        write_replay_objects(core, &app.variables, &ktest)
            .with_context(|| format!("Could not write to memory with KTest: {:?}", &ktest))?;
        let bkpts = read_breakpoints(core, &ktest, app, halt_timeout)?;
        measurements.push(bkpts);
    }
    Ok(measurements)
}
pub ( super ) fn measure_replay_harness ( input : & MeasureInput , core : & mut Core , ktests : & Vec < KTest > , app : & AppInfo , ) -> Result < Vec < Vec < MeasurementResult > > > { let mut measurements : Vec < Vec < MeasurementResult > > = Vec :: new ( ) ; let halt_timeout = input . halt_timeout . unwrap_or ( DEFAULT_HALT_TIMEOUT_SECONDS ) ; // Measure the replay harness using all generated test vectors for ktest in ktests { // Continue until reaching BKPT 255 (replaystart) run_to_replay_start ( core , halt_timeout ) . context ( " " ) ? ; write_replay_objects ( core , & app . variables , & ktest ) . with_context ( | | format ! ( " " ktest ) ) ? ; let bkpts = read_breakpoints ( core , & ktest , app , halt_timeout ) ? ; measurements . push ( bkpts ) ; } Ok ( measurements ) }
Runs the replay harness and measures the clock cycles.
Runs the replay harness and measures the clock cycles .
input
&MeasureInput
core
&mut Core
ktests
&Vec<KTest>
app
&AppInfo
input
&MeasureInput
core
&mut Core
ktests
&Vec<KTest>
app
&AppInfo