[][src]Struct riscv_emu_rust::memory::Memory

pub struct Memory { /* fields omitted */ }

Emulates main memory.

Implementations

impl Memory[src]

pub fn new() -> Self[src]

Creates a new Memory

pub fn init(&mut self, capacity: u64)[src]

Initializes memory content. This method is expected to be called only once.

Arguments

  • capacity

pub fn read_byte(&self, address: u64) -> u8[src]

Reads a byte from memory.

Arguments

  • address

pub fn read_halfword(&self, address: u64) -> u16[src]

Reads two bytes from memory.

Arguments

  • address

pub fn read_word(&self, address: u64) -> u32[src]

Reads four bytes from memory.

Arguments

  • address

pub fn read_doubleword(&self, address: u64) -> u64[src]

Reads eight bytes from memory.

Arguments

  • address

pub fn read_bytes(&self, address: u64, width: u64) -> u64[src]

Reads multiple bytes from memory.

Arguments

  • address
  • width up to eight

pub fn write_byte(&mut self, address: u64, value: u8)[src]

Writes a byte to memory.

Arguments

  • address
  • value

pub fn write_halfword(&mut self, address: u64, value: u16)[src]

Writes two bytes to memory.

Arguments

  • address
  • value

pub fn write_word(&mut self, address: u64, value: u32)[src]

Writes four bytes to memory.

Arguments

  • address
  • value

pub fn write_doubleword(&mut self, address: u64, value: u64)[src]

Writes eight bytes to memory.

Arguments

  • address
  • value

pub fn write_bytes(&mut self, address: u64, value: u64, width: u64)[src]

Write multiple bytes to memory.

Arguments

  • address
  • value
  • width up to eight

pub fn validate_address(&self, address: u64) -> bool[src]

Check if the address is valid memory address

Arguments

  • address

Auto Trait Implementations

impl RefUnwindSafe for Memory

impl Send for Memory

impl Sync for Memory

impl Unpin for Memory

impl UnwindSafe for Memory

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.