[−][src]Struct rvemu::cpu::Cpu
The CPU to contains registers, a program coutner, status, and a privileged mode.
Fields
xregs: XRegisters
fregs: FRegisters
pc: usize
state: State
mode: Mode
bus: Bus
enable_paging: bool
page_table: usize
Methods
impl Cpu
[src]
pub fn new() -> Cpu
[src]
Create a new Cpu
object.
pub fn reset(&mut self)
[src]
Reset CPU states.
pub fn fetch(&mut self) -> Result<u32, Exception>
[src]
Fetch the next instruction from the memory at the current program counter.
pub fn translate(&mut self, addr: usize) -> Result<usize, Exception>
[src]
Translate a virtual address to a physical address for the paged virtual-memory system.
pub fn execute(&mut self, data: u32) -> Result<(), Exception>
[src]
Execute an instruction. Raises an exception if something is wrong, otherwise, returns nothings.
Auto Trait Implementations
impl !RefUnwindSafe for Cpu
impl Send for Cpu
impl Sync for Cpu
impl Unpin for Cpu
impl !UnwindSafe for Cpu
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,