pub struct Core<R: Register> {
pub pc: R,
/* private fields */
}Expand description
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: RThe program counter
Implementations§
Source§impl<R: Register + Default + Copy + Clone> Core<R>
impl<R: Register + Default + Copy + Clone> Core<R>
Sourcepub fn new(address: R::Unsigned, hart: R::Unsigned) -> Self
pub fn new(address: R::Unsigned, hart: R::Unsigned) -> Self
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.
Sourcepub fn get_csr(&self, index: usize) -> Result<R, Exception>
pub fn get_csr(&self, index: usize) -> Result<R, Exception>
Get a value from a CSR. May have side-effects
Auto Trait Implementations§
impl<R> Freeze for Core<R>where
R: Freeze,
impl<R> RefUnwindSafe for Core<R>where
R: RefUnwindSafe,
impl<R> Send for Core<R>where
R: Send,
impl<R> Sync for Core<R>where
R: Sync,
impl<R> Unpin for Core<R>where
R: Unpin,
impl<R> UnsafeUnpin for Core<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Core<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more