pub struct MemoryUnit {
s_memory: Memory,
t_memory: Memory,
u_memory: Option<Memory>,
v_memory: VMemory,
}
Fields§
§s_memory: Memory
The S-memory is core memory with transistorized logic.
t_memory: Memory
The T-memory is faster than S-memory, but smaller.
u_memory: Option<Memory>
The U-memory was supposed to be like the T-memory, but was not fitted.
v_memory: VMemory
The V-memory contains flip-flops (e.g. registers A-E, M), memory-mapped hardware devices and the plugboards.
Implementations§
Source§impl MemoryUnit
impl MemoryUnit
pub fn new(ctx: &Context, config: &MemoryConfiguration) -> MemoryUnit
pub fn get_a_register(&self) -> Unsigned36Bit
pub fn get_b_register(&self) -> Unsigned36Bit
pub fn get_c_register(&self) -> Unsigned36Bit
pub fn get_d_register(&self) -> Unsigned36Bit
pub fn get_e_register(&self) -> Unsigned36Bit
pub fn set_a_register(&mut self, value: Unsigned36Bit)
pub fn set_b_register(&mut self, value: Unsigned36Bit)
pub fn set_c_register(&mut self, value: Unsigned36Bit)
pub fn set_d_register(&mut self, value: Unsigned36Bit)
pub fn set_e_register(&mut self, value: Unsigned36Bit)
Sourcefn read_access<'a>(
&'a mut self,
ctx: &Context,
addr: &Address,
) -> Result<MemoryReadRef<'a>, MemoryOpFailure>
fn read_access<'a>( &'a mut self, ctx: &Context, addr: &Address, ) -> Result<MemoryReadRef<'a>, MemoryOpFailure>
Perform a memory read access. Return a MemoryReadRef
for
the memory word being accessed.
Sourcefn write_access<'a>(
&'a mut self,
ctx: &Context,
addr: &Address,
) -> Result<Option<MemoryWriteRef<'a>>, MemoryOpFailure>
fn write_access<'a>( &'a mut self, ctx: &Context, addr: &Address, ) -> Result<Option<MemoryWriteRef<'a>>, MemoryOpFailure>
Perform a memory write access. Return a MemoryWriteRef
for the memory word being accessed. If the memory location is
read-only, return Ok(None)
.
Trait Implementations§
Source§impl Debug for MemoryUnit
impl Debug for MemoryUnit
Source§impl MemoryMapped for MemoryUnit
impl MemoryMapped for MemoryUnit
Source§fn cycle_full_word_for_tsd(
&mut self,
ctx: &Context,
addr: &Address,
) -> Result<ExtraBits, MemoryOpFailure>
fn cycle_full_word_for_tsd( &mut self, ctx: &Context, addr: &Address, ) -> Result<ExtraBits, MemoryOpFailure>
Cycle the memory word for TSD
.
This behaviour is described on page 4-9 of the TX-2 Users Handbook.
Source§fn fetch(
&mut self,
ctx: &Context,
addr: &Address,
side_effect: &MetaBitChange,
) -> Result<(Unsigned36Bit, ExtraBits), MemoryOpFailure>
fn fetch( &mut self, ctx: &Context, addr: &Address, side_effect: &MetaBitChange, ) -> Result<(Unsigned36Bit, ExtraBits), MemoryOpFailure>
Fetch a word.
Source§fn store(
&mut self,
ctx: &Context,
addr: &Address,
value: &Unsigned36Bit,
meta: &MetaBitChange,
) -> Result<(), MemoryOpFailure>
fn store( &mut self, ctx: &Context, addr: &Address, value: &Unsigned36Bit, meta: &MetaBitChange, ) -> Result<(), MemoryOpFailure>
Store a word.
Source§fn change_bit(
&mut self,
ctx: &Context,
addr: &Address,
op: &WordChange,
) -> Result<Option<bool>, MemoryOpFailure>
fn change_bit( &mut self, ctx: &Context, addr: &Address, op: &WordChange, ) -> Result<Option<bool>, MemoryOpFailure>
Mutate a bit in-place, returning its previous value.
Auto Trait Implementations§
impl Freeze for MemoryUnit
impl RefUnwindSafe for MemoryUnit
impl Send for MemoryUnit
impl Sync for MemoryUnit
impl Unpin for MemoryUnit
impl UnwindSafe for MemoryUnit
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.
§impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
impl<Src, Dst> ValueInto<Dst> for Srcwhere
Dst: ValueFrom<Src>,
§fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>
Convert the subject into an exactly equivalent representation.