Struct rsim::processor::elements::memory::MemoryBacking [−][src]
Array-backed memory
Defines a valid address range - all addresses passed into read/write must be within this range
Implements MemoryOf
Fields
data
- Backing vector. Guaranteed to be the same length asrange
range
- Address range backed by the vector. Contains at least 4 elements, addresses aligned to 4-bytes
Fields
data: Vec<u8>
range: Range<usize>
Implementations
impl MemoryBacking
[src]
impl MemoryBacking
[src]pub fn zeros(range: Range<usize>) -> MemoryBacking
[src]
Generate a vector of zeros and map it to an address range.
pub fn from_vec(vec: Vec<u8>, range: Range<usize>) -> MemoryBacking
[src]
Map a set of bytes to an address range. Any empty space between the end of the file data and the end of the range will be zero-padded.
pub fn from_file(path_s: &str, range: Range<usize>) -> MemoryBacking
[src]
Read bytes from a file and map them to an address range. The file data will be read into the start of the range, any empty space between the end of the file data and the end of the range will be zero-padded.
Trait Implementations
impl From<MemoryBacking> for AggregateMemory
[src]
impl From<MemoryBacking> for AggregateMemory
[src]For convenience, allow a single MemoryBacking to be converted directly to an AggregateMemory
fn from(backing: MemoryBacking) -> Self
[src]
impl Memory<u64> for MemoryBacking
[src]
impl Memory<u64> for MemoryBacking
[src]fn range(&self) -> Range<usize>
[src]
fn as_any(&self) -> &dyn Any
[src]
fn load_u8(&mut self, addr: TAddr) -> MemoryResult<u8>
[src]
fn load_u16(&mut self, addr: TAddr) -> MemoryResult<u16>
[src]
fn load_u32(&mut self, addr: TAddr) -> MemoryResult<u32>
[src]
fn load_u64(&mut self, addr: TAddr) -> MemoryResult<u64>
[src]
fn store_u8(&mut self, addr: TAddr, val: u8) -> MemoryResult<()>
[src]
fn store_u16(&mut self, addr: TAddr, val: u16) -> MemoryResult<()>
[src]
fn store_u32(&mut self, addr: TAddr, val: u32) -> MemoryResult<()>
[src]
fn store_u64(&mut self, addr: TAddr, val: u64) -> MemoryResult<()>
[src]
impl MemoryOf<u16, u64> for MemoryBacking
[src]
impl MemoryOf<u16, u64> for MemoryBacking
[src]impl MemoryOf<u32, u64> for MemoryBacking
[src]
impl MemoryOf<u32, u64> for MemoryBacking
[src]impl MemoryOf<u64, u64> for MemoryBacking
[src]
impl MemoryOf<u64, u64> for MemoryBacking
[src]