Implement ADD and JUMP instructions
This commit is contained in:
@@ -16,13 +16,9 @@ impl Default for BankArray {
|
||||
}
|
||||
|
||||
impl BankArray {
|
||||
pub fn write_data(&mut self) {
|
||||
unsafe {
|
||||
// Write to first bank
|
||||
let first_bank = &mut self.0[0];
|
||||
core::ptr::write_volatile(first_bank, f16::ZERO);
|
||||
self.invalidate_flush_single_bank(0);
|
||||
}
|
||||
pub fn execute_instruction_read(&self) {
|
||||
self.invalidate_single_bank(0);
|
||||
self.read_data();
|
||||
}
|
||||
|
||||
pub fn read_data(&self) {
|
||||
@@ -30,7 +26,20 @@ impl BankArray {
|
||||
// Read from first bank
|
||||
let first_bank = &self.0[0];
|
||||
core::ptr::read_volatile(first_bank);
|
||||
self.invalidate_flush_single_bank(0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn execute_instruction_write(&mut self) {
|
||||
self.preload_zero();
|
||||
self.write_data();
|
||||
self.invalidate_flush_single_bank(0);
|
||||
}
|
||||
|
||||
pub fn write_data(&mut self) {
|
||||
unsafe {
|
||||
// Write to first bank
|
||||
let first_bank = &mut self.0[0];
|
||||
core::ptr::write_volatile(first_bank, f16::ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,12 +99,6 @@ impl<const N: usize> ComputeArray<N> {
|
||||
pub fn invalidate(&self) {
|
||||
self.0.iter().for_each(|bank_array| bank_array.invalidate());
|
||||
}
|
||||
|
||||
pub fn preload_zero(&self) {
|
||||
self.0
|
||||
.iter()
|
||||
.for_each(|bank_array| bank_array.preload_zero());
|
||||
}
|
||||
}
|
||||
|
||||
impl<const N: usize> Default for ComputeArray<N> {
|
||||
|
||||
Reference in New Issue
Block a user