mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
Merge branch 'main' of https://github.com/vihaanjim/xous-core into HEAD
This commit is contained in:
commit
c858eb50d8
8 changed files with 9143 additions and 18 deletions
96
Cargo.lock
generated
96
Cargo.lock
generated
|
|
@ -4902,7 +4902,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-ticktimer",
|
||||
|
|
@ -5068,7 +5072,11 @@ dependencies = [
|
|||
"usbd_scsi 0.1.1",
|
||||
"utralib",
|
||||
"vcell",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -5093,7 +5101,11 @@ dependencies = [
|
|||
"usbd-human-interface-device 0.1.1",
|
||||
"utralib",
|
||||
"vcell",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -5156,7 +5168,11 @@ dependencies = [
|
|||
"typenum",
|
||||
"usb-device",
|
||||
"usbd_mass_storage 0.1.0",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-ticktimer",
|
||||
]
|
||||
|
||||
|
|
@ -5230,7 +5246,11 @@ dependencies = [
|
|||
"usb-device",
|
||||
"usbd_bulk_only_transport 0.1.0",
|
||||
"usbd_mass_storage 0.1.0",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-ticktimer",
|
||||
]
|
||||
|
||||
|
|
@ -5310,7 +5330,11 @@ dependencies = [
|
|||
"usbd-human-interface-device 0.2.1",
|
||||
"userprefs",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -5866,13 +5890,33 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
<<<<<<< HEAD
|
||||
name = "xous-api-log"
|
||||
version = "0.1.44"
|
||||
=======
|
||||
name = "xous"
|
||||
version = "0.9.48"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c291e0efc56bc20b4c434ac239b8d6d49bf2ec3bf9cac991fdc0d702e2ff4b2d"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xous-api-log"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "797ff15cb41c855dfc21311da441e35cc583baa9ef238627ef33f05912d9367c"
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
dependencies = [
|
||||
"log",
|
||||
"num-derive",
|
||||
"num-traits",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
|
|
@ -5886,7 +5930,11 @@ dependencies = [
|
|||
"num-derive",
|
||||
"num-traits",
|
||||
"rkyv",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -5902,7 +5950,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -5918,7 +5970,11 @@ dependencies = [
|
|||
"num-derive",
|
||||
"num-traits",
|
||||
"rkyv",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -5932,7 +5988,11 @@ version = "0.9.48"
|
|||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"rkyv",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5943,7 +6003,11 @@ checksum = "9bc1dd2cd7306d496d9606796905d472ca51f7889423363c96c2296506963234"
|
|||
dependencies = [
|
||||
"bitflags 1.3.2",
|
||||
"rkyv",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5963,7 +6027,11 @@ dependencies = [
|
|||
"rand_chacha 0.3.1",
|
||||
"stats_alloc",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-riscv",
|
||||
]
|
||||
|
||||
|
|
@ -5977,7 +6045,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
@ -5991,7 +6063,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
|
@ -6006,7 +6082,11 @@ dependencies = [
|
|||
"pio",
|
||||
"pio-proc",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6016,7 +6096,11 @@ dependencies = [
|
|||
"bitfield",
|
||||
"log",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -6044,7 +6128,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -6061,7 +6149,11 @@ dependencies = [
|
|||
"num-traits",
|
||||
"rkyv",
|
||||
"utralib",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-log",
|
||||
"xous-api-names",
|
||||
"xous-api-susres",
|
||||
|
|
@ -6080,7 +6172,11 @@ dependencies = [
|
|||
"num-derive",
|
||||
"num-traits",
|
||||
"rkyv",
|
||||
<<<<<<< HEAD
|
||||
"xous",
|
||||
=======
|
||||
"xous 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
>>>>>>> f10c6b341c4c76f49d3acfb04d88cbe434c449dc
|
||||
"xous-api-names",
|
||||
"xous-ipc 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -12,21 +12,32 @@ pub fn lfsr_next(state: u32) -> u32 {
|
|||
(state << 1) + bit
|
||||
}
|
||||
|
||||
pub fn basic_tests (pl230: &mut Pl230) {
|
||||
pub fn basic_tests (pl230: &mut Pl230) -> bool {
|
||||
report_api("channels", pl230.csr.rf(utra::pl230::STATUS_CHNLS_MINUS1) + 1);
|
||||
//report_api("id0", pl230.csr.r(utra::pl230::PERIPH_ID_0));
|
||||
//report_api("id1", pl230.csr.r(utra::pl230::PERIPH_ID_1));
|
||||
//report_api("id2", pl230.csr.r(utra::pl230::PERIPH_ID_2));
|
||||
let mut cc_struct = ControlChannels::default();
|
||||
|
||||
// conjure the DMA control structure in IFRAM0. In order to guarantee Rust
|
||||
// semantics, it must be initialized to 0: 4 word-sized entries * 8 channels * 2 banks = 4 * 8 * 2
|
||||
let init_ptr = utralib::HW_IFRAM0_MEM as *mut u32;
|
||||
for i in 0..(4*8*2) {
|
||||
unsafe {init_ptr.add(i).write_volatile(0)};
|
||||
}
|
||||
// safety: we guarantee that the pointer is aligned and initialized
|
||||
let cc_struct: &mut ControlChannels = unsafe {
|
||||
(utralib::HW_IFRAM0_MEM as *mut ControlChannels).as_mut().unwrap()
|
||||
};
|
||||
|
||||
// read the status register
|
||||
report_api("status", pl230.csr.r(utra::pl230::STATUS));
|
||||
// report_api("status", pl230.csr.r(utra::pl230::STATUS));
|
||||
pl230.csr.wfo(utra::pl230::CFG_MASTER_ENABLE, 1); // enable
|
||||
report_api("status after enable", pl230.csr.r(utra::pl230::STATUS));
|
||||
// report_api("status after enable", pl230.csr.r(utra::pl230::STATUS));
|
||||
|
||||
const DMA_LEN: usize = 16;
|
||||
// setup the PL230 to do a simple transfer between two memory regions
|
||||
let mut region_a = [0u32; 16];
|
||||
let region_b = [0u32; 16];
|
||||
let mut region_a = [0u32; DMA_LEN];
|
||||
let region_b = [0u32; DMA_LEN];
|
||||
let mut state = 0x1111_1111;
|
||||
for d in region_a.iter_mut() {
|
||||
*d = state;
|
||||
|
|
@ -40,7 +51,7 @@ pub fn basic_tests (pl230: &mut Pl230) {
|
|||
cc.set_src_inc(DmaWidth::Word as u32);
|
||||
cc.set_dst_size(DmaWidth::Word as u32);
|
||||
cc.set_dst_inc(DmaWidth::Word as u32);
|
||||
cc.set_r_power(ArbitrateAfter::Xfer8 as u32);
|
||||
cc.set_r_power(ArbitrateAfter::Xfer1024 as u32);
|
||||
cc.set_n_minus_1(region_a.len() as u32 - 1);
|
||||
cc.set_cycle_ctrl(DmaCycleControl::AutoRequest as u32);
|
||||
cc_struct.channels[0].control = cc.0;
|
||||
|
|
@ -49,22 +60,44 @@ pub fn basic_tests (pl230: &mut Pl230) {
|
|||
pl230.csr.wo(utra::pl230::CHNLREQMASKSET, 1);
|
||||
pl230.csr.wo(utra::pl230::CHNLENABLESET, 1);
|
||||
|
||||
// report_api("dma_len", DMA_LEN as u32);
|
||||
report_api("baseptr", cc_struct.channels.as_ptr() as u32);
|
||||
report_api("baseptr[0]", unsafe{cc_struct.channels.as_ptr().read()}.src_end_ptr);
|
||||
report_api("baseptr[1]", unsafe{cc_struct.channels.as_ptr().read()}.dst_end_ptr);
|
||||
report_api("baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
|
||||
report_api("baseptr[3]", unsafe{cc_struct.channels.as_ptr().read()}.reserved);
|
||||
report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));
|
||||
report_api("src start", region_a.as_ptr() as u32);
|
||||
// report_api("baseptr[0]", unsafe{cc_struct.channels.as_ptr().read()}.src_end_ptr);
|
||||
report_api("dst start", region_b.as_ptr() as u32);
|
||||
// report_api("baseptr[1]", unsafe{cc_struct.channels.as_ptr().read()}.dst_end_ptr);
|
||||
// report_api("baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
|
||||
// report_api("baseptr[3]", unsafe{cc_struct.channels.as_ptr().read()}.reserved);
|
||||
// report_api("baseptr reg", pl230.csr.r(utra::pl230::CTRLBASEPTR));
|
||||
|
||||
// this should kick off the DMA
|
||||
pl230.csr.wo(utra::pl230::CHNLSWREQUEST, 1);
|
||||
|
||||
let mut timeout = 0;
|
||||
while (DmaChanControl(cc_struct.channels[0].control).cycle_ctrl() != 0) && timeout < 16 {
|
||||
report_api("dma progress ", cc_struct.channels[0].control);
|
||||
// report_api("dma progress ", cc_struct.channels[0].control);
|
||||
report_api("progress as baseptr[2]", unsafe{cc_struct.channels.as_ptr().read()}.control);
|
||||
timeout += 1;
|
||||
}
|
||||
for d in region_b {
|
||||
report_api("b: ", d);
|
||||
|
||||
unsafe {core::arch::asm!(
|
||||
".word 0x500F",
|
||||
"nop",
|
||||
"nop",
|
||||
"nop",
|
||||
"nop",
|
||||
"nop",
|
||||
); }
|
||||
|
||||
let mut passing = true;
|
||||
for (i, (src, dst)) in region_a.iter().zip(region_b.iter()).enumerate() {
|
||||
if *src != *dst {
|
||||
report_api("error in iter ", i as u32);
|
||||
report_api("src: ", *src);
|
||||
report_api("dst: ", *dst);
|
||||
passing = false;
|
||||
}
|
||||
}
|
||||
report_api("basic dma result (1=pass)", if passing { 1 } else { 0 });
|
||||
passing
|
||||
}
|
||||
Binary file not shown.
|
|
@ -33,7 +33,7 @@ precursor = ["utralib/precursor"]
|
|||
hosted = ["utralib/hosted"]
|
||||
renode = ["utralib/renode"]
|
||||
extra_flush = []
|
||||
default = ["extra_flush"]
|
||||
default = []
|
||||
|
||||
[lib]
|
||||
test = true
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd" >
|
||||
<vendor>litex</vendor>
|
||||
<name>SOC</name>
|
||||
<description><![CDATA[Litex SoC 2023-07-18 02:49:50]]></description>
|
||||
<description><![CDATA[Litex SoC 2023-07-29 00:11:05]]></description>
|
||||
|
||||
<addressUnitBits>8</addressUnitBits>
|
||||
<width>32</width>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -3,7 +3,7 @@
|
|||
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="CMSIS-SVD.xsd" >
|
||||
<vendor>litex</vendor>
|
||||
<name>SOC</name>
|
||||
<description><![CDATA[Litex SoC 2023-07-18 02:49:52]]></description>
|
||||
<description><![CDATA[Litex SoC 2023-07-29 00:11:06]]></description>
|
||||
|
||||
<addressUnitBits>8</addressUnitBits>
|
||||
<width>32</width>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue