Trivial matrix multiplication kernel
This commit is contained in:
@@ -48,6 +48,12 @@ struct PimUnit {
|
||||
jump_counter: Option<u16>,
|
||||
}
|
||||
|
||||
impl PimUnit {
|
||||
fn reset(&mut self) {
|
||||
*self = Self::default();
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for PimUnit {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
@@ -71,8 +77,7 @@ struct PimVM {
|
||||
impl PimVM {
|
||||
fn reset(&mut self) {
|
||||
for unit in self.pim_units.iter_mut() {
|
||||
unit.pc = 0;
|
||||
unit.jump_counter = None;
|
||||
unit.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,10 +171,7 @@ impl PimVM {
|
||||
|
||||
match inst {
|
||||
Instruction::NOP => (),
|
||||
Instruction::EXIT => {
|
||||
pim_unit.jump_counter = None;
|
||||
pim_unit.pc = 0;
|
||||
}
|
||||
Instruction::EXIT => pim_unit.reset(),
|
||||
Instruction::JUMP { .. } => unreachable!(),
|
||||
Instruction::MOV { src, dst } | Instruction::FILL { src, dst } => {
|
||||
let data = PimVM::load(src, pim_unit, &bank_data);
|
||||
|
||||
Reference in New Issue
Block a user