Commit graph

13 commits

Author SHA1 Message Date
Richard Cornwell
1cb2f3b96c KA10: Fix divide error on KS10, add in some devices.
Fix divide of 0 on KS10 processor.
       Fix write access for auxiliary processor memory.
       Updated support new PIDP10 panel.
       Allow eight Unibux ports on the TEN device.
       Added GE DATANET-760 device to PDP6
       Removed USER mode restriction for idle detection.
       Added Data Disc 6600 Television Display System.
2024-05-21 17:06:39 -04:00
B. Scott Michel
191b2131e9 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.
2024-05-21 15:57:21 -04:00
B. Scott Michel
c47e933a60 CMake: Reduce excess quoting
cmake/cmake-builder.ps1 added quotes to arguments that contained spaces,
so that arguments printed correctly for progress output. This introduced
excess quotes that caused CMake (and likely other MS apps) confusion or
argument misinterpretation.

Instead of CMake seeing a single "Visual Studio 17 2022", CMake was
actually seeing "\"Visual Studio 17 2022\"".

This patch only adds the additional quotes when reporting progress or
emitting debug output. Otherwise, command line arguments are passed
unmolested.
2024-02-23 16:07:47 -05:00
B. Scott Michel
a275c71170 SCP: Reduce compiler warnings on LP64 platforms
(Note: Reducing compiler warnings across all, but primarily LP64
platforms, is a long term objective.)

Reduce compiler warnings on LP64 platforms (macOS, Windows) and 32-bit
builds (Win32). Prefer 'size_t' for pointer arithmetic, array indexing
and extents; 'int' hasn't been used for these purposes for many years
and across many ANSI standards. N.B. that conversions from int or int32
to size_t cause the compiler to zero-extend the value, which is
inefficient.

Refactor printf() format modifiers into sim_printf_fmts.h. Add the
SIZE_T_FMT modifier for better portability, especially on LP64 platforms
where size_t is unsigned long and sizeof(size_t) > sizeof(int).

3B2: Fix known size_t printf() format.
2024-02-01 12:51:32 -05:00
B. Scott Michel
d9d0e8bd74 CMake: Updates
Issue #294: "apple silicon build problem(s?)": If the "--flavor/-f" flag
is not specified on the command line, then complain loudly, print help
and exit. The script used to default to "Unix Makefiles".

Updates:

- Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG
  library is detected/present for screen capture support.

- Add "clang64" to the list of MinGW64 platforms for which the
  .travis/deps.sh script can install build dependencies.

- Add PThread4W_FOUND to the condition that sets async I/O for Win32
  when using vcpkg for build dependencies.

- Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to
  build 64-bit Windows executables.

- Use simulator AIO only where needed by the simulator (i.e., the
  simulator calls/uses AIO_CHECK_EVENT in sim_instr())

  - Add "USES_AIO" flag to add_simulator() to mark a simulator that
    acutally uses asynchronous I/O.

  - Build "_aio" SIMH core library variants that have AIO turned on,
    link with the "_aio" variant when a simulator sets USES_AIO.

  - Emit a warning message when WITH_ASYNC is False (CMake configuration
    option) to notify the user/developer that some functionality will be
    crippled.

  Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family,
  IMLAC and TT2500. The makefile and cmake/generate.py also updated
  to remain in sync with CMake.

  N.B.: Simulators still link with the underlying platform's threading
  library. SEL32 requires pthreads or equivalent threading library,
  independent of AIO.

- cmake/cmake-builder.sh

  - New "--no-aio" flag: Build simulators without async I/O.

  - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

- cmake/cmake-builder.ps1

  - New "-noaio" flag: Build simulators without async I/O.

  - New "-noaiointrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name
must now be an absolute path. Relative paths no longer accepted.
Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH
was first implemented.
2024-02-01 12:51:13 -05:00
B. Scott Michel
625b9e8d45 CMAKE: Python distutils obsoleted.
Python 3.12 will not have the distutils package in the standard library.
The TextFile class is particularly useful when reading [Mm]akefiles, and
recreating its functionality would be painful.

Stash a local copy of the last version of distutils.text_file.py and use
it. Do not rely on distutils being present or installed.
2023-11-28 09:51:29 -05:00
B. Scott Michel
b3465af64e CMake: cmake-builder.sh "-c" takes an argument 2023-11-28 09:47:36 -05:00
B. Scott Michel
dfda031f23 CMake: Multiple targets, clean cache
Two updates suggested by Paul Koning:

- Enable building multiple simulator targets using a comma-separated list,
  e.g.: pdp8,pdp11,3b2

- Unconditionally clean CMake's cache each time the script is invoked.
  This eliminates confusing CMake configuration messages when CMake
  changes or updates, and CMake policies change.

  The most recent policy change was IMPORT_LOCATION, which is now
  mandatory for interface libraries. An old CMake configuration cache
  doesn't reflect the import library IMPORT_LOCATION property, which
  caused confusing warning messages. The cure is removing the old cache
  and reconfiguring.
2023-11-28 09:47:36 -05:00
B. Scott Michel
06d41835fe CMake: Win XP (v141_xp) VS install script
Move the PowerShell code from .github/workflow/cmake-builds.yml into its
own script, cmake/github_v141_xp.ps1, to keep cmake-buils.yml readable.
The script also facilitates synchronizng with the Chocolatey installer's
Wait-VSIstallerProcesses function easier (from which this this code is
derived.)

cmake-builds.yml: Check the output from Get-VSSetupInstance and
Set-VSSetupInstance. Empty (or null) output indicates that the v141_xp
install did not complete successfully. Build process will bail when that
happens.

cmake/v141_xp_install.ps1: Unused and now unnecessary script.
2023-10-24 12:46:51 -04:00
Howard Bussey
8ee2b90dc4 Fix apple silicon build problems Issue #294
- find gnu-getopt when installed by homebrew in /opt
- invoke realpath only on known path components
  (needed for some realpath implementation(s))
  (relevant when build-flavor directory does not yet exist)
2023-10-09 20:15:32 -04:00
B. Scott Michel
487f243c28 CMake: Bump project version to 4.1.0
- Bump SIMH_VERSION_MINOR in CMakeLists.txt. This propagates down
  through the rest of the CMake infrastructure.

- README-CMake.md, cmake/{GitHub-release.md,cmake-builder.sh}: Update
  documentation. (Prettiness.)

- vcpkg.json: Update simh version-string. (Consistency.)

NOTE: Github CI/CD: There has to be an automated way to update version
numbers; researching.
2023-07-31 13:04:33 -04:00
B. Scott Michel
30b74dbd73 appveyor.yml build, dep lib version number updates
- Give appveyor.yml some much needed attention. Specifically, work
  around the CMake build termination when the issuing the "CMake is too
  old to produce packages" warning message. There's something funky with
  how Appveyor's runtime interacts with PowerShell and
  warning/diagnostic output ends up terminating builds unexpectedly.
  Appveyor's technical support says to write the CI/CD script using the
  old DOS CMD interpreter, not PowerShell.

- Cut down the number of builds. Older Visual Studio VM images are still
  in the appveyor.yml matrix, just commented out.

- dep-locate.cmake: Update dependency library version numbers to reflect
  recent releases for libpng16, SDL and SDL_ttf. This affects the XP
  "legacy" CMake builds on Github CI/CD, Appveyor's VS 2017 and earlier
  VM images that build the minimal SIMH dependency library support
  (i.e., environments where vcpkg is known not to work.)
2023-07-15 17:20:26 -04:00
B. Scott Michel
8b14bb69be
CMake build infrastructure II (#53)
* CMake build infrastructure

The squashed commit that builds and packages releases for the SIMH
simulator suite with CMake, version 3.14 or newer.

See README-CMake.md for documentation.
2023-05-17 20:18:42 -04:00