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.
53 lines
2.1 KiB
Python
53 lines
2.1 KiB
Python
## VAX simulators require extra magic -- notably, 'microvax3900${EXE}' needs
|
|
## to be symlinked, hardlinked or copied (in that order) to 'vax${EXE}'.
|
|
|
|
import simgen.basic_simulator as SBS
|
|
|
|
class BasicVAXSimulator(SBS.SIMHBasicSimulator):
|
|
"""
|
|
"""
|
|
def __init__(self, sim_name, dir_macro, test_name, buildrom):
|
|
super().__init__(sim_name, dir_macro, test_name, buildrom)
|
|
|
|
def write_unit_test(self, stream, indent, individual=False, test_label='default'):
|
|
stream.write('\n')
|
|
self.write_section(stream, 'add_unit_test', indent, individual=False, test_label=test_label,
|
|
section_name='vax_cc_{}'.format(self.sim_name),
|
|
section_srcs=['vax_cc.c'],
|
|
section_incs=self.includes)
|
|
|
|
class VAXSimulator(BasicVAXSimulator):
|
|
"""
|
|
"""
|
|
def __init__(self, sim_name, dir_macro, test_name, buildrom):
|
|
super().__init__(sim_name, dir_macro, test_name, buildrom)
|
|
|
|
def write_simulator(self, stream, indent, test_label='VAX'):
|
|
super().write_simulator(stream, indent, test_label)
|
|
stream.write('''
|
|
set(vax_binary_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
|
if (CMAKE_CONFIGURATION_TYPES)
|
|
string(APPEND vax_binary_dir "/$<CONFIG>")
|
|
endif (CMAKE_CONFIGURATION_TYPES)
|
|
|
|
add_custom_command(TARGET vax POST_BUILD
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
-DSRCFILE=vax${CMAKE_EXECUTABLE_SUFFIX}
|
|
-DDSTFILE=microvax3900${CMAKE_EXECUTABLE_SUFFIX}
|
|
-DWORKING_DIR=${vax_binary_dir}
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/file-link-copy.cmake
|
|
COMMENT "Symlink vax${CMAKE_EXECUTABLE_SUFFIX} to microvax3900${CMAKE_EXECUTABLE_SUFFIX}"
|
|
WORKING_DIRECTORY ${vax_binary_dir})
|
|
|
|
install(
|
|
CODE "
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND}
|
|
-DSRCFILE=vax${CMAKE_EXECUTABLE_SUFFIX}
|
|
-DDSTFILE=microvax3900${CMAKE_EXECUTABLE_SUFFIX}
|
|
-DWORKING_DIR=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin
|
|
-P ${CMAKE_SOURCE_DIR}/cmake/file-link-copy.cmake)"
|
|
COMPONENT vax_family)
|
|
''')
|
|
stream.write('\n')
|
|
|