mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
improve reset condition for filter & make pass criteria tighter
- filter setup can be impacted by previous engine running, make sure engines are stopped and FIFOs flushed prior to test start - when reading a filtered bank we can get garbage, so make the test check for the specific value we should see.
This commit is contained in:
parent
81f0523ee3
commit
0b419400c7
1 changed files with 23 additions and 4 deletions
|
|
@ -49,11 +49,19 @@ pub fn dma_filter_off() {
|
||||||
|
|
||||||
pub fn filter_test() -> usize {
|
pub fn filter_test() -> usize {
|
||||||
print!("==Filter test==\r");
|
print!("==Filter test==\r");
|
||||||
|
// clear any prior test config state
|
||||||
|
let mut test_cfg = CSR::new(utra::csrtest::HW_CSRTEST_BASE as *mut u32);
|
||||||
|
test_cfg.wo(utra::csrtest::WTEST, 0);
|
||||||
|
|
||||||
let mut passing = true;
|
let mut passing = true;
|
||||||
use utralib::generated::HW_SRAM_MEM as RAM_BASE;
|
use utralib::generated::HW_SRAM_MEM as RAM_BASE;
|
||||||
use utralib::generated::HW_SRAM_MEM_LEN as RAM_SIZE;
|
use utralib::generated::HW_SRAM_MEM_LEN as RAM_SIZE;
|
||||||
|
|
||||||
let mut bio_ss = BioSharedState::new();
|
let mut bio_ss = BioSharedState::new();
|
||||||
|
bio_ss.bio.wo(utra::bio_bdma::SFR_CTRL, 0x0);
|
||||||
|
// reset all the fifos
|
||||||
|
bio_ss.bio.wo(utra::bio_bdma::SFR_FIFO_CLR, 0xF);
|
||||||
|
|
||||||
// enable the filters
|
// enable the filters
|
||||||
bio_ss.bio.rmwf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_MEM, 0);
|
bio_ss.bio.rmwf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_MEM, 0);
|
||||||
bio_ss.bio.rmwf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_PERI, 0);
|
bio_ss.bio.rmwf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_PERI, 0);
|
||||||
|
|
@ -85,6 +93,14 @@ pub fn filter_test() -> usize {
|
||||||
// *** increments 3 ret values total
|
// *** increments 3 ret values total
|
||||||
// - access to the BIO_BDMA registers: try to disable the filters.
|
// - access to the BIO_BDMA registers: try to disable the filters.
|
||||||
print!("attempt to violate peri filter\r");
|
print!("attempt to violate peri filter\r");
|
||||||
|
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_MEM) != 0 {
|
||||||
|
passing = false;
|
||||||
|
print!("peri range filter pre-condition fail A\r");
|
||||||
|
}
|
||||||
|
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_PERI) != 0 {
|
||||||
|
passing = false;
|
||||||
|
print!("peri range filter pre-condition fail B\r");
|
||||||
|
}
|
||||||
cache_flush();
|
cache_flush();
|
||||||
let naughty_dma_ptr: &mut [u32] = unsafe {
|
let naughty_dma_ptr: &mut [u32] = unsafe {
|
||||||
core::slice::from_raw_parts_mut(
|
core::slice::from_raw_parts_mut(
|
||||||
|
|
@ -102,11 +118,11 @@ pub fn filter_test() -> usize {
|
||||||
// check that the values did not change
|
// check that the values did not change
|
||||||
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_MEM) != 0 {
|
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_MEM) != 0 {
|
||||||
passing = false;
|
passing = false;
|
||||||
print!("peri range filter FAIL\r");
|
print!("peri range filter FAIL A\r");
|
||||||
}
|
}
|
||||||
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_PERI) != 0 {
|
if bio_ss.bio.rf(utra::bio_bdma::SFR_CONFIG_DISABLE_FILTER_PERI) != 0 {
|
||||||
passing = false;
|
passing = false;
|
||||||
print!("peri range filter FAIL\r");
|
print!("peri range filter FAIL B\r");
|
||||||
}
|
}
|
||||||
// attempt to read the config word
|
// attempt to read the config word
|
||||||
bio_ss.bio.wo(
|
bio_ss.bio.wo(
|
||||||
|
|
@ -117,9 +133,12 @@ pub fn filter_test() -> usize {
|
||||||
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, 4); // initiate a single transfer
|
bio_ss.bio.wo(utra::bio_bdma::SFR_TXF0, 4); // initiate a single transfer
|
||||||
while bio_ss.bio.r(utra::bio_bdma::SFR_EVENT_STATUS) & 0x1 == 0 {}
|
while bio_ss.bio.r(utra::bio_bdma::SFR_EVENT_STATUS) & 0x1 == 0 {}
|
||||||
cache_flush();
|
cache_flush();
|
||||||
if target[0] != 0x0 {
|
let tval = target[0];
|
||||||
|
if tval == 0x1000_0408 {
|
||||||
passing = false;
|
passing = false;
|
||||||
print!("peri range read filter FAIL\r")
|
print!("peri range read filter FAIL target[0]->{:x} got a correct value of 0x10000408\r", tval);
|
||||||
|
} else {
|
||||||
|
print!("CFGINFO returned {:x}, != 0x10000408\r", tval);
|
||||||
}
|
}
|
||||||
print!("peri violation test done\r");
|
print!("peri violation test done\r");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue