forked from open-simh/simh
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IBM 1130: GUI resource file, RegSanityCheck fix
- Add the missing ibm1130.rc GUI resource file to the Windows build so that the GUI renders correctly. - 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. - Ibm1130/ibm1130_cr.c - Fix printf() warnings (format should be long, not int) - Signed/unsigned mismatch, size_t for array indexing - Comment out the unused trim() function. - Ibm1130/ibm1130_cpu.c, ibm1130_gui.c: Remove undefined static functions.
- Loading branch information
Showing
10 changed files
with
79 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
## IBM 1130 simulator customizations: | ||
## | ||
## - Add the Win32 resource file for Windows builds | ||
## - Add the "-g" test flag to bypass/disable the simulator GUI when | ||
## running RegisterSanityCheck test. | ||
import simgen.basic_simulator as SBS | ||
|
||
class IBM1130Simulator(SBS.SIMHBasicSimulator): | ||
'''The IBM650 simulator creates relatively deep stacks, which will fail on Windows. | ||
Adjust target simulator link flags to provide a 8M stack, similar to Linux. | ||
''' | ||
def __init__(self, sim_name, dir_macro, test_name, buildrom): | ||
super().__init__(sim_name, dir_macro, test_name, buildrom, test_args="-g") | ||
|
||
def write_simulator(self, stream, indent, test_label='ibm650'): | ||
super().write_simulator(stream, indent, test_label) | ||
stream.write('\n'.join([ | ||
'', | ||
'if (WIN32)', | ||
' ## Add GUI support, compile in resources:', | ||
' target_compile_definitions(ibm1130 PRIVATE GUI_SUPPORT)', | ||
' target_sources(ibm1130 PRIVATE ibm1130.rc)', | ||
'endif()', | ||
'', | ||
'# IBM 1130 utilities:', | ||
'# add_subdirectory(utils)', | ||
'' | ||
])) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters