Skip to main content

Crate cpu

Crate cpu 

Source
Expand description

This crate decodes instructions and emulates the arithmetic unit, the exchange unit, memory and the CPU side of the I/O system.

All the work is done in non-blocking function calls into this library.

The modules within this crate do not directly map to the elements of the TX-2 machine.

TX-2 ElementFeatureImplementation
Control ElementStart/Stop control, CODABO, STARTOVER, Sequencing the stages of instructionscontrol
Control ElementAlarmsalarmunit
In/Out ElementAllio
Program ElementSequence flags, Index register storage, Instruction decoding, Instruction, executrion, Deferred addressingcontrol
Program ElementSequence selection and switchingcontrol
Program ElementRegisters N, P, Q, Kcontrol
Program ElementConfiguration memorycontrol
Program ElementJumpscontrol
Arithmetic ElementRegister A, B, C, D, Arithmetic operations,control
Arithmetic ElementRegisters Y and ZNot yet implemented
Exchange ElementLoad/store processexchanger
Exchange ElementRegister Eexchanger
Exchange ElementRegister Mmemory
Exchange ElementQuarter activity, subword form, sign extensionexchanger
In/Out ElementConnecting/disconnecting peripherals, raising the flag of sequences for which I/O is readyio
Memory ElementMemory storageexchanger
ConsoleToggle Start Point Registercontrol::ControlUnit

Re-exportsยง

pub use alarm::Alarm;
pub use alarm::AlarmDetails;
pub use alarm::AlarmKind;
pub use alarm::UnmaskedAlarm;
pub use alarmunit::AlarmStatus;
pub use bugreport::bug_report_url;
pub use context::Context;
pub use control::ControlRegisters;
pub use control::ControlUnit;
pub use control::PanicOnUnmaskedAlarm;
pub use control::ResetMode;
pub use control::RunMode;
pub use io::DeviceManager;
pub use io::ExtendedConnectedUnitStatus;
pub use io::ExtendedUnitState;
pub use io::InputFlagRaised;
pub use io::set_up_peripherals;
pub use memory::MemoryConfiguration;
pub use memory::MemoryUnit;
pub use tx2::Tx2;

Modulesยง

alarm ๐Ÿ”’
TX-2 alarms.
alarmunit ๐Ÿ”’
The TX-2 can โ€œmaskโ€ some alarms, and whether or not this is happening is controlled by the AlarmUnit.
bugreport ๐Ÿ”’
Generate bug-report URLs.
changelog ๐Ÿ”’
A collection of orderable values which the caller can efficiently drain in one go.
context ๐Ÿ”’
This module manages the context in which the emulator is performing a single operation.
control ๐Ÿ”’
Emulates the principal central components of the TX-2.
diagnostics ๐Ÿ”’
Diagnostic information for log messages and alarms.
event ๐Ÿ”’
Input and output events.
exchanger ๐Ÿ”’
The Exchange Element governs data exchange between memory (via the M register) and other parts of the central compute unit (including the arithmetic element) via the E register.
io ๐Ÿ”’
This module simulates the CPU behaviours which relate to I/O devices (connect/disconnect, the ways the IOS and TSD instructions with devices).
memory ๐Ÿ”’
This module emulates the TX-2โ€™s STUV memory.
tx2 ๐Ÿ”’
Emulation of the TX-2 computer.
types ๐Ÿ”’
Simple types used in several places in the crate.

Structsยง

MaskedWord
A value of which bits 0..width are significant (0 being the least significant bit). Hence a six-bit value would be MaskedWord { width: 6, value: u13!(0o77) }

Enumsยง

FlagChange
Signals that a flag has changed (and why).
InputEvent
An input event.
InputEventError
A failed input event.
OutputEvent
An output event.
TransferMode
Determines how TSD instructions for Lincoln Writer seuenced behave.
UpdateE
Determines whether a memory operation updates the E register.

Constantsยง

PETR