gwr_models/memory/
traits.rs1use gwr_engine::traits::{Routable, TotalBytes};
4use gwr_engine::types::SimError;
5
6use crate::memory::CacheHintType;
7use crate::memory::memory_map::DeviceId;
8
9pub trait ReadMemory {
10 fn read(&self) -> Vec<u8>;
11}
12
13pub trait AccessMemory
15where
16 Self: Routable + TotalBytes,
17{
18 fn dst_addr(&self) -> u64;
20
21 fn src_addr(&self) -> u64;
23
24 fn dst_device(&self) -> DeviceId;
26
27 fn src_device(&self) -> DeviceId;
29
30 fn access_size_bytes(&self) -> usize;
32
33 fn to_response(&self, mem: &impl ReadMemory) -> Result<Self, SimError>
35 where
36 Self: Sized;
37
38 fn cache_hint(&self) -> CacheHintType;
40}