pim-simulator dump inst function
This commit is contained in:
@@ -46,6 +46,10 @@ impl Instruction {
|
|||||||
.with_context(|| format!("Error in core: {}", self.data.core_indx() - 1))
|
.with_context(|| format!("Error in core: {}", self.data.core_indx() - 1))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn dump(&self) {
|
||||||
|
eprintln!("\t{}", functor_to_name(self.functor as usize));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type Instructions = Vec<Instruction>;
|
pub type Instructions = Vec<Instruction>;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
cpu::CPU, instruction_set::{Instruction, InstructionStatus, Instructions}, memory_manager::type_traits::TryToUsize, send_recv::{SendRecv, handle_send_recv}, tracing::TRACER
|
cpu::CPU, instruction_set::{Instruction, InstructionStatus, Instructions, isa::functor_to_name}, memory_manager::type_traits::TryToUsize, send_recv::{SendRecv, handle_send_recv}, tracing::TRACER
|
||||||
};
|
};
|
||||||
pub mod cpu;
|
pub mod cpu;
|
||||||
pub mod instruction_set;
|
pub mod instruction_set;
|
||||||
@@ -131,6 +131,16 @@ impl Executable {
|
|||||||
pub fn cpu_mut(&mut self) -> &mut CPU {
|
pub fn cpu_mut(&mut self) -> &mut CPU {
|
||||||
&mut self.cpu
|
&mut self.cpu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn dump(&self) {
|
||||||
|
let core_instructions = &self.core_instructions;
|
||||||
|
for (i, core_instruction) in core_instructions.iter().enumerate() {
|
||||||
|
eprintln!("INST OF CORE {}:", i);
|
||||||
|
for inst in &core_instruction.instructions {
|
||||||
|
inst.dump();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_wait_sync(cpu: &mut CPU, core_instructions: &mut [CoreInstruction], core_result: InstructionStatus) {
|
fn handle_wait_sync(cpu: &mut CPU, core_instructions: &mut [CoreInstruction], core_result: InstructionStatus) {
|
||||||
|
|||||||
Reference in New Issue
Block a user