summaryrefslogtreecommitdiff
path: root/src/core.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.rs')
-rw-r--r--src/core.rs13
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;
}