improve the bdma test

this makes the output of the bdma test a bit more compact, and
adds some features to help CI automation to pick out failures
to help validate if fixes are durable
This commit is contained in:
bunnie 2025-11-18 18:11:49 +08:00
parent b64cff6f86
commit d45330e65d
2 changed files with 16 additions and 8 deletions

View file

@ -6,7 +6,7 @@ use utralib::utra::bio_bdma::SFR_CONFIG_CLOCKING_MODE;
use utralib::*;
use xous_bio_bdma::*;
use crate::{print, println};
use crate::println;
/*
pub fn bdma_test(_args: &Vec<String>, seed: u32) -> usize {
@ -204,8 +204,7 @@ impl TestPattern {
}
}
pub fn bdma_coincident_test(_args: &Vec<String>, seed: u32) -> usize {
let clkmode = 0;
pub fn bdma_coincident_test(_args: &Vec<String>, seed: u32, clkmode: u32) -> usize {
const TEST_LEN: usize = 1024;
let mut passing = 0;
@ -286,10 +285,10 @@ fn coincident_u32(
for (i, &d) in src.iter().enumerate() {
let rbk = unsafe { dst.as_ptr().add(i).read_volatile() };
if rbk != d {
if errs < 4 {
if errs < 3 {
println!("{} err @{}, {:x} rbk: {:x}", name, i, d, rbk);
} else {
print!(".");
// crate::print!(".");
}
errs += 1;
pass = 0;

View file

@ -458,11 +458,20 @@ impl Repl {
#[cfg(feature = "bao1x-bio")]
"bdma" => {
let mut seed = 0;
let mut clkmode: u32 = 3;
let mut passing: bool;
loop {
crate::platform::bio::bdma_coincident_test(&args, seed);
crate::println!("seed {}, clkmode {}", seed, clkmode);
if crate::platform::bio::bdma_coincident_test(&args, seed, clkmode) != 4 {
clkmode = (clkmode + 1) % 4;
passing = false;
crate::println!("~~BDMAFAIL~~");
} else {
passing = true
};
crate::println!(" pasing: {:?}", passing);
seed += 1;
crate::println!("seed {}", seed);
if seed > 32 {
if passing || seed > 8 {
break;
}
}