Ram

Struct Ram 

Source
pub(crate) struct Ram {
    pub(crate) memory: Vec<u8>,
    pub(crate) listed: Vec<bool>,
    pub(crate) tainted: Vec<bool>,
    pub(crate) touched: Vec<u32>,
    pub(crate) seen: Vec<(u8, u32, u8)>,
    pub(crate) unlisted: Option<u32>,
    pub(crate) pending_taint: bool,
    pub(crate) own_cells: Vec<u32>,
    pub(crate) overlapped: bool,
}
Expand description

The case’s sparse RAM over the flat 2 MB, and the bookkeeping the reference keeps in dicts and sets.

Fields§

§memory: Vec<u8>§listed: Vec<bool>

The address is a key of the reference’s memory dict.

§tainted: Vec<bool>

Block transfers read far more than the 500 RAM pairs the generator kept: a read of an address the case does not list returns 0 and taints the byte written next, and anything that depends on a tainted byte is not compared.

§touched: Vec<u32>§seen: Vec<(u8, u32, u8)>§unlisted: Option<u32>§pending_taint: bool§own_cells: Vec<u32>§overlapped: bool

Implementations§

Source§

impl Ram

Source

pub(crate) fn new() -> Self

Source

pub(crate) fn clear(&mut self)

Source

pub(crate) fn set(&mut self, address: u32, value: u8)

Trait Implementations§

Source§

impl Bus for Ram

Source§

fn read(&mut self, address: u32, _: &mut Pins) -> u8

Source§

fn write(&mut self, address: u32, value: u8, _: &mut Pins)

Source§

fn idle(&mut self, address: Option<u32>, _: &mut Pins)

A cycle with no data transfer: Some(address) is the dummy read the chip makes (the byte after the opcode of an implied instruction), None an internal cycle. The default touches nothing (the reference’s _no_idle).
Source§

impl Default for Ram

Source§

fn default() -> Ram

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Ram

§

impl RefUnwindSafe for Ram

§

impl Send for Ram

§

impl Sync for Ram

§

impl Unpin for Ram

§

impl UnwindSafe for Ram

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.