12#define MAX_PROGRAM_STORAGE_WORDS 129
16 memset(
ge, 0,
sizeof(*
ge));
89 default:
return "(empty)";
99 uint8_t a = VAMA2(
ge), b = VEMB6(
ge), c = VAMC2(
ge);
100 uint8_t printed = (a && b) || (!a && !b) || (a && !b && c);
106 printed ?
"" :
" (off-table straps, bound per ch.080)");
110 "F03=%s F04=%s F05=%s S42=%s\n",
117 ge_log(
LOG_DEBUG,
"options: FUL26=%u FUL36=%u -> load on connectors %s; "
118 "FEL06=%u FEL16=%u FUL4G=%u FUL4F=%u\n",
119 FUL26(
ge), FUL36(
ge),
120 FUL26(
ge) ? (FUL36(
ge) ?
"2 and 3" :
"2 and 4") :
"4 and 3",
121 FEL06(
ge), FEL16(
ge), FUL4G(
ge), FUL4F(
ge));
125 INES3(
ge), INES4(
ge),
126 (INES3(
ge) && INES4(
ge)) ?
"on connectors 3 and 4" :
127 INES3(
ge) ?
"on connector 3" :
128 INES4(
ge) ?
"on connector 4" :
"disabled");
132 "(VAMA1=%u VAMB1=%u VAMC1=%u)\n",
133 VAMA2(
ge), VEMB6(
ge), VAMC2(
ge),
134 VAMA1(
ge), VAMB1(
ge), VAMC1(
ge));
296 for (
int n = 0; n < 8; n++) {
297 uint16_t v = (uint16_t)(n << 12);
298 ge->
mem[240 + 2 * n] = (uint8_t)(v >> 8);
299 ge->
mem[240 + 2 * n + 1] = (uint8_t)(v & 0xff);
308 return __builtin_parity(data) ? 0 : 1;
335 if (image == NULL && size != 0)
337 if ((uint32_t)origin + (uint32_t)size > max)
340 for (
size_t i = 0; i < size; i++) {
341 uint16_t a = (uint16_t)(origin + i);
342 ge->
mem[a] = image[i];
407 name =
"- Display sequence";
410 name =
"- Forcing sequence";
414 name =
"- Beta Phase";
417 name =
"- Initialitiation";
421 name =
"- Alpha Phase";
424 name =
"- Interruption";
451 "SO: %02x SA: %02x PO: %04x RO: %04x BO: %04x FO: %04x - "
452 "V1: %04x V2: %04x V3: %04x V4: %04x - "
453 "L1: %04x L2: %04x L3 : %04x\n",
463 "SO: %02x SA: %02x PO: %04x RO: %04x BO: %04x FO: %04x - "
464 "NO: %02x NI: %02x - "
465 "FA: %02x FI: %02x - "
466 "V1: %04x V2: %04x V3: %04x V4: %04x - "
467 "L1: %04x L2: %04x L3 : %04x\n",
593 if (
ge->
RIA0 && advance_so) {
597 ge_log(
LOG_FUTURE,
"last clock cpu, SO held at %02x (RIA0 %d advance %d)\n",
617 is_papa, is_norm, is_scr,
618 ge->
RIA0 && (is_papa || !(is_norm || is_scr)));
620 if (
ge->
RIA0 && (is_papa || !(is_norm || is_scr)))
int ge_deinit(struct ge *ge)
Deinitialize the emulator.
void ge_seed_segment_bases(struct ge *ge)
Seed the eight change/segment-base registers (mem[240+2N]) to identity bases N<<12.
void ge_load_1(struct ge *ge)
Emulate the press of the "load 1" button in the console.
void ge_print_registers_nonverbose(struct ge *ge)
static void ge_print_well_known_states(uint8_t state)
void ge_clear(struct ge *ge)
Emulate the press of the "clear" button in the console.
int ge_run_cycle(struct ge *ge)
Run all GE "mastri" clock periods until next clock cycle.
void ge_clock_increment(struct ge *ge)
const char * ge_clock_name(enum clock c)
The clock period name name.
uint8_t ge_clock_is_first(struct ge *ge)
void ge_mem_store8(struct ge *ge, uint16_t addr, uint8_t val)
Store a byte with generated odd parity + mark-written (for the hybrid ALU/SS write paths that write g...
static const char * pont_name(enum ge_pont p)
void ge_load_2(struct ge *ge)
Emulate the press of the "load 2" button in the console.
void ge_enter(struct ge *ge, uint16_t entry)
Force the sequencer into the alpha (fetch) phase at entry.
uint8_t ge_clock_is_last(struct ge *ge)
static uint8_t ge_odd_parity(uint8_t data)
void ge_init(struct ge *ge)
Initialize the emulator.
int ge_run_pulse(struct ge *ge)
Run a single pulse (i.e. a single GE "mastri" clock periods)
void fsn_last_clock(struct ge *ge)
Commit the future state.
void ge_print_registers_verbose(struct ge *ge)
void ge_load(struct ge *ge)
Emulate the press of the "load" button in the console.
void ge_log_options(struct ge *ge)
Report the strapped configuration and every level it produces (LOG_DEBUG).
int ge_load_image(struct ge *ge, const uint8_t *image, size_t size, uint16_t origin)
Write a flat image into core at origin, priming the parity store.
void connectors_first_clock(struct ge *ge)
void ge_start(struct ge *ge)
Emulate the press of the "start" button in the console.
ge_pont
Backplane option connectors and the maintenance LAMPS switch.
void pulse(struct ge *ge)
static uint16_t NI_knot(struct ge *ge)
NI Knot.
static uint16_t NO_knot(struct ge *ge)
Knot driven by P0, V1, V2, V4, L1, R1, V3 and L3.
static uint16_t ge_memory_capacity_k(struct ge *ge)
static uint16_t ge_cycle_period_ns(const struct ge *ge)
Cycle period in nanoseconds for the strapped version.
static uint16_t ge_cpu_version_uce(const struct ge *ge)
Processor version: 466, 467 or 468 (cp06 ch.002 TAB.1).
void ge_log(ge_log_type type, const char *format,...)
Log message.
uint8_t ge_log_enabled(ge_log_type type)
Check if a log type is enabled.
@ LOG_REGS_V
Register trace per pulse.
@ LOG_ERR
Emulator unrecoverable condition.
@ LOG_FUTURE
Future state network debug.
@ LOG_REGS
Register trace per cycle.
@ LOG_DEBUG
General detailed debug information.
@ LOG_READER
Integrated Reader.
const struct msl_timing_state * msl_get_state(uint8_t SO)
Gets timing state␐␐␐␐␐␐␐␐␐.
void msl_run_state(struct ge *ge, const struct msl_timing_state *state)
Select the first matching manual-sheet variant for an instruction state.
int ge_peri_on_pulses(struct ge *ge)
int ge_peri_deinit(struct ge *ge)
int ge_peri_on_clock(struct ge *ge)
uint16_t PATE
Stop after a cycle.
uint16_t RICI
Disables next status.
uint16_t PAPA
Step By Step execution.
enum ge_pont E03
E03: machine version, paired with F04 (TAB.1) – FEL06 / FEL16.
enum ge_pont F03
F03: which connectors may raise an interruption (TAB.2).
enum ge_pont E04
E04: which two connectors are enabled for the initial LOAD (TAB.3).
uint8_t S42_diag
S42 "LAMPS" on the maintenance panel, in position DIAG.
enum ge_pont E05
E05 / F05: memory capacity (cp06 ch.001, "SELEZIONE CAPACITA MEMORIA") – 8K through 32K.
enum ge_pont F04
F04: machine version straps – cycle period and performance (TAB.1).
The entire state of the emulated system, including registers, memory, peripherals and timings.
uint8_t ALAM
Operator Call.
uint16_t instr_pc
Instruction-start PC (display aid, not a real register).
uint8_t ALOI
Load connector selection.
uint8_t AINI
Program Loading.
struct ge_integrated_reader integrated_reader
The I/O interface for the integrated reader (RI)
struct ge_connector ST4
The I/O interface for the ST4 connector.
uint8_t ALTO
Stops internal cycles.
uint8_t ffFA
Special conditions register 2.
uint16_t rPO
Program addresser.
uint8_t future_state
Future state.
uint8_t inv_add
Invalid-address fault flag: set when rVO >= installed memory size.
uint8_t PODI
Slow delay line.
uint8_t mem_written[MEM_SIZE]
1 once a location has been written; prevents false MEM CHECK on cleared memory
enum ge_console_rotary register_selector
The current state of the console register rotary switch.
uint8_t RIA0
Synchronous CPU Cycle Request.
uint32_t mem_size
Installed memory size; 0 is treated as MEM_SIZE (full address space)
uint8_t RIA2
Synchronous Channel 2 Cycle Request.
uint16_t rV1
Addresser for the first operand.
uint8_t mem_check
Parity fault flag: set when a READ finds a parity mismatch on a previously-written location.
uint8_t rSO
Main sequencer.
uint16_t rRO
Multipurpose 8+1 bit register.
struct ge_console_switches console_switches
The current state of the console switches.
struct ge_connector ST3
The I/O interface for the ST3 connector.
uint8_t rL2
Auxiliary register.
uint8_t ffFI
Special conditions register 1.
uint8_t RC00
Asynchronous CPU Cycle Request.
uint16_t rBO
Default operator.
uint8_t RC01
Asynchronous Channel 1 Cycle Request.
uint8_t RECE
Selection Check Byte.
uint8_t mem[MEM_SIZE]
The memory of the emulated system.
struct ge_channel channel2
Integrated channel 2 (CAN2) line bundle — shared by the integrated reader (input),...
uint8_t RAVI
VICU Support.
uint8_t RACI
Rejected Command.
uint16_t rV4
Addresser for external instructions using channel 2.
uint16_t rL1
Length of the operand.
uint8_t rSA
Future state configuration.
uint16_t rV2
Addresser for the second operand.
uint8_t RC02
Asynchronous Channel 2 Cycle Request.
uint8_t ADIR
Disable Step By Step.
struct ge_options options
Backplane straps and maintenance-panel options (cp06 ch.002).
uint8_t RIG1
End from controller 1.
uint8_t rSI
Peripheral unit sequencer.
uint8_t RC03
Asynchronous Channel 3 Cycle Request.
uint8_t JE
JE/AVER jump instruction exectuted.
uint8_t ACIC
Recycle delay line.
uint16_t rL3
Length of operands involving channel 3.
uint8_t mem_parity[MEM_SIZE]
Stored odd-parity bit (1 bit per location) written alongside mem[].
uint16_t rV3
Addresser for external instructions using channel 3.
uint8_t rFO
Current function code.
uint16_t cr_cache[8]
Change/segment-register cache (kept in sync by the register instructions via cr_wr16 and by ge_seed_s...