From ae67b0da8e9baf61dfa8e575d3bd2c734f67b64b Mon Sep 17 00:00:00 2001 From: Rowan Hart Date: Tue, 17 Sep 2024 14:28:26 -0700 Subject: [PATCH] Bump simulator bindings version and update cfg for simics_version (#105) --- Cargo.toml | 10 +++++----- src/lib.rs | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5f70a094..a801c06a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ yaxpeax-riscv = { git = "https://github.com/DrChat/yaxpeax-riscv", version = "0. "serde", ], rev = "5973ff8" } crc32fast = "1.4.2" -simics = "0.1.1" +simics = "0.1.2" indoc = "2.0.5" serde = { version = "1.0.210", features = ["derive"] } serde_json = "1.0.128" @@ -105,16 +105,16 @@ thiserror = "1.0.63" lcov2 = "0.1.0" [dev-dependencies] -simics-test = "0.1.0" +simics-test = "0.1.1" anyhow = "1.0.86" command-ext = "0.1.2" indoc = "2.0.5" -ispm-wrapper = "0.1.0" +ispm-wrapper = "0.1.1" versions = { version = "6.2.0", features = ["serde"] } [build-dependencies] -simics = "0.1.1" -simics-build-utils = "0.1.0" +simics = "0.1.2" +simics-build-utils = "0.1.1" [profile.release] lto = true diff --git a/src/lib.rs b/src/lib.rs index 1b27e0a8..4612aa53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,7 +30,7 @@ use crate::interfaces::{config::config, fuzz::fuzz}; use crate::state::SolutionKind; -#[cfg(simics_version_6)] +#[cfg(simics_version = "6")] use crate::util::Utils; use anyhow::{anyhow, Result}; use arch::{Architecture, ArchitectureHint, ArchitectureOperations}; @@ -55,11 +55,11 @@ use simics::{ CoreSimulationStoppedHap, CpuInstrumentationSubscribeInterface, Event, EventClassFlag, FromConfObject, HapHandle, Interface, }; -#[cfg(simics_version_6)] +#[cfg(simics_version = "6")] use simics::{ discard_future, restore_micro_checkpoint, save_micro_checkpoint, MicroCheckpointFlags, }; -#[cfg(simics_version_7)] +#[cfg(simics_version = "7")] // NOTE: save_snapshot used because it is a stable alias for both save_snapshot and take_snapshot // which is necessary because this module is compatible with base versions which cross the // deprecation boundary @@ -735,7 +735,7 @@ impl Tsffs { self.log(LogMessage::startup())?; - #[cfg(simics_version_7)] + #[cfg(simics_version = "7")] { if self.pre_snapshot_checkpoint { debug!( @@ -759,7 +759,7 @@ impl Tsffs { .map_err(|_| anyhow!("Snapshot name already set"))?; } - #[cfg(simics_version_6)] + #[cfg(simics_version = "6")] { if self.pre_snapshot_checkpoint { debug!( @@ -805,9 +805,9 @@ impl Tsffs { /// Restore the initial snapshot using the configured method (either rev-exec micro checkpoints /// or snapshots) pub fn restore_initial_snapshot(&mut self) -> Result<()> { - #[cfg(simics_version_7)] + #[cfg(simics_version = "7")] restore_snapshot(Self::SNAPSHOT_NAME)?; - #[cfg(simics_version_6)] + #[cfg(simics_version = "6")] { restore_micro_checkpoint(*self.micro_checkpoint_index.get().ok_or_else(|| { anyhow!("Not using snapshots and no micro checkpoint index present") @@ -821,9 +821,9 @@ impl Tsffs { /// Whether an initial snapshot has been saved pub fn have_initial_snapshot(&self) -> bool { - let have = if cfg!(simics_version_7) { + let have = if cfg!(simics_version = "7") { self.snapshot_name.get().is_some() - } else if cfg!(simics_version_6) { + } else if cfg!(simics_version = "6") { self.snapshot_name.get().is_some() && self.micro_checkpoint_index.get().is_some() } else { error!(self.as_conf_object(), "Unsupported SIMICS version");