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

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Β§

Alarm
Describes an alarm which is active.
AlarmStatus
The status of an alarm.
Context
State shared between the emulator and the UI.
ControlRegisters
Registers from various elements of the TX-2.
ControlUnit
ControlUnit simulates the operation of the Control Element of the TX-2 computer.
DeviceManager
Manages a collection of devices. Does not actually correspond to a tangible physical component of the TX-2 system.
ExtendedConnectedUnitStatus
Status information for a unit which is actually connected.
ExtendedUnitState
The state of a unit (hardware belonging to a sequence).
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) }
MemoryConfiguration
MemoryConfiguration indicates how the emulated TX-2’s memory is configured.
MemoryUnit
Tx2
Tx2 emulates the TX-2 computer, with peripherals.
UnmaskedAlarm
Describes an alarm which is active and is not masked (meaning that it is actually firing).

EnumsΒ§

AlarmDetails
AlarmsDetails variant names are from User’s Handbook section 5-2.2; full names are taken from section 10-2.5.1 (vol 2) of the Technical Manual.
AlarmKind
Describes the kinds of alarm that exist in the TX-2.
FlagChange
Signals that a flag has changed (and why).
InputEvent
An input event.
InputEventError
A failed input event.
InputFlagRaised
Indicates whether or not a unit’s input flag is raised.
OutputEvent
An output event.
PanicOnUnmaskedAlarm
ResetMode
RunMode
TransferMode
Determines how TSD instructions for Lincoln Writer seuenced behave.
UpdateE
Determines whether a memory operation updates the E register.

ConstantsΒ§

PETR

FunctionsΒ§

bug_report_url
Provide a URL at which a human can report a bug.
set_up_peripherals