diff options
| author | taitep <taitep@taitep.se> | 2025-12-28 12:01:39 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-28 12:01:39 +0100 |
| commit | 9a9bef7dd7dce7d5c10b7cf49a42478ad85829ac (patch) | |
| tree | ea832693678899e97aecf12bd620f0123b6ce3d2 /src/core.rs | |
| parent | 8024af6b1348b5f47fabe5a1949de54607a33888 (diff) | |
Remove consts.rs and just use plain types
Diffstat (limited to 'src/core.rs')
| -rw-r--r-- | src/core.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core.rs b/src/core.rs index eb0549f..07df2f5 100644 --- a/src/core.rs +++ b/src/core.rs @@ -7,7 +7,6 @@ use std::{collections::HashSet, sync::mpsc}; use crate::{ - consts::{Addr, RegId, RegValue}, core::commands::CoreCmd, decode::Instruction, exceptions::{Exception, ExceptionType, MemoryException}, @@ -17,8 +16,8 @@ use crate::{ }; pub struct Core { - pub(crate) x_regs: [RegValue; 32], - pub(crate) pc: Addr, + pub(crate) x_regs: [u64; 32], + pub(crate) pc: u64, pub(crate) mem: MemConfig, command_stream: mpsc::Receiver<CoreCmd>, } @@ -119,7 +118,7 @@ impl Core { fn continue_loop( &mut self, - breakpoints: &HashSet<Addr>, + breakpoints: &HashSet<u64>, stopper: oneshot::Receiver<()>, ) -> StopReason { loop { @@ -177,15 +176,15 @@ impl Core { dbg!(self.pc, self.x_regs); } - pub fn reset(&mut self, pc: Addr) { + pub fn reset(&mut self, pc: u64) { self.pc = pc; } - pub(crate) fn reg_read(&self, id: RegId) -> RegValue { + pub(crate) fn reg_read(&self, id: u8) -> u64 { self.x_regs[id as usize] } - pub(crate) fn reg_write(&mut self, id: RegId, value: RegValue) { + pub(crate) fn reg_write(&mut self, id: u8, value: u64) { if id == 0 { return; } |
