1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-26 04:02:39 +00:00

CMake: Make generate.py reusable

Make generate.py resuable outside of open-simh, as suggested and
motivated by Richard Cornwell's simulator repository.

- Make the "experimental" rule optional. Do not generate a Python
  "KeyError" if the rule is missing.

- Add documentation on how to use the CMake infrastructure outside
  of open-simh: Customize the packaging.py script, season to taste.

- Update the KA10 simulator customization, moving it to its own
  Python script, simgen/pdp10_simulator.py. Preparatory move that
  anticipates additional frontpanel and display options.

- generate.py option "--skip-orphans": Skip the orphaned simulator
  check (i.e., don't cross-reference the simulators in packaging.py
  with what was scraped from the makefile.)

- Add "TEST_ARGS" argument to CMake's add_simulator function so that the
  IBM 1130 simulator can pass to "-g" on the command line to disable the
  GUI when running RegisterSanityCheck, i.e.:

    ibm1130 RegisterSanityCheck -g

  This fixes an edge case Heisenbug encountered during Github CI/CD
  tests where ibm1130 appears to hang indefinitely on the Windows
  runners.

  The cause is the GUI's Pump() thread function being prematurely
  terminated before all GUI resources are acquired. The net result is an
  infinite loop in the MS C runtime trying to exit the process with
  unstable internal state. (Separate patch: synchronization across main
  and Pump() threads to ensure resource acquisition completes.)

  This issue never shows up on non-Windows platforms or the SIMH makefile.

- cmake/generator.py, cmake/simgen: Add a "test_args" keyword argument
  to the BasicSimulator constructor that holds the tests argument
  parameter emitted as the "TEST_ARGS" argument to a simulator's
  add_simulator(). Ensure that the IBM 1130 emits 'TEST_ARG "-g"' in its
  add_simulator().

- scp.c: reset_all_p() adds 'P' to the existing switches, versus saving
  sim_switches and ONLY setting the 'P' power-up reset switch. Net effect
  is that the IBM 1130 simulator actually sees the 'G' flag that inhibits
  the GUI during the console device reset.
This commit is contained in:
B. Scott Michel
2024-03-15 20:44:34 -07:00
committed by Paul Koning
parent 24f145ad16
commit 191b2131e9
15 changed files with 342 additions and 169 deletions

View File

@@ -46,6 +46,20 @@ add_simulator(pdp10
NO_INSTALL
TEST pdp10)
option(PANDA_LIGHTS
"Enable (=1)/disable (=0) KA-10/KI-11 simulator's Panda display. (def: disabled)"
FALSE)
option(PIDP10
"Enable (=1)/disable (=0) PIDP10 display options (def: disabled)"
FALSE)
### Ensure that the options are mutually exclusive:
if (PANDA_LIGHTS AND PIDP10)
message(FATAL_ERROR "PANDA_LIGHTS and PIDP10 options are mutually exclusive. Choose one.")
endif ()
add_simulator(pdp10-ka
SOURCES
${KA10D}/kx10_cpu.c
@@ -103,10 +117,14 @@ add_simulator(pdp10-ka
TEST ka10)
if (PANDA_LIGHTS)
target_sources(pdp10-ka PUBLIC ${PDP10D}/ka10_lights.c)
target_sources(pdp10-ka PUBLIC ${PDP10D}/kx10_lights.c)
target_compile_definitions(pdp10-ka PUBLIC PANDA_LIGHTS)
target_link_libraries(pdp10-ka PUBLIC usb-1.0)
endif (PANDA_LIGHTS)
endif ()
if (PIDP10)
target_sources(pdp10-ka PUBLIC ${PDP10D}/ka10_pipanel.c)
target_compile_definitions(pdp10-ka PUBLIC PIDP10=1)
endif ()
add_simulator(pdp10-ki
SOURCES