[−][src]Struct rysk_core::system::Core
A single RISCV core Includes a single program counter and 32 registers Const generics will allow support of the E extensions for 16 registers
Fields
pc: R
The program counter
Implementations
impl<R: Register + Default + Copy + Clone> Core<R>
[src]
pub fn new(address: R::Unsigned, hart: R::Unsigned) -> Self
[src]
Creates a new core starting execution at the given address with the given hart ID Hart ID's must be unique to ensure correct program behaviour. There must be a hart with ID 0 on a given system address must be aligned to 4 bytes else a panic will occur during execution
pub fn step(&mut self)
[src]
Increments the program counter by the instruction size of 4 bytes
pub fn get(&self, index: usize) -> R
[src]
pub fn set(&mut self, index: usize, register: R)
[src]
pub fn get_csr(&self, index: usize) -> Result<R, Exception>
[src]
Get a value from a CSR. May have side-effects
pub fn set_csr(&mut self, index: usize, value: R)
[src]
Set a CSR to the specified value with program-defined access. May have side-effects
pub fn execute(&mut self, mmu: &mut dyn Mmu<R>) -> Result<(), Exception>
[src]
Decode and execute an instruction
Auto Trait Implementations
impl<R> RefUnwindSafe for Core<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Core<R> where
R: Send,
R: Send,
impl<R> Sync for Core<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Core<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Core<R> where
R: UnwindSafe,
R: UnwindSafe,
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>,