pub struct MemoryReadPort {
pub addr: Value,
pub data_len: usize,
pub flip_flop: Option<MemoryReadFlipFlop>,
}
Expand description
A memory read port, either synchronous or asynchronous.
Fields§
§addr: Value
The read address, selecting which row(s) to read. Follows the same rules as
MemoryWritePort
address.
Reading an out-of-bounds address results in an undefined value.
data_len: usize
The width of the read data. Must be a power-of-two multiple of the memory width.
flip_flop: Option<MemoryReadFlipFlop>
A flip-flop-like structure describing the synchronous read port, or None
for asynchronous
read ports. If this is None
, the read port continuously reads the memory row(s) selected
by the addr
value and outputs that as the read data.
Implementations§
Source§impl MemoryReadPort
impl MemoryReadPort
pub fn new_asynchronous(addr: impl Into<Value>, data_len: usize) -> Self
pub fn new_clocked( addr: impl Into<Value>, data_len: usize, clock: impl Into<ControlNet>, ) -> Self
pub fn wide_log2(&self, memory: &Memory) -> usize
pub fn visit(&self, f: impl FnMut(Net))
pub fn visit_mut(&mut self, f: impl FnMut(&mut Net))
Trait Implementations§
Source§impl Clone for MemoryReadPort
impl Clone for MemoryReadPort
Source§fn clone(&self) -> MemoryReadPort
fn clone(&self) -> MemoryReadPort
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MemoryReadPort
impl Debug for MemoryReadPort
Source§impl Hash for MemoryReadPort
impl Hash for MemoryReadPort
Source§impl PartialEq for MemoryReadPort
impl PartialEq for MemoryReadPort
impl Eq for MemoryReadPort
impl StructuralPartialEq for MemoryReadPort
Auto Trait Implementations§
impl Freeze for MemoryReadPort
impl RefUnwindSafe for MemoryReadPort
impl Send for MemoryReadPort
impl Sync for MemoryReadPort
impl Unpin for MemoryReadPort
impl UnwindSafe for MemoryReadPort
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.