Refactor project to be more modular
This commit is contained in:
20
pim-isa/Cargo.lock
generated
20
pim-isa/Cargo.lock
generated
@@ -11,36 +11,36 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.70"
|
version = "1.0.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
|
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.33"
|
version = "1.0.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -49,9 +49,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.39"
|
version = "2.0.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|||||||
24
pim-os/Cargo.lock
generated
24
pim-os/Cargo.lock
generated
@@ -200,18 +200,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.72"
|
version = "1.0.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a293318316cf6478ec1ad2a21c49390a8d5b5eae9fab736467d93fbc0edc29c5"
|
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.33"
|
version = "1.0.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -239,15 +239,15 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.20"
|
version = "1.0.21"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
@@ -265,9 +265,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -303,9 +303,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.43"
|
version = "2.0.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53"
|
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|||||||
18
pim-os/src/alloc.rs
Normal file
18
pim-os/src/alloc.rs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use core::mem::MaybeUninit;
|
||||||
|
use embedded_alloc::Heap;
|
||||||
|
|
||||||
|
#[global_allocator]
|
||||||
|
static PIM_ALLOC: Heap = Heap::empty();
|
||||||
|
|
||||||
|
const PIM_ARENA_SIZE: usize = 0x2000000;
|
||||||
|
|
||||||
|
#[link_section = ".pim_data"]
|
||||||
|
static mut PIM_ARENA: [MaybeUninit<u8>; PIM_ARENA_SIZE] = [MaybeUninit::uninit(); PIM_ARENA_SIZE];
|
||||||
|
|
||||||
|
pub fn init() {
|
||||||
|
unsafe {
|
||||||
|
PIM_ALLOC.init(PIM_ARENA.as_ptr() as usize, PIM_ARENA_SIZE);
|
||||||
|
}
|
||||||
|
}
|
||||||
78
pim-os/src/bin/matrix_matrix_add.rs
Normal file
78
pim-os/src/bin/matrix_matrix_add.rs
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use aarch64_cpu::asm::barrier;
|
||||||
|
use alloc::{boxed::Box, rc::Rc};
|
||||||
|
use core::{cell::RefCell, fmt::Write};
|
||||||
|
use half::f16;
|
||||||
|
use nalgebra::Matrix;
|
||||||
|
use pim_isa::BankMode;
|
||||||
|
use pim_os::{
|
||||||
|
pim::{
|
||||||
|
self,
|
||||||
|
array::{DummyArray, PimMatrixArena, PimStorage, NUMBER_OF_BANKS},
|
||||||
|
kernel::matrix_matrix_add,
|
||||||
|
vector::{F16x1, F16x16},
|
||||||
|
},
|
||||||
|
uart::Uart0,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn main() {
|
||||||
|
pim::state::set_kernel(&matrix_matrix_add::KERNEL);
|
||||||
|
|
||||||
|
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena1 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena2 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
|
||||||
|
let mut matrix0 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena0,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let mut matrix1 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena1,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix1.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let matrix2 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena2,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix0} + {matrix1}\n=").unwrap();
|
||||||
|
|
||||||
|
let dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
||||||
|
|
||||||
|
// Verify everything is correctly initialized before PIM operation
|
||||||
|
barrier::dsb(barrier::SY);
|
||||||
|
|
||||||
|
{
|
||||||
|
let pim_matrix_arena0 = &pim_matrix_arena0.borrow();
|
||||||
|
let pim_matrix_arena1 = &pim_matrix_arena1.borrow();
|
||||||
|
let pim_matrix_arena2 = &mut pim_matrix_arena2.borrow_mut();
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::PimAllBank);
|
||||||
|
|
||||||
|
matrix_matrix_add::execute(
|
||||||
|
pim_matrix_arena0,
|
||||||
|
pim_matrix_arena1,
|
||||||
|
pim_matrix_arena2,
|
||||||
|
dummy_array.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::SingleBank);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix2}").unwrap();
|
||||||
|
}
|
||||||
79
pim-os/src/bin/matrix_matrix_multiply.rs
Normal file
79
pim-os/src/bin/matrix_matrix_multiply.rs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use aarch64_cpu::asm::barrier;
|
||||||
|
use alloc::{boxed::Box, rc::Rc};
|
||||||
|
use pim_isa::BankMode;
|
||||||
|
use core::{cell::RefCell, fmt::Write};
|
||||||
|
use half::f16;
|
||||||
|
use nalgebra::Matrix;
|
||||||
|
use pim_os::{
|
||||||
|
pim::{
|
||||||
|
self,
|
||||||
|
array::{DummyArray, PimMatrixArena, PimStorage, NUMBER_OF_BANKS},
|
||||||
|
kernel::matrix_matrix_mul,
|
||||||
|
vector::{F16x1, F16x16},
|
||||||
|
},
|
||||||
|
uart::Uart0,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn main() {
|
||||||
|
pim::state::set_kernel(&matrix_matrix_mul::KERNEL);
|
||||||
|
|
||||||
|
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena1 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena2 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
|
||||||
|
let mut matrix0 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena0,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let mut matrix1 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena1,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix1.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let matrix2 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena2,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix0} * {matrix1}\n=").unwrap();
|
||||||
|
|
||||||
|
let dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
||||||
|
|
||||||
|
// Verify everything is correctly initialized before PIM operation
|
||||||
|
barrier::dsb(barrier::SY);
|
||||||
|
|
||||||
|
// Execute kernel
|
||||||
|
{
|
||||||
|
let pim_matrix_arena0 = &pim_matrix_arena0.borrow();
|
||||||
|
let pim_matrix_arena1 = &pim_matrix_arena1.borrow();
|
||||||
|
let pim_matrix_arena2 = &mut pim_matrix_arena2.borrow_mut();
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::PimAllBank);
|
||||||
|
|
||||||
|
matrix_matrix_mul::execute(
|
||||||
|
pim_matrix_arena0,
|
||||||
|
pim_matrix_arena1,
|
||||||
|
pim_matrix_arena2,
|
||||||
|
dummy_array.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::SingleBank);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix2}").unwrap();
|
||||||
|
}
|
||||||
73
pim-os/src/bin/matrix_scalar_multiply.rs
Normal file
73
pim-os/src/bin/matrix_scalar_multiply.rs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use aarch64_cpu::asm::barrier;
|
||||||
|
use alloc::{boxed::Box, rc::Rc};
|
||||||
|
use core::{cell::RefCell, fmt::Write};
|
||||||
|
use half::f16;
|
||||||
|
use nalgebra::Matrix;
|
||||||
|
use pim_isa::BankMode;
|
||||||
|
use pim_os::{
|
||||||
|
pim::{
|
||||||
|
self,
|
||||||
|
array::{DummyArray, PimMatrixArena, PimScalarArena, PimStorage, NUMBER_OF_BANKS},
|
||||||
|
kernel::matrix_scalar_mul,
|
||||||
|
vector::{F16x1, F16x16},
|
||||||
|
},
|
||||||
|
uart::Uart0,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn main() {
|
||||||
|
pim::state::set_kernel(&matrix_scalar_mul::KERNEL);
|
||||||
|
|
||||||
|
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena1 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
|
||||||
|
let mut matrix0 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena0,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let matrix1 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena1,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
let pim_scalar_arena = Box::new(PimScalarArena(
|
||||||
|
[F16x16([F16x1(f16::from_f32(2.0)); 16]); 32],
|
||||||
|
));
|
||||||
|
|
||||||
|
writeln!(Uart0, "{} * {matrix0}\n=", pim_scalar_arena.0[0].0[0]).unwrap();
|
||||||
|
|
||||||
|
let dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
||||||
|
|
||||||
|
// Verify everything is correctly initialized before PIM operation
|
||||||
|
barrier::dsb(barrier::SY);
|
||||||
|
|
||||||
|
// Execute kernel
|
||||||
|
{
|
||||||
|
let pim_matrix_arena0 = &pim_matrix_arena0.borrow();
|
||||||
|
let pim_matrix_arena1 = &mut pim_matrix_arena1.borrow_mut();
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::PimAllBank);
|
||||||
|
|
||||||
|
matrix_scalar_mul::execute(
|
||||||
|
pim_scalar_arena.as_ref(),
|
||||||
|
pim_matrix_arena0,
|
||||||
|
pim_matrix_arena1,
|
||||||
|
dummy_array.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::SingleBank);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix1}").unwrap();
|
||||||
|
}
|
||||||
79
pim-os/src/bin/matrix_vector_multiply.rs
Normal file
79
pim-os/src/bin/matrix_vector_multiply.rs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
#![no_std]
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
|
extern crate alloc;
|
||||||
|
|
||||||
|
use aarch64_cpu::asm::barrier;
|
||||||
|
use alloc::{boxed::Box, rc::Rc};
|
||||||
|
use core::{cell::RefCell, fmt::Write};
|
||||||
|
use half::f16;
|
||||||
|
use nalgebra::Matrix;
|
||||||
|
use pim_isa::BankMode;
|
||||||
|
use pim_os::{
|
||||||
|
pim::{
|
||||||
|
self,
|
||||||
|
array::{DummyArray, PimMatrixArena, PimStorage, NUMBER_OF_BANKS},
|
||||||
|
kernel::matrix_vector_mul,
|
||||||
|
vector::{F16x1, F16x16},
|
||||||
|
},
|
||||||
|
uart::Uart0,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn main() {
|
||||||
|
pim::state::set_kernel(&matrix_vector_mul::KERNEL);
|
||||||
|
|
||||||
|
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena1 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 1],
|
||||||
|
)));
|
||||||
|
let pim_matrix_arena2 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 1],
|
||||||
|
)));
|
||||||
|
|
||||||
|
let mut matrix0 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena0,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let mut matrix1 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena1,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
matrix1.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
|
let matrix2 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena2,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix0} * {matrix1}\n=").unwrap();
|
||||||
|
|
||||||
|
let dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
||||||
|
|
||||||
|
// Verify everything is correctly initialized before PIM operation
|
||||||
|
barrier::dsb(barrier::SY);
|
||||||
|
|
||||||
|
// Execute kernel
|
||||||
|
{
|
||||||
|
let pim_matrix_arena0 = &pim_matrix_arena0.borrow();
|
||||||
|
let pim_matrix_arena1 = &pim_matrix_arena1.borrow();
|
||||||
|
let pim_matrix_arena2 = &mut pim_matrix_arena2.borrow_mut();
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::PimAllBank);
|
||||||
|
|
||||||
|
matrix_vector_mul::execute(
|
||||||
|
pim_matrix_arena0,
|
||||||
|
pim_matrix_arena1,
|
||||||
|
pim_matrix_arena2,
|
||||||
|
dummy_array.as_ref(),
|
||||||
|
);
|
||||||
|
|
||||||
|
pim::state::set_bank_mode(BankMode::SingleBank);
|
||||||
|
}
|
||||||
|
|
||||||
|
writeln!(Uart0, "{matrix2}").unwrap();
|
||||||
|
}
|
||||||
28
pim-os/src/lib.rs
Normal file
28
pim-os/src/lib.rs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#![feature(generic_const_exprs)]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
use core::sync::atomic::{compiler_fence, Ordering};
|
||||||
|
|
||||||
|
mod alloc;
|
||||||
|
pub mod boot;
|
||||||
|
pub mod critical_section;
|
||||||
|
pub mod m5ops;
|
||||||
|
mod panic;
|
||||||
|
pub mod pim;
|
||||||
|
pub mod uart;
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
fn main();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn entry() -> ! {
|
||||||
|
alloc::init();
|
||||||
|
|
||||||
|
unsafe { main() }
|
||||||
|
|
||||||
|
m5ops::exit();
|
||||||
|
loop {
|
||||||
|
compiler_fence(Ordering::SeqCst);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
#![feature(generic_const_exprs)]
|
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
|
|
||||||
@@ -6,51 +5,23 @@ extern crate alloc;
|
|||||||
|
|
||||||
use aarch64_cpu::asm::barrier;
|
use aarch64_cpu::asm::barrier;
|
||||||
use alloc::{boxed::Box, rc::Rc};
|
use alloc::{boxed::Box, rc::Rc};
|
||||||
use core::{
|
use core::{cell::RefCell, fmt::Write};
|
||||||
cell::RefCell,
|
|
||||||
fmt::Write,
|
|
||||||
mem::MaybeUninit,
|
|
||||||
panic::PanicInfo,
|
|
||||||
sync::atomic::{compiler_fence, Ordering},
|
|
||||||
};
|
|
||||||
use embedded_alloc::Heap;
|
|
||||||
use half::f16;
|
use half::f16;
|
||||||
use nalgebra::Matrix;
|
use nalgebra::Matrix;
|
||||||
use pim::{
|
use pim_isa::BankMode;
|
||||||
array::{DummyArray, PimMatrixArena, PimScalarArena, PimStorage, NUMBER_OF_BANKS},
|
use pim_os::{
|
||||||
kernel::{
|
pim::{
|
||||||
execute_matrix_add, execute_matrix_multiply, execute_matrix_scalar_multiply,
|
self,
|
||||||
execute_matrix_vector_multiply, MATRIX_ADD, MATRIX_MUL, MATRIX_SCALAR_MUL,
|
array::{DummyArray, PimMatrixArena, PimStorage, NUMBER_OF_BANKS},
|
||||||
MATRIX_VECTOR_MUL,
|
kernel::matrix_matrix_mul,
|
||||||
|
vector::{F16x1, F16x16},
|
||||||
},
|
},
|
||||||
state::PimState,
|
uart::Uart0,
|
||||||
vector::{F16x1, F16x16},
|
|
||||||
};
|
};
|
||||||
use uart::Uart0;
|
|
||||||
|
|
||||||
mod boot;
|
|
||||||
mod critical_section;
|
|
||||||
mod m5ops;
|
|
||||||
mod pim;
|
|
||||||
mod uart;
|
|
||||||
|
|
||||||
#[global_allocator]
|
|
||||||
static PIM_ALLOC: Heap = Heap::empty();
|
|
||||||
|
|
||||||
const PIM_ARENA_SIZE: usize = 0x2000000;
|
|
||||||
|
|
||||||
#[link_section = ".pim_data"]
|
|
||||||
static mut PIM_ARENA: [MaybeUninit<u8>; PIM_ARENA_SIZE] = [MaybeUninit::uninit(); PIM_ARENA_SIZE];
|
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn entry() -> ! {
|
pub extern "C" fn main() {
|
||||||
unsafe {
|
pim::state::set_kernel(&matrix_matrix_mul::KERNEL);
|
||||||
PIM_ALLOC.init(PIM_ARENA.as_ptr() as usize, PIM_ARENA_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut uart = Uart0;
|
|
||||||
let mut pim_state = PimState::new(&MATRIX_SCALAR_MUL);
|
|
||||||
pim_state.set_kernel();
|
|
||||||
|
|
||||||
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
let pim_matrix_arena0 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
@@ -61,89 +32,48 @@ pub extern "C" fn entry() -> ! {
|
|||||||
let pim_matrix_arena2 = Rc::new(RefCell::new(PimMatrixArena(
|
let pim_matrix_arena2 = Rc::new(RefCell::new(PimMatrixArena(
|
||||||
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
[[[F16x16::default(); NUMBER_OF_BANKS]; 8]; 8],
|
||||||
)));
|
)));
|
||||||
let pim_storage0 = PimStorage {
|
|
||||||
|
let mut matrix0 = Matrix::from_data(PimStorage {
|
||||||
arena: &pim_matrix_arena0,
|
arena: &pim_matrix_arena0,
|
||||||
index: 0,
|
index: 0,
|
||||||
};
|
});
|
||||||
let pim_storage1 = PimStorage {
|
|
||||||
arena: &pim_matrix_arena1,
|
|
||||||
index: 0,
|
|
||||||
};
|
|
||||||
let pim_storage2 = PimStorage {
|
|
||||||
arena: &pim_matrix_arena2,
|
|
||||||
index: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
writeln!(
|
|
||||||
&mut uart,
|
|
||||||
"arena0: {:?}\narena1: {:?}\narena2: {:?}",
|
|
||||||
core::ptr::addr_of!(*pim_matrix_arena0.borrow()),
|
|
||||||
core::ptr::addr_of!(*pim_matrix_arena1.borrow()),
|
|
||||||
core::ptr::addr_of!(*pim_matrix_arena2.borrow()),
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let mut matrix0 = Matrix::from_data(pim_storage0);
|
|
||||||
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
matrix0.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
let mut matrix1 = Matrix::from_data(pim_storage1);
|
let mut matrix1 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena1,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
matrix1.fill_lower_triangle(F16x1(f16::ONE), 0);
|
matrix1.fill_lower_triangle(F16x1(f16::ONE), 0);
|
||||||
|
|
||||||
let matrix2 = Matrix::from_data(pim_storage2);
|
let matrix2 = Matrix::from_data(PimStorage {
|
||||||
|
arena: &pim_matrix_arena2,
|
||||||
|
index: 0,
|
||||||
|
});
|
||||||
|
|
||||||
writeln!(&mut uart, "{matrix0} * {matrix1}\n=").unwrap();
|
writeln!(Uart0, "{matrix0} * {matrix1}\n=").unwrap();
|
||||||
|
|
||||||
let mut dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
let dummy_array = Box::new(DummyArray([F16x16::default(); NUMBER_OF_BANKS]));
|
||||||
|
|
||||||
|
// Verify everything is correctly initialized before PIM operation
|
||||||
barrier::dsb(barrier::SY);
|
barrier::dsb(barrier::SY);
|
||||||
|
|
||||||
// execute_matrix_add(
|
// Execute kernel
|
||||||
// &mut pim_state,
|
{
|
||||||
// &mut pim_matrix_arena0.borrow_mut(),
|
let pim_matrix_arena0 = &pim_matrix_arena0.borrow();
|
||||||
// &mut pim_matrix_arena1.borrow_mut(),
|
let pim_matrix_arena1 = &pim_matrix_arena1.borrow();
|
||||||
// &mut pim_matrix_arena2.borrow_mut(),
|
let pim_matrix_arena2 = &mut pim_matrix_arena2.borrow_mut();
|
||||||
// dummy_array.as_mut(),
|
|
||||||
// );
|
|
||||||
// execute_matrix_multiply_rowwise(
|
|
||||||
// &mut pim_state,
|
|
||||||
// &mut pim_matrix_arena0.borrow_mut(),
|
|
||||||
// &mut pim_matrix_arena1.borrow_mut(),
|
|
||||||
// &mut pim_matrix_arena2.borrow_mut(),
|
|
||||||
// dummy_array.as_mut(),
|
|
||||||
// );
|
|
||||||
// execute_matrix_vector_multiply(
|
|
||||||
// &mut pim_state,
|
|
||||||
// &mut pim_matrix_arena0.borrow_mut(),
|
|
||||||
// &mut pim_matrix_arena1.borrow_mut(),
|
|
||||||
// &mut pim_matrix_arena2.borrow_mut(),
|
|
||||||
// dummy_array.as_mut(),
|
|
||||||
// );
|
|
||||||
|
|
||||||
// let pim_scalar_arena = Box::new(PimScalarArena(
|
pim::state::set_bank_mode(BankMode::PimAllBank);
|
||||||
// [F16x16([F16x1(f16::from_f32(2.0)); 16]); 32],
|
|
||||||
// ));
|
|
||||||
|
|
||||||
// execute_matrix_scalar_multiply(
|
matrix_matrix_mul::execute(
|
||||||
// &mut pim_state,
|
pim_matrix_arena0,
|
||||||
// &pim_scalar_arena,
|
pim_matrix_arena1,
|
||||||
// &pim_matrix_arena0.borrow_mut(),
|
pim_matrix_arena2,
|
||||||
// &mut pim_matrix_arena1.borrow_mut(),
|
dummy_array.as_ref(),
|
||||||
// dummy_array.as_mut(),
|
);
|
||||||
// );
|
|
||||||
|
|
||||||
writeln!(&mut uart, "{matrix2}").unwrap();
|
pim::state::set_bank_mode(BankMode::SingleBank);
|
||||||
|
|
||||||
m5ops::exit();
|
|
||||||
|
|
||||||
loop {
|
|
||||||
compiler_fence(Ordering::SeqCst);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
#[panic_handler]
|
writeln!(Uart0, "{matrix2}").unwrap();
|
||||||
fn panic(info: &PanicInfo) -> ! {
|
|
||||||
writeln!(Uart0, "{info}").unwrap();
|
|
||||||
|
|
||||||
loop {
|
|
||||||
compiler_fence(Ordering::SeqCst);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
15
pim-os/src/panic.rs
Normal file
15
pim-os/src/panic.rs
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
use crate::uart::Uart0;
|
||||||
|
use core::{
|
||||||
|
fmt::Write,
|
||||||
|
panic::PanicInfo,
|
||||||
|
sync::atomic::{compiler_fence, Ordering},
|
||||||
|
};
|
||||||
|
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic(info: &PanicInfo) -> ! {
|
||||||
|
writeln!(Uart0, "{info}").unwrap();
|
||||||
|
|
||||||
|
loop {
|
||||||
|
compiler_fence(Ordering::SeqCst);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,34 +4,29 @@ use core::{arch::asm, ptr::write_volatile};
|
|||||||
#[link_section = ".pim_config"]
|
#[link_section = ".pim_config"]
|
||||||
static mut PIM_CONFIG_REGION: [u8; 0x4000] = [0; 0x4000];
|
static mut PIM_CONFIG_REGION: [u8; 0x4000] = [0; 0x4000];
|
||||||
|
|
||||||
#[derive(Debug)]
|
pub fn write(s: &str) {
|
||||||
pub struct PimWriter;
|
unsafe {
|
||||||
|
let mut index = 0;
|
||||||
|
for &byte in s.as_bytes() {
|
||||||
|
write_volatile((&mut PIM_CONFIG_REGION as *mut u8).offset(index), byte as _);
|
||||||
|
barrier::dsb(barrier::SY);
|
||||||
|
index += 1;
|
||||||
|
}
|
||||||
|
write_volatile((&mut PIM_CONFIG_REGION as *mut u8).offset(index), b'\0');
|
||||||
|
|
||||||
impl PimWriter {
|
// PIM_CONFIG_REGION[..s.len()].copy_from_slice(s.as_bytes());
|
||||||
pub fn write(&mut self, s: &str) {
|
// PIM_CONFIG_REGION[s.len()] = b'\0';
|
||||||
unsafe {
|
|
||||||
let mut index = 0;
|
if cfg!(feature = "cacheless") {
|
||||||
for &byte in s.as_bytes() {
|
// Be pessimistic so that config region is not optimized away
|
||||||
write_volatile((&mut PIM_CONFIG_REGION as *mut u8).offset(index), byte as _);
|
core::hint::black_box(PIM_CONFIG_REGION);
|
||||||
barrier::dsb(barrier::SY);
|
} else {
|
||||||
index += 1;
|
// Flush all cache lines that were affected by write operation
|
||||||
|
for element in PIM_CONFIG_REGION[..s.len()].iter() {
|
||||||
|
asm!("dc civac, {val}", val = in(reg) element);
|
||||||
}
|
}
|
||||||
write_volatile((&mut PIM_CONFIG_REGION as *mut u8).offset(index), b'\0');
|
|
||||||
|
|
||||||
// PIM_CONFIG_REGION[..s.len()].copy_from_slice(s.as_bytes());
|
barrier::dsb(barrier::SY);
|
||||||
// PIM_CONFIG_REGION[s.len()] = b'\0';
|
|
||||||
|
|
||||||
if cfg!(feature = "cacheless") {
|
|
||||||
// Be pessimistic so that config region is not optimized away
|
|
||||||
core::hint::black_box(PIM_CONFIG_REGION);
|
|
||||||
} else {
|
|
||||||
// Flush all cache lines that were affected by write operation
|
|
||||||
for element in PIM_CONFIG_REGION[..s.len()].iter() {
|
|
||||||
asm!("dc civac, {val}", val = in(reg) element);
|
|
||||||
}
|
|
||||||
|
|
||||||
barrier::dsb(barrier::SY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,533 +1,4 @@
|
|||||||
use super::{
|
pub mod matrix_matrix_add;
|
||||||
array::{DummyArray, PimMatrixArena, PimRegion, PimScalarArena},
|
pub mod matrix_matrix_mul;
|
||||||
state::PimState,
|
pub mod matrix_scalar_mul;
|
||||||
};
|
pub mod matrix_vector_mul;
|
||||||
use pim_isa::{BankMode, File, Instruction, Kernel};
|
|
||||||
|
|
||||||
pub const MATRIX_ADD: Kernel = Kernel([
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 0 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 1 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 2 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 3 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 4 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 5 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 6 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 7 },
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 0 },
|
|
||||||
dst: File::GrfA { index: 0 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 1 },
|
|
||||||
dst: File::GrfA { index: 1 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 2 },
|
|
||||||
dst: File::GrfA { index: 2 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 3 },
|
|
||||||
dst: File::GrfA { index: 3 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 4 },
|
|
||||||
dst: File::GrfA { index: 4 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 5 },
|
|
||||||
dst: File::GrfA { index: 5 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 6 },
|
|
||||||
dst: File::GrfA { index: 6 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::ADD {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 7 },
|
|
||||||
dst: File::GrfA { index: 7 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 0 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 1 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 2 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 3 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 4 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 5 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 6 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 7 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::EXIT,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
]);
|
|
||||||
|
|
||||||
pub fn execute_matrix_add<const R: usize, const C: usize>(
|
|
||||||
pim_state: &mut PimState,
|
|
||||||
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena1: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena2: &mut PimMatrixArena<R, C>,
|
|
||||||
dummy_array: &DummyArray,
|
|
||||||
) {
|
|
||||||
pim_state.set_bank_mode(BankMode::PimAllBank);
|
|
||||||
|
|
||||||
for column in 0..C {
|
|
||||||
for row in 0..R {
|
|
||||||
pim_matrix_arena0.execute_instruction_read_single_bank(column * R + row);
|
|
||||||
}
|
|
||||||
|
|
||||||
for row in 0..R {
|
|
||||||
pim_matrix_arena1.execute_instruction_read_single_bank(column * R + row);
|
|
||||||
}
|
|
||||||
|
|
||||||
for row in 0..R {
|
|
||||||
pim_matrix_arena2.execute_instruction_write_single_bank(column * R + row);
|
|
||||||
}
|
|
||||||
|
|
||||||
dummy_array.execute_instruction_read_single_bank(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pim_state.set_bank_mode(BankMode::SingleBank);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const MATRIX_MUL: Kernel = Kernel([
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 0 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 1 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 2 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 3 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 4 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 5 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 6 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 7 },
|
|
||||||
},
|
|
||||||
Instruction::MAC {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 0 },
|
|
||||||
src2: File::GrfB { index: 0 },
|
|
||||||
dst: File::GrfB { index: 0 },
|
|
||||||
aam: true,
|
|
||||||
},
|
|
||||||
Instruction::JUMP {
|
|
||||||
offset: -1,
|
|
||||||
count: 63,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 0 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 1 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 2 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 3 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 4 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 5 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 6 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 7 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::EXIT,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
]);
|
|
||||||
|
|
||||||
// Vlt in der Thesis kurz erwähnen und dann zu AAM überleiten
|
|
||||||
// pub fn execute_matrix_multiply_elementwise<const R: usize, const C: usize>(
|
|
||||||
// pim_state: &mut PimState,
|
|
||||||
// pim_matrix_arena0: &mut PimMatrixArena<R, C>,
|
|
||||||
// pim_matrix_arena1: &mut PimMatrixArena<R, C>,
|
|
||||||
// pim_matrix_arena2: &mut PimMatrixArena<R, C>,
|
|
||||||
// dummy_array: &mut DummyArray,
|
|
||||||
// ) {
|
|
||||||
// pim_state.set_bank_mode(BankMode::PimAllBank);
|
|
||||||
|
|
||||||
// for i in 0..(R * C) {
|
|
||||||
// let start_column = i % R;
|
|
||||||
// let start_row = (i / R) * R;
|
|
||||||
|
|
||||||
// for j in 0..C {
|
|
||||||
// pim_matrix_arena0.execute_instruction_read_single_bank(start_column + R * j);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// for j in 0..R {
|
|
||||||
// pim_matrix_arena1.execute_instruction_read_single_bank(start_row + j);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// pim_matrix_arena2.execute_instruction_write_single_bank(i);
|
|
||||||
|
|
||||||
// dummy_array.execute_instruction_read_single_bank(0);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// pim_state.set_bank_mode(BankMode::SingleBank);
|
|
||||||
// }
|
|
||||||
|
|
||||||
pub fn execute_matrix_multiply<const R: usize, const C: usize>(
|
|
||||||
pim_state: &mut PimState,
|
|
||||||
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena1: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena2: &mut PimMatrixArena<R, C>,
|
|
||||||
dummy_array: &DummyArray,
|
|
||||||
) {
|
|
||||||
pim_state.set_bank_mode(BankMode::PimAllBank);
|
|
||||||
|
|
||||||
for row in 0..R {
|
|
||||||
for i in 0..C {
|
|
||||||
pim_matrix_arena0.execute_instruction_read_single_bank(row + R * i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for column in 0..C {
|
|
||||||
for i in 0..R {
|
|
||||||
pim_matrix_arena1.execute_instruction_read_single_bank(column * R + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for column in 0..C {
|
|
||||||
pim_matrix_arena2.execute_instruction_write_single_bank(column * R + row);
|
|
||||||
}
|
|
||||||
|
|
||||||
dummy_array.execute_instruction_read_single_bank(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pim_state.set_bank_mode(BankMode::SingleBank);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const MATRIX_VECTOR_MUL: Kernel = Kernel([
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 0 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 1 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 2 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 3 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 4 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 5 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 6 },
|
|
||||||
},
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::GrfA { index: 7 },
|
|
||||||
},
|
|
||||||
Instruction::MAC {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::GrfA { index: 0 },
|
|
||||||
src2: File::GrfB { index: 0 },
|
|
||||||
dst: File::GrfB { index: 0 },
|
|
||||||
aam: true,
|
|
||||||
},
|
|
||||||
Instruction::JUMP {
|
|
||||||
offset: -1,
|
|
||||||
count: 7,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfB { index: 0 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::EXIT,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
]);
|
|
||||||
|
|
||||||
pub fn execute_matrix_vector_multiply<const R: usize, const C: usize>(
|
|
||||||
pim_state: &mut PimState,
|
|
||||||
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena1: &PimMatrixArena<C, 1>,
|
|
||||||
pim_matrix_arena2: &mut PimMatrixArena<C, 1>,
|
|
||||||
dummy_array: &DummyArray,
|
|
||||||
) {
|
|
||||||
pim_state.set_bank_mode(BankMode::PimAllBank);
|
|
||||||
|
|
||||||
for row in 0..R {
|
|
||||||
for i in 0..C {
|
|
||||||
pim_matrix_arena0.execute_instruction_read_single_bank(row + R * i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for i in 0..R {
|
|
||||||
pim_matrix_arena1.execute_instruction_read_single_bank(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
pim_matrix_arena2.execute_instruction_write_single_bank(row);
|
|
||||||
|
|
||||||
dummy_array.execute_instruction_read_single_bank(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pim_state.set_bank_mode(BankMode::SingleBank);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const MATRIX_SCALAR_MUL: Kernel = Kernel([
|
|
||||||
Instruction::MOV {
|
|
||||||
src: File::Bank,
|
|
||||||
dst: File::SrfM { index: 0 },
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 0 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 1 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 2 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 3 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 4 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 5 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 6 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::MUL {
|
|
||||||
src0: File::Bank,
|
|
||||||
src1: File::SrfM { index: 0 },
|
|
||||||
dst: File::GrfA { index: 7 },
|
|
||||||
aam: false,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 0 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 1 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 2 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 3 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 4 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 5 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 6 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::FILL {
|
|
||||||
src: File::GrfA { index: 7 },
|
|
||||||
dst: File::Bank,
|
|
||||||
},
|
|
||||||
Instruction::EXIT,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
Instruction::NOP,
|
|
||||||
]);
|
|
||||||
|
|
||||||
pub fn execute_matrix_scalar_multiply<const R: usize, const C: usize>(
|
|
||||||
pim_state: &mut PimState,
|
|
||||||
pim_scalar_arena: &PimScalarArena,
|
|
||||||
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
|
||||||
pim_matrix_arena1: &mut PimMatrixArena<R, C>,
|
|
||||||
dummy_array: &DummyArray,
|
|
||||||
) {
|
|
||||||
pim_state.set_bank_mode(BankMode::PimAllBank);
|
|
||||||
|
|
||||||
for column in 0..C {
|
|
||||||
pim_scalar_arena.execute_instruction_read_single_bank(0);
|
|
||||||
|
|
||||||
for i in 0..R {
|
|
||||||
pim_matrix_arena0.execute_instruction_read_single_bank(column * R + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
for i in 0..R {
|
|
||||||
pim_matrix_arena1.execute_instruction_write_single_bank(column * R + i);
|
|
||||||
}
|
|
||||||
|
|
||||||
dummy_array.execute_instruction_read_single_bank(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
pim_state.set_bank_mode(BankMode::SingleBank);
|
|
||||||
}
|
|
||||||
|
|||||||
148
pim-os/src/pim/kernel/matrix_matrix_add.rs
Normal file
148
pim-os/src/pim/kernel/matrix_matrix_add.rs
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
use crate::pim::array::{DummyArray, PimMatrixArena, PimRegion};
|
||||||
|
use pim_isa::{File, Instruction, Kernel};
|
||||||
|
|
||||||
|
pub const KERNEL: Kernel = Kernel([
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 0 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 1 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 2 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 3 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 4 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 5 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 6 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 7 },
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 0 },
|
||||||
|
dst: File::GrfA { index: 0 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 1 },
|
||||||
|
dst: File::GrfA { index: 1 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 2 },
|
||||||
|
dst: File::GrfA { index: 2 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 3 },
|
||||||
|
dst: File::GrfA { index: 3 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 4 },
|
||||||
|
dst: File::GrfA { index: 4 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 5 },
|
||||||
|
dst: File::GrfA { index: 5 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 6 },
|
||||||
|
dst: File::GrfA { index: 6 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::ADD {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 7 },
|
||||||
|
dst: File::GrfA { index: 7 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 0 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 1 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 2 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 3 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 4 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 5 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 6 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 7 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::EXIT,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
]);
|
||||||
|
|
||||||
|
pub fn execute<const R: usize, const C: usize>(
|
||||||
|
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
||||||
|
pim_matrix_arena1: &PimMatrixArena<R, C>,
|
||||||
|
pim_matrix_arena2: &mut PimMatrixArena<R, C>,
|
||||||
|
dummy_array: &DummyArray,
|
||||||
|
) {
|
||||||
|
for column in 0..C {
|
||||||
|
for row in 0..R {
|
||||||
|
pim_matrix_arena0.execute_instruction_read_single_bank(column * R + row);
|
||||||
|
}
|
||||||
|
|
||||||
|
for row in 0..R {
|
||||||
|
pim_matrix_arena1.execute_instruction_read_single_bank(column * R + row);
|
||||||
|
}
|
||||||
|
|
||||||
|
for row in 0..R {
|
||||||
|
pim_matrix_arena2.execute_instruction_write_single_bank(column * R + row);
|
||||||
|
}
|
||||||
|
|
||||||
|
dummy_array.execute_instruction_read_single_bank(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
153
pim-os/src/pim/kernel/matrix_matrix_mul.rs
Normal file
153
pim-os/src/pim/kernel/matrix_matrix_mul.rs
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
use crate::pim::array::{DummyArray, PimMatrixArena, PimRegion};
|
||||||
|
use pim_isa::{File, Instruction, Kernel};
|
||||||
|
|
||||||
|
pub const KERNEL: Kernel = Kernel([
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 0 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 1 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 2 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 3 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 4 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 5 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 6 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 7 },
|
||||||
|
},
|
||||||
|
Instruction::MAC {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 0 },
|
||||||
|
src2: File::GrfB { index: 0 },
|
||||||
|
dst: File::GrfB { index: 0 },
|
||||||
|
aam: true,
|
||||||
|
},
|
||||||
|
Instruction::JUMP {
|
||||||
|
offset: -1,
|
||||||
|
count: 63,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 0 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 1 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 2 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 3 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 4 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 5 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 6 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 7 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::EXIT,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Vlt in der Thesis kurz erwähnen und dann zu AAM überleiten
|
||||||
|
// pub fn execute_matrix_multiply_elementwise<const R: usize, const C: usize>(
|
||||||
|
// pim_state: &mut PimState,
|
||||||
|
// pim_matrix_arena0: &mut PimMatrixArena<R, C>,
|
||||||
|
// pim_matrix_arena1: &mut PimMatrixArena<R, C>,
|
||||||
|
// pim_matrix_arena2: &mut PimMatrixArena<R, C>,
|
||||||
|
// dummy_array: &mut DummyArray,
|
||||||
|
// ) {
|
||||||
|
// set_bank_mode(BankMode::PimAllBank);
|
||||||
|
|
||||||
|
// for i in 0..(R * C) {
|
||||||
|
// let start_column = i % R;
|
||||||
|
// let start_row = (i / R) * R;
|
||||||
|
|
||||||
|
// for j in 0..C {
|
||||||
|
// pim_matrix_arena0.execute_instruction_read_single_bank(start_column + R * j);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// for j in 0..R {
|
||||||
|
// pim_matrix_arena1.execute_instruction_read_single_bank(start_row + j);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// pim_matrix_arena2.execute_instruction_write_single_bank(i);
|
||||||
|
|
||||||
|
// dummy_array.execute_instruction_read_single_bank(0);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// set_bank_mode(BankMode::SingleBank);
|
||||||
|
// }
|
||||||
|
|
||||||
|
const MATRIX_DIMENSION: usize = 8;
|
||||||
|
|
||||||
|
pub fn execute(
|
||||||
|
pim_matrix_arena0: &PimMatrixArena<MATRIX_DIMENSION, MATRIX_DIMENSION>,
|
||||||
|
pim_matrix_arena1: &PimMatrixArena<MATRIX_DIMENSION, MATRIX_DIMENSION>,
|
||||||
|
pim_matrix_arena2: &mut PimMatrixArena<MATRIX_DIMENSION, MATRIX_DIMENSION>,
|
||||||
|
dummy_array: &DummyArray,
|
||||||
|
) {
|
||||||
|
for row in 0..MATRIX_DIMENSION {
|
||||||
|
for i in 0..MATRIX_DIMENSION {
|
||||||
|
pim_matrix_arena0.execute_instruction_read_single_bank(row + MATRIX_DIMENSION * i);
|
||||||
|
}
|
||||||
|
|
||||||
|
for column in 0..MATRIX_DIMENSION {
|
||||||
|
for i in 0..MATRIX_DIMENSION {
|
||||||
|
pim_matrix_arena1
|
||||||
|
.execute_instruction_read_single_bank(column * MATRIX_DIMENSION + i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for column in 0..MATRIX_DIMENSION {
|
||||||
|
pim_matrix_arena2
|
||||||
|
.execute_instruction_write_single_bank(column * MATRIX_DIMENSION + row);
|
||||||
|
}
|
||||||
|
|
||||||
|
dummy_array.execute_instruction_read_single_bank(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
125
pim-os/src/pim/kernel/matrix_scalar_mul.rs
Normal file
125
pim-os/src/pim/kernel/matrix_scalar_mul.rs
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
use crate::pim::array::{DummyArray, PimMatrixArena, PimRegion, PimScalarArena};
|
||||||
|
use pim_isa::{File, Instruction, Kernel};
|
||||||
|
|
||||||
|
pub const KERNEL: Kernel = Kernel([
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::SrfM { index: 0 },
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 0 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 1 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 2 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 3 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 4 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 5 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 6 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::MUL {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::SrfM { index: 0 },
|
||||||
|
dst: File::GrfA { index: 7 },
|
||||||
|
aam: false,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 0 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 1 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 2 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 3 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 4 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 5 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 6 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfA { index: 7 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::EXIT,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
]);
|
||||||
|
|
||||||
|
pub fn execute<const R: usize, const C: usize>(
|
||||||
|
pim_scalar_arena: &PimScalarArena,
|
||||||
|
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
||||||
|
pim_matrix_arena1: &mut PimMatrixArena<R, C>,
|
||||||
|
dummy_array: &DummyArray,
|
||||||
|
) {
|
||||||
|
for column in 0..C {
|
||||||
|
pim_scalar_arena.execute_instruction_read_single_bank(0);
|
||||||
|
|
||||||
|
for i in 0..R {
|
||||||
|
pim_matrix_arena0.execute_instruction_read_single_bank(column * R + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in 0..R {
|
||||||
|
pim_matrix_arena1.execute_instruction_write_single_bank(column * R + i);
|
||||||
|
}
|
||||||
|
|
||||||
|
dummy_array.execute_instruction_read_single_bank(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
94
pim-os/src/pim/kernel/matrix_vector_mul.rs
Normal file
94
pim-os/src/pim/kernel/matrix_vector_mul.rs
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
use crate::pim::array::{DummyArray, PimMatrixArena, PimRegion};
|
||||||
|
use pim_isa::{File, Instruction, Kernel};
|
||||||
|
|
||||||
|
pub const KERNEL: Kernel = Kernel([
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 0 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 1 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 2 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 3 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 4 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 5 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 6 },
|
||||||
|
},
|
||||||
|
Instruction::MOV {
|
||||||
|
src: File::Bank,
|
||||||
|
dst: File::GrfA { index: 7 },
|
||||||
|
},
|
||||||
|
Instruction::MAC {
|
||||||
|
src0: File::Bank,
|
||||||
|
src1: File::GrfA { index: 0 },
|
||||||
|
src2: File::GrfB { index: 0 },
|
||||||
|
dst: File::GrfB { index: 0 },
|
||||||
|
aam: true,
|
||||||
|
},
|
||||||
|
Instruction::JUMP {
|
||||||
|
offset: -1,
|
||||||
|
count: 7,
|
||||||
|
},
|
||||||
|
Instruction::FILL {
|
||||||
|
src: File::GrfB { index: 0 },
|
||||||
|
dst: File::Bank,
|
||||||
|
},
|
||||||
|
Instruction::EXIT,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
Instruction::NOP,
|
||||||
|
]);
|
||||||
|
|
||||||
|
pub fn execute<const R: usize, const C: usize>(
|
||||||
|
pim_matrix_arena0: &PimMatrixArena<R, C>,
|
||||||
|
pim_matrix_arena1: &PimMatrixArena<C, 1>,
|
||||||
|
pim_matrix_arena2: &mut PimMatrixArena<C, 1>,
|
||||||
|
dummy_array: &DummyArray,
|
||||||
|
) {
|
||||||
|
for row in 0..R {
|
||||||
|
for i in 0..C {
|
||||||
|
pim_matrix_arena0.execute_instruction_read_single_bank(row + R * i);
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in 0..R {
|
||||||
|
pim_matrix_arena1.execute_instruction_read_single_bank(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
pim_matrix_arena2.execute_instruction_write_single_bank(row);
|
||||||
|
|
||||||
|
dummy_array.execute_instruction_read_single_bank(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,42 +1,25 @@
|
|||||||
|
use super::config;
|
||||||
|
|
||||||
use super::config::PimWriter;
|
|
||||||
use pim_isa::{BankMode, Kernel, PimConfig};
|
use pim_isa::{BankMode, Kernel, PimConfig};
|
||||||
|
|
||||||
#[derive(Debug)]
|
// TODO return token and return to singlebank when dropped
|
||||||
pub struct PimState {
|
pub fn set_bank_mode(bank_mode: BankMode) {
|
||||||
kernel: Kernel,
|
config::write(
|
||||||
writer: PimWriter,
|
serde_json_core::to_string::<PimConfig, 64>(&PimConfig {
|
||||||
|
kernel: None,
|
||||||
|
bank_mode: Some(bank_mode),
|
||||||
|
})
|
||||||
|
.unwrap()
|
||||||
|
.as_str(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PimState {
|
pub fn set_kernel(kernel: &Kernel) {
|
||||||
pub fn new(kernel: &Kernel) -> Self {
|
config::write(
|
||||||
Self {
|
serde_json_core::to_string::<PimConfig, 2048>(&PimConfig {
|
||||||
kernel: kernel.clone(),
|
kernel: Some(kernel.clone()),
|
||||||
writer: PimWriter,
|
bank_mode: None,
|
||||||
}
|
})
|
||||||
}
|
.unwrap()
|
||||||
|
.as_str(),
|
||||||
// TODO return token and return to singlebank when dropped
|
);
|
||||||
pub fn set_bank_mode(&mut self, bank_mode: BankMode) {
|
|
||||||
self.writer.write(
|
|
||||||
serde_json_core::to_string::<PimConfig, 64>(&PimConfig {
|
|
||||||
kernel: None,
|
|
||||||
bank_mode: Some(bank_mode),
|
|
||||||
})
|
|
||||||
.unwrap()
|
|
||||||
.as_str(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn set_kernel(&mut self) {
|
|
||||||
self.writer.write(
|
|
||||||
serde_json_core::to_string::<PimConfig, 2048>(&PimConfig {
|
|
||||||
kernel: Some(self.kernel.clone()),
|
|
||||||
bank_mode: None,
|
|
||||||
})
|
|
||||||
.unwrap()
|
|
||||||
.as_str(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,22 +63,9 @@ impl core::ops::MulAssign<F16x1> for F16x1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Default, Clone, Copy, PartialEq)]
|
#[derive(Default, Debug, Clone, Copy, PartialEq)]
|
||||||
pub struct F16x16(pub [F16x1; FLOATING_POINT_UNITS]);
|
pub struct F16x16(pub [F16x1; FLOATING_POINT_UNITS]);
|
||||||
|
|
||||||
// TODO remove
|
|
||||||
impl core::fmt::Debug for F16x16 {
|
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
|
||||||
self.0[0].fmt(f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl core::fmt::Display for F16x16 {
|
|
||||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
|
||||||
self.0[0].fmt(f)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl num_traits::identities::Zero for F16x16 {
|
impl num_traits::identities::Zero for F16x16 {
|
||||||
fn zero() -> Self {
|
fn zero() -> Self {
|
||||||
Self([F16x1::zero(); FLOATING_POINT_UNITS])
|
Self([F16x1::zero(); FLOATING_POINT_UNITS])
|
||||||
|
|||||||
148
pim-vm/Cargo.lock
generated
148
pim-vm/Cargo.lock
generated
@@ -40,9 +40,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxx"
|
name = "cxx"
|
||||||
version = "1.0.110"
|
version = "1.0.115"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8"
|
checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"cxxbridge-flags",
|
"cxxbridge-flags",
|
||||||
@@ -52,15 +52,15 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-flags"
|
name = "cxxbridge-flags"
|
||||||
version = "1.0.110"
|
version = "1.0.115"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44"
|
checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cxxbridge-macro"
|
name = "cxxbridge-macro"
|
||||||
version = "1.0.110"
|
version = "1.0.115"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f"
|
checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -87,7 +87,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
|
checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -114,26 +114,26 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "is-terminal"
|
name = "is-terminal"
|
||||||
version = "0.4.9"
|
version = "0.4.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"rustix",
|
"rustix",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itoa"
|
||||||
version = "1.0.9"
|
version = "1.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.150"
|
version = "0.2.152"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "link-cplusplus"
|
name = "link-cplusplus"
|
||||||
@@ -158,9 +158,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.6.4"
|
version = "2.7.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pim-isa"
|
name = "pim-isa"
|
||||||
@@ -183,18 +183,18 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.70"
|
version = "1.0.76"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b"
|
checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quote"
|
name = "quote"
|
||||||
version = "1.0.33"
|
version = "1.0.35"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
]
|
]
|
||||||
@@ -230,37 +230,37 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.38.26"
|
version = "0.38.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a"
|
checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"errno",
|
"errno",
|
||||||
"libc",
|
"libc",
|
||||||
"linux-raw-sys",
|
"linux-raw-sys",
|
||||||
"windows-sys 0.52.0",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.15"
|
version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89"
|
checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.193"
|
version = "1.0.195"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -269,9 +269,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_json"
|
name = "serde_json"
|
||||||
version = "1.0.108"
|
version = "1.0.111"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
|
checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"itoa",
|
"itoa",
|
||||||
"ryu",
|
"ryu",
|
||||||
@@ -280,9 +280,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.39"
|
version = "2.0.48"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@@ -335,37 +335,13 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-sys"
|
|
||||||
version = "0.48.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
|
|
||||||
dependencies = [
|
|
||||||
"windows-targets 0.48.5",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.52.0",
|
"windows-targets",
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows-targets"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
|
||||||
dependencies = [
|
|
||||||
"windows_aarch64_gnullvm 0.48.5",
|
|
||||||
"windows_aarch64_msvc 0.48.5",
|
|
||||||
"windows_i686_gnu 0.48.5",
|
|
||||||
"windows_i686_msvc 0.48.5",
|
|
||||||
"windows_x86_64_gnu 0.48.5",
|
|
||||||
"windows_x86_64_gnullvm 0.48.5",
|
|
||||||
"windows_x86_64_msvc 0.48.5",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -374,93 +350,51 @@ version = "0.52.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
|
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows_aarch64_gnullvm 0.52.0",
|
"windows_aarch64_gnullvm",
|
||||||
"windows_aarch64_msvc 0.52.0",
|
"windows_aarch64_msvc",
|
||||||
"windows_i686_gnu 0.52.0",
|
"windows_i686_gnu",
|
||||||
"windows_i686_msvc 0.52.0",
|
"windows_i686_msvc",
|
||||||
"windows_x86_64_gnu 0.52.0",
|
"windows_x86_64_gnu",
|
||||||
"windows_x86_64_gnullvm 0.52.0",
|
"windows_x86_64_gnullvm",
|
||||||
"windows_x86_64_msvc 0.52.0",
|
"windows_x86_64_msvc",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_gnullvm"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
|
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_aarch64_msvc"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_msvc"
|
name = "windows_aarch64_msvc"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
|
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_gnu"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_gnu"
|
name = "windows_i686_gnu"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
|
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_i686_msvc"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_i686_msvc"
|
name = "windows_i686_msvc"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
|
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnu"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnu"
|
name = "windows_x86_64_gnu"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
|
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_gnullvm"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_gnullvm"
|
name = "windows_x86_64_gnullvm"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
|
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "windows_x86_64_msvc"
|
|
||||||
version = "0.48.5"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_x86_64_msvc"
|
name = "windows_x86_64_msvc"
|
||||||
version = "0.52.0"
|
version = "0.52.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user