From 019f342c9812c29e72fc29cf0b74dffdd26214c9 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sat, 8 Feb 2025 04:35:02 +0800 Subject: [PATCH] update bio tests for clkmode option --- libs/xous-bio-bdma/src/bio_tests/dma.rs | 13 +- utralib/cramium/core.svd | 2 +- utralib/cramium/daric.svd | 200 ++++++++++++++++++++++-- 3 files changed, 202 insertions(+), 13 deletions(-) diff --git a/libs/xous-bio-bdma/src/bio_tests/dma.rs b/libs/xous-bio-bdma/src/bio_tests/dma.rs index 73ad8f000..cd1894d3d 100644 --- a/libs/xous-bio-bdma/src/bio_tests/dma.rs +++ b/libs/xous-bio-bdma/src/bio_tests/dma.rs @@ -1,6 +1,7 @@ use core::mem::size_of; use utra::bio_bdma::SFR_CFGINFO; +use utralib::utra::bio_bdma::SFR_CONFIG_CLOCKING_MODE; use crate::*; @@ -84,7 +85,7 @@ pub fn filter_test() -> usize { bio_ss.bio.wo(utra::bio_bdma::SFR_FILTER_BOUNDS_2, (0x6000_0000 - HW_IOX_BASE as u32) >> 12); // with the filters so set, test some transactions that "should" pass - if dma_basic(false) != 4 { + if dma_basic(false, 0) != 4 { passing = false; print!("DMA Filter: allowed transactions are incorrectly blocked"); }; @@ -195,7 +196,7 @@ pub fn filter_test() -> usize { /// /// The `concurrent` flag causes the CPU to do concurrent traffic during the test to /// exercise contention on AXI bus. -pub fn dma_basic(concurrent: bool) -> usize { +pub fn dma_basic(concurrent: bool, clkmode: u8) -> usize { const TEST_LEN: usize = 64; let mut passing = 0; if !concurrent { @@ -212,6 +213,9 @@ pub fn dma_basic(concurrent: bool) -> usize { bio_ss.bio.wo(utra::bio_bdma::SFR_CTRL, 0x0); bio_ss.load_code(dma_basic_code(), 0, BioCore::Core0); + // setup clocking mode option + bio_ss.bio.rmwf(SFR_CONFIG_CLOCKING_MODE, clkmode as u32); + // These actually "don't matter" because there are no synchronization instructions in the code // Everything runs at "full tilt" bio_ss.bio.wo(utra::bio_bdma::SFR_QDIV0, 0x1_0000); @@ -640,7 +644,7 @@ bio_code!(dma_mc_dst_addr_code, DMA_MC_DST_ADDR_START, DMA_MC_DST_ADDR_END, ); /// Attempt to fire off all four engines at once, simultaneously, for maximum bus contention -pub fn dma_coincident() -> usize { +pub fn dma_coincident(clkmode: u8) -> usize { let mut passing = 0; print!("DMA coincident\r"); // clear prior test config state @@ -651,6 +655,9 @@ pub fn dma_coincident() -> usize { // reset all the fifos bio_ss.bio.wo(utra::bio_bdma::SFR_FIFO_CLR, 0xF); + // setup clocking mode option + bio_ss.bio.rmwf(SFR_CONFIG_CLOCKING_MODE, clkmode as u32); + // stop all the machines, so that code can be loaded bio_ss.bio.wo(utra::bio_bdma::SFR_CTRL, 0x0); bio_ss.load_code(dma_coincident_code(), 0, BioCore::Core0); diff --git a/utralib/cramium/core.svd b/utralib/cramium/core.svd index f8233d5cd..d731f2651 100644 --- a/utralib/cramium/core.svd +++ b/utralib/cramium/core.svd @@ -3,7 +3,7 @@ litex SOC - + 8 32 diff --git a/utralib/cramium/daric.svd b/utralib/cramium/daric.svd index 99a48be5d..7c8afa602 100644 --- a/utralib/cramium/daric.svd +++ b/utralib/cramium/daric.svd @@ -552,6 +552,14 @@ bit position to clear the flag]]> + + aluinvld + 5 + [5:5] + 5 + + @@ -1124,6 +1132,13 @@ bit position to clear the flag]]> 4 + + cr_opt_ifskey + 5 + [5:5] + 5 + + @@ -1569,10 +1584,74 @@ bit position to clear the flag]]> + + SFR_TICKCYC + + 0x0050 + 0x00 + 32 + + + sfr_tickcyc + 7 + [7:0] + 0 + + + + + + SFR_TICKCNT + + 0x0054 + 0x00 + 32 + + + sfr_tickcnt + 31 + [31:0] + 0 + + + + + + SFR_MASKSEED + + 0x0060 + 0x00 + 32 + + + sfr_maskseed + 31 + [31:0] + 0 + + + + + + SFR_MASKSEEDAR + + 0x0064 + 0x00 + 32 + + + sfr_maskseedar + 31 + [31:0] + 0 + + + + 0 - 0x44 + 0x68 registers @@ -2090,10 +2169,42 @@ position to clear the flag]]> + + SFR_WDATABYPASS_MODE + + 0x0070 + 0x00 + 32 + + + sfr_wdatabypass_mode + 1 + [1:0] + 0 + + + + + + SFR_WDATABYPASS_DATA + + 0x0074 + 0x00 + 32 + + + sfr_wdatabypass_data + 31 + [31:0] + 0 + + + + 0 - 0x64 + 0x78 registers @@ -2393,10 +2504,74 @@ bit position to clear the flag]]> + + SFR_TS_SR_TS0 + + 0x00e0 + 0x00 + 32 + + + sr_ts0 + 31 + [31:0] + 0 + + + + + + SFR_TS_SR_TS1 + + 0x00e4 + 0x00 + 32 + + + sr_ts1 + 31 + [31:0] + 0 + + + + + + SFR_TS_SR_TS2 + + 0x00e8 + 0x00 + 32 + + + sr_ts2 + 31 + [31:0] + 0 + + + + + + SFR_TS_SR_TS3 + + 0x00ec + 0x00 + 32 + + + sr_ts3 + 31 + [31:0] + 0 + + + + 0 - 0x64 + 0xf0 registers @@ -3376,7 +3551,7 @@ position to clear the flag]]> 7 [7:0] 0 - + @@ -3392,7 +3567,7 @@ position to clear the flag]]> 7 [7:0] 0 - + @@ -3408,7 +3583,7 @@ position to clear the flag]]> 7 [7:0] 0 - + @@ -3424,7 +3599,7 @@ position to clear the flag]]> 7 [7:0] 0 - + @@ -3738,6 +3913,13 @@ respective bit position to clear the flag]]> 7 + + clocking_mode + 9 + [9:8] + 8 + + @@ -10517,8 +10699,8 @@ position to clear the flag]]> vdena - 3 - [3:0] + 5 + [5:0] 0