open-simh / simh

The Open SIMH simulators package
https://opensimh.org/
Other
487 stars 93 forks source link

Adding support for PDP- Major States within the CPU. #434

Open poetnerd opened 2 weeks ago

poetnerd commented 2 weeks ago

PDP-8 simulator Open SIMH V4.1-0 Current Simulator Framework Capabilities: 32b data 32b addresses no Ethernet Idle/Throttling support is available Virtual Hard Disk (VHD) support RAW disk and CD/DVD ROM support Asynchronous I/O support (Lock free asynchronous event queue) Asynchronous Clock support FrontPanel API Version 12 Host Platform: Compiler: GCC Apple LLVM 15.0.0 (clang-1500.1.0.2.5) Simulator Compiled as C (Release Build) on May 19 2024 at 13:01:35 Build Tool: autosetup+gmake Memory Access: Little Endian Memory Pointer Size: 64 bits Large File (>2GB) support SDL Video support: No Video Support No RegEx support for EXPECT commands OS clock resolution: 1ms Time taken by msleep(1): 1ms OS: Darwin Mac-mini.lan 22.6.0 Darwin Kernel Version 22.6.0: Mon Feb 19 19:43:13 PST 2024; root:xnu-8796.141.3.704.6~1/RELEASE_ARM64_T6020 arm64 Processor Name: Apple M2 Pro tar tool: bsdtar 3.5.3 - libarchive 3.5.3 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 curl tool: curl 8.5.0 (aarch64-apple-darwin22.6.0) libcurl/8.5.0 OpenSSL/3.2.1 zlib/1.3.1 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.7 libpsl/0.21.2 (+libidn2/2.3.4) nghttp2/1.58.0 git commit id: https://github.com/open-simh/simh/commit/ffe537a621d36bcf2e4d63b8b9ac3163929b57a9 git commit time: 2024-02-20T18:20:13-08:00

We successfully build from source cloned from https://github.com/open-simh/simh.git

No problems encountered.

We propose internal changes to PDP8/pdp_8cpu.c to allow emulation of the Fetch/Defer/Execute major states which the PiDP-8/i hardware would be able to display, and control through the SING STEP front panel switch.

markpizz commented 2 weeks ago

I will be glad to take your changes and include it in the https://github.com/simh/simh repo. In all likelyhood, the results could then also be migrated to the https://github.com/open-simh/simh repo.

eschaton commented 1 week ago

I think the best thing to do here would be to:

  1. Ensure your fork is rebased atop the latest Open SIMH, to remove any merge noise from its history;
  2. Adjust/consolidate the commits in your fork to represent logical steps that can be easily reviewed; and,
  3. Create one or more PRs against Open SIMH here to bring your changes into the main line of SIMH development.

People with personal forks can then pull your changes into them from Open SIMH, even before any PRs are merged if they want.

It would also probably be worth considering whether and how it would be possible to make the Major State simulation functionality optional (whether at build time or run time), in case anyone really does want PDP-8 simulation to run as fast as possible and doesn't need Major State support.

poetnerd commented 1 week ago

Thanks for the guidance, Chris.

The dev team is discussing the various trade-offs. At issue is that, as currently conceived, the inner loop of instruction execution changes in a fundamental way. So the way you turn it on or off is to basically switch between two fundamentally incompatible interpreter loops.

The simple way through, at this point, is to switch to Major State accurate, and take the 50% performance hit.

That said, we're going round once more to think if we can find some clever way to do allow switching between both in such a way as to minimize code bloat, and maximize performance.