diff --git a/src/agent.rs b/src/agent.rs index a93658f6a..8d1a1eace 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -60,10 +60,14 @@ pub async fn emulation_core_agent(scope: ReactorScope) DatapathUpdate::MIPS(MipsStateUpdate::UpdateMemory(datapath.memory.clone())); let stage_update = DatapathUpdate::MIPS(MipsStateUpdate::UpdateStage(datapath.current_stage)); + let coprocessor_update = DatapathUpdate::MIPS(MipsStateUpdate::UpdateCoprocessor( + datapath.coprocessor.clone(), + )); state.scope.send(state_update).await.unwrap(); state.scope.send(register_update).await.unwrap(); state.scope.send(memory_update).await.unwrap(); state.scope.send(stage_update).await.unwrap(); + state.scope.send(coprocessor_update).await.unwrap(); } } } diff --git a/src/agent/datapath_reducer.rs b/src/agent/datapath_reducer.rs index 63bfc7902..c14bdad90 100644 --- a/src/agent/datapath_reducer.rs +++ b/src/agent/datapath_reducer.rs @@ -1,6 +1,7 @@ use crate::agent::messages::MipsStateUpdate; use crate::emulation_core::architectures::AvailableDatapaths::MIPS; use crate::emulation_core::architectures::{AvailableDatapaths, DatapathUpdate}; +use crate::emulation_core::mips::coprocessor::MipsFpCoprocessor; use crate::emulation_core::mips::datapath::{DatapathState, Stage}; use crate::emulation_core::mips::memory::Memory; use crate::emulation_core::mips::registers::GpRegisters; @@ -19,6 +20,7 @@ pub struct MipsCoreState { pub registers: GpRegisters, pub memory: Memory, pub current_stage: Stage, + pub coprocessor: MipsFpCoprocessor, } impl Default for DatapathReducer { @@ -43,24 +45,35 @@ impl Reducible for DatapathReducer { registers: self.mips.registers, memory: self.mips.memory.clone(), current_stage: self.mips.current_stage, + coprocessor: self.mips.coprocessor.clone(), }, MipsStateUpdate::UpdateRegisters(registers) => MipsCoreState { state: self.mips.state.clone(), registers, memory: self.mips.memory.clone(), current_stage: self.mips.current_stage, + coprocessor: self.mips.coprocessor.clone(), }, MipsStateUpdate::UpdateMemory(memory) => MipsCoreState { state: self.mips.state.clone(), registers: self.mips.registers, memory, current_stage: self.mips.current_stage, + coprocessor: self.mips.coprocessor.clone(), }, MipsStateUpdate::UpdateStage(stage) => MipsCoreState { state: self.mips.state.clone(), registers: self.mips.registers, memory: self.mips.memory.clone(), current_stage: stage, + coprocessor: self.mips.coprocessor.clone(), + }, + MipsStateUpdate::UpdateCoprocessor(coprocessor) => MipsCoreState { + state: self.mips.state.clone(), + registers: self.mips.registers, + memory: self.mips.memory.clone(), + current_stage: self.mips.current_stage, + coprocessor, }, }, }, diff --git a/src/agent/messages.rs b/src/agent/messages.rs index 664c2deaa..8de055b0a 100644 --- a/src/agent/messages.rs +++ b/src/agent/messages.rs @@ -1,3 +1,4 @@ +use crate::emulation_core::mips::coprocessor::MipsFpCoprocessor; use crate::emulation_core::mips::datapath::DatapathState; use crate::emulation_core::mips::memory::Memory; use crate::emulation_core::mips::registers::GpRegisters; @@ -26,4 +27,5 @@ pub enum MipsStateUpdate { UpdateRegisters(GpRegisters), UpdateMemory(Memory), UpdateStage(Stage), + UpdateCoprocessor(MipsFpCoprocessor), } diff --git a/src/bin/main.rs b/src/bin/main.rs index 011ea91d2..5f505212c 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -522,7 +522,7 @@ fn app(props: &AppProps) -> Html { // Console -