Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cases] rvv_bench built from upstream source #676

Merged
merged 3 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions difftest/online_dpi/src/dpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#![allow(unused_variables)]

use clap::Parser;
use std::ffi::{c_char, c_longlong, CString};
use std::ffi::{c_char, c_longlong};
use std::sync::Mutex;
use tracing::debug;

Expand Down Expand Up @@ -47,7 +47,7 @@ unsafe fn load_from_payload<'a>(
let data = &byte_vec[strb_width_in_byte..];

let strb_width_in_bit = std::cmp::min(8, data_width_in_byte);
let mut masks: Vec<bool> = strobe
let masks: Vec<bool> = strobe
.into_iter()
.flat_map(|strb| {
let mask: Vec<bool> = (0..strb_width_in_bit).map(|i| (strb & (1 << i)) != 0).collect();
Expand Down Expand Up @@ -271,10 +271,10 @@ unsafe extern "C" fn retire_vector_mem(dummy: *const SvBitVecVal) {
// import functions and wrappers
//--------------------------------

#[cfg(feature = "trace")]
mod dpi_export {
use std::ffi::c_char;
extern "C" {
#[cfg(feature = "trace")]
/// `export "DPI-C" function dump_wave(input string file)`
pub fn dump_wave(path: *const c_char);
}
Expand All @@ -283,6 +283,7 @@ mod dpi_export {
#[cfg(feature = "trace")]
pub(crate) fn dump_wave(scope: crate::svdpi::SvScope, path: &str) {
use crate::svdpi;
use std::ffi::CString;
let path_cstring = CString::new(path).unwrap();

svdpi::set_scope(scope);
Expand Down
4 changes: 3 additions & 1 deletion difftest/online_dpi/src/drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub(crate) struct Driver {
spike_runner: SpikeRunner,

// SvScope from t1_cosim_init
#[cfg(feature = "trace")]
scope: SvScope,

#[cfg(feature = "trace")]
Expand Down Expand Up @@ -161,8 +162,9 @@ impl Driver {

let mut self_ = Self {
spike_runner: SpikeRunner::new(&args.common_args, false),
scope,

#[cfg(feature = "trace")]
scope,
#[cfg(feature = "trace")]
wave_path: args.wave_path.to_owned(),
#[cfg(feature = "trace")]
Expand Down
4 changes: 2 additions & 2 deletions script/emu/src/Main.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ object Main:
"--no-link",
"--print-out-paths",
"--no-warn-dirty",
s".#t1.${config}.${caseAttrRoot}.${caseName}"
s".#t1.${config}.ip.${caseAttrRoot}.${caseName}"
)
Logger.trace(
s"Running `${nixArgs.mkString(" ")}` to get test case ELF file"
Expand All @@ -80,7 +80,7 @@ object Main:
): os.Path =
// FIXME: replace with actual trace emulator here
val target =
if (isTrace) then s"${emuType}.difftest" else s"${emuType}.difftest"
if (isTrace) then s"${emuType}.verilator-emu" else s"${emuType}.verilator-emu"
val nixArgs = Seq(
"nix",
"build",
Expand Down
10 changes: 6 additions & 4 deletions tests/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ let
builtins.fromJSON (lib.fileContents extraFeatures)
else [ ];

filterByFeatures = caseName: caseDrv:
assert lib.assertMsg (caseDrv ? featuresRequired) "${caseName} doesn't have features specified";
# Test the case required extensions is supported by rtl design
isSubsetOf currentFeatures caseDrv.featuresRequired;

findAndBuild = dir: build:
lib.recurseIntoAttrs (lib.pipe (builtins.readDir dir) [
# filter out all non-directory entrires and underscore-prefixed directories
Expand All @@ -60,10 +65,7 @@ let
inherit caseName sourcePath;
})
)
(lib.filterAttrs (caseName: caseDrv:
assert lib.assertMsg (caseDrv ? featuresRequired) "${caseName} doesn't have features specified";
# Test the case required extensions is supported by rtl design
isSubsetOf currentFeatures caseDrv.featuresRequired))
(lib.filterAttrs casesSelf.filterByFeatures)
]);
t1main = ./t1_main.S;
linkerScript = ./t1.ld;
Expand Down
170 changes: 0 additions & 170 deletions tests/rvv_bench/_include/bench.h

This file was deleted.

25 changes: 0 additions & 25 deletions tests/rvv_bench/_include/config.h

This file was deleted.

80 changes: 0 additions & 80 deletions tests/rvv_bench/_include/nolibc.h

This file was deleted.

Loading