Skip to content

Commit

Permalink
Run ci/cd pipeline in a multicore setup
Browse files Browse the repository at this point in the history
Now we run the ci/cd pipeline with a single core. Going multicore make the tests overall more robust to pass as we might encounters race conditions.
  • Loading branch information
francois141 committed Oct 26, 2024
1 parent 8d767b6 commit 1705ab6
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 193 deletions.
33 changes: 30 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 0 additions & 57 deletions config/test/qemu-rustsbi-test-kernel-spike.toml

This file was deleted.

2 changes: 1 addition & 1 deletion config/test/qemu-virt-benchmark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ color = true
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = true
Expand Down
57 changes: 0 additions & 57 deletions config/test/qemu-virt-hello-world-payload-spike.toml

This file was deleted.

2 changes: 1 addition & 1 deletion config/test/qemu-virt-hello-world-payload.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ max_firmware_exits = 2000
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = false
Expand Down
2 changes: 1 addition & 1 deletion config/test/qemu-virt-release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ max_firmware_exits = 2000
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = false
Expand Down
23 changes: 0 additions & 23 deletions config/test/qemu-virt-sifive-u54-spike.toml

This file was deleted.

2 changes: 1 addition & 1 deletion config/test/qemu-virt-sifive-u54.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ color = true
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8
boot_hart_id = 0

[benchmark]
Expand Down
2 changes: 1 addition & 1 deletion config/test/qemu-virt-test-payload-lock.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ color = true
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8
boot_hart_id = 0

[benchmark]
Expand Down
2 changes: 1 addition & 1 deletion config/test/qemu-virt-test-protect-payload.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ color = true
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = false
Expand Down
2 changes: 1 addition & 1 deletion config/test/qemu-virt-u-boot-payload.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ max_firmware_exits = 2000
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = false
Expand Down
2 changes: 1 addition & 1 deletion config/test/qemu-virt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ max_firmware_exits = 2000
max_pmp = 8

[platform]
nb_harts = 1
nb_harts = 8

[benchmark]
enable = false
3 changes: 2 additions & 1 deletion crates/abi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ license = "MIT"
[dependencies]
miralis_core = { path = "../core" }
log = { workspace = true }
config_helpers = { path = "../config_helpers"}
config_helpers = { path = "../config_helpers"}
spin = "0.9.8"
13 changes: 9 additions & 4 deletions crates/abi/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use core::fmt::Write;

use log::{LevelFilter, Metadata, Record};
use spin::Once;

use crate::miralis_log;

Expand Down Expand Up @@ -34,14 +35,18 @@ impl log::Log for Logger {
fn flush(&self) {}
}

static LOGGER_INIT: Once = Once::new();

/// Initialize the firmware logger
///
/// This function is called automatically by `setup_binary!`.
pub fn init() {
static LOGGER: Logger = Logger {};

log::set_logger(&LOGGER).unwrap();
log::set_max_level(LevelFilter::Trace);
LOGGER_INIT.call_once(|| {
if let Err(err) = log::set_logger(&Logger {}) {
panic!("Failed to set logger: {}", err);
}
log::set_max_level(LevelFilter::Trace);
});
}

// —————————————————————————————— Stack Buffer —————————————————————————————— //
Expand Down
4 changes: 3 additions & 1 deletion firmware/csr_ops/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,9 @@ fn test_csr_id() {
out(reg) res
);
};
assert_eq!(res, 0, "Invalid mhartid");

let is_between_0_and_16: fn(usize) -> bool = |n: usize| n < 16;
assert!(is_between_0_and_16(res), "Invalid mhartid");
}

// —————————————————————————— Machine ISA register —————————————————————————— //
Expand Down
4 changes: 0 additions & 4 deletions firmware/device/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ fn main() -> ! {
(TEST_DEVICE_MAGIC_REGISTER as *const u32).read_volatile(),
0xdeadbeef
);
assert_eq!(
(TEST_DEVICE_REMOTE_REGISTER as *const u32).read_volatile(),
0x0
);

// Test write
(TEST_DEVICE_REMOTE_REGISTER as *mut u32).write_volatile(0x43);
Expand Down
2 changes: 1 addition & 1 deletion firmware/interrupt/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ fn set_mtimecmp_future_value() {

// Read back the value to verify
let read_back = unsafe { mtimecmp_ptr.read_volatile() };
assert_eq!(read_back, future_time, "mtimecmp set correctly");
assert!(read_back > current_mtime, "mtimecmp set correctly");
}

#[allow(unreachable_code)]
Expand Down
1 change: 1 addition & 0 deletions firmware/vectored_mtvec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ name = "vectored_mtvec"
path = "main.rs"

[dependencies]
spin = "0.9.8"
miralis_abi = { path = "../../crates/abi" }
log = { workspace = true }
Loading

0 comments on commit 1705ab6

Please sign in to comment.