-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[difftest] cosmic refactor (break verilator temporally)
- Loading branch information
Showing
20 changed files
with
282 additions
and
161 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "dpi_common" | ||
edition = "2021" | ||
version.workspace = true | ||
|
||
[dependencies] | ||
svdpi = { workspace = true } | ||
tracing = { workspace = true } | ||
tracing-subscriber = { workspace = true } | ||
|
||
[features] | ||
vcs = ["svdpi/vpi"] | ||
verilator = ["svdpi/sv2023"] | ||
trace = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use tracing_subscriber::{EnvFilter, FmtSubscriber}; | ||
|
||
pub fn setup_logger() { | ||
let global_logger = FmtSubscriber::builder() | ||
.with_env_filter(EnvFilter::from_default_env()) // default level: error | ||
.without_time() | ||
.with_target(false) | ||
.with_ansi(true) | ||
.compact() | ||
.finish(); | ||
tracing::subscriber::set_global_default(global_logger) | ||
.expect("internal error: fail to setup log subscriber"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
use std::path::PathBuf; | ||
|
||
use clap::Parser; | ||
|
||
pub mod dpi; | ||
pub mod drive; | ||
|
||
#[derive(Parser)] | ||
pub(crate) struct OfflineArgs { | ||
/// Path to the ELF file | ||
#[arg(long)] | ||
pub elf_file: PathBuf, | ||
|
||
/// Path to the log file | ||
#[arg(long)] | ||
pub log_file: Option<PathBuf>, | ||
|
||
/// Log level: trace, debug, info, warn, error | ||
#[arg(long, default_value = "info")] | ||
pub log_level: String, | ||
|
||
/// vlen config | ||
#[arg(long, default_value = env!("DESIGN_VLEN"))] | ||
pub vlen: u32, | ||
|
||
/// dlen config | ||
#[arg(long, default_value = env!("DESIGN_DLEN"))] | ||
pub dlen: u32, | ||
|
||
/// ISA config | ||
#[arg(long, default_value = env!("SPIKE_ISA_STRING"))] | ||
pub set: String, | ||
|
||
#[cfg(feature = "trace")] | ||
#[arg(long)] | ||
pub wave_path: String, | ||
|
||
#[cfg(feature = "trace")] | ||
#[arg(long, default_value = "")] | ||
pub dump_range: String, | ||
|
||
#[arg(long, default_value_t = 1000000)] | ||
pub timeout: u64, | ||
} | ||
|
||
// keep in sync with TestBench.ClockGen | ||
pub const CYCLE_PERIOD: u64 = 20; | ||
|
||
/// get cycle | ||
pub fn get_t() -> u64 { | ||
svdpi::get_time() / CYCLE_PERIOD | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.