open-simh / simh

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

PDP-8: missing commas in pdp8_clock_precalibrate_commands #342

Closed dgesswein closed 1 month ago

dgesswein commented 9 months ago

The first two entries are missing comma after the string so the first three strings get concatenated together. PDP8/pdp8_cpu.c static const char *pdp8_clock_precalibrate_commands[] = { "106 100" "-m 100 MQL MQA" "-m 101 ISZ 112", "-m 102 JMP I 106", "-m 103 JMP I 106", "PC 100", NULL};

Note that this has my added prints showing commands processed and what is stored to memory

[djg@jackdaw simh]$ make BIN/pdp8 lib paths are: /lib64/ /usr/lib64/llvm13/lib/ /usr/lib64/octave/7.3.0/ /usr/lib64/pipewire-0.3/jack/ /usr/lib64/tcl8.6/ /lib/ /usr/lib/ include paths are: /usr/lib/gcc/x86_64-redhat-linux/13/include /usr/local/include /usr/include using libm: /lib64/libm.so using librt: /lib64/librt.a using libpthread: /lib64/libpthread.a /usr/include/pthread.h using libpcre: /lib64/libpcre.so /usr/include/pcre.h using libedit: /lib64/libedit.so /usr/include/editline/readline.h using semaphore: /usr/include/semaphore.h using libdl: /lib64/libdl.a /usr/include/dlfcn.h using libpng: /lib64/libpng.so /usr/include/png.h using zlib: /lib64/libz.so /usr/include/zlib.h using mman: /usr/include/sys/mman.h


BIN/pdp8 Simulator being built with: - compiler optimizations and no debugging support. GCC Version: 13.2.1. - Building using a single compile and link. - Per simulator tests will be run.


git commit id is ee34e295117bf9f58ff294268ed49251552f0332+uncommitted-changes. git commit time is 2023-12-18T14:33:06-0500.


gcc -std=gnu99 -U__STRICT_ANSI__ -O2 -finline-functions -fgcse-after-reload -fpredictive-commoning -fipa-cp-clone -fno-unsafe-loop-optimizations -fno-strict-overflow -DSIM_GIT_COMMIT_ID=ee34e295117bf9f58ff294268ed49251552f0332+uncommitted-changes -DSIM_GIT_COMMIT_TIME=2023-12-18T14:33:06-0500 -DSIM_COMPILER="GCC Version: 13.2.1" -DSIM_BUILD_OS_VERSION="Linux jackdaw.pdp8online.com 6.6.8-100.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 21 04:01:45 UTC 2023 x86_64 GNU/Linux" -DSIM_BUILD_TOOL=simh-makefile-single-compile -I . -Werror -D_GNU_SOURCE -DHAVE_SEMAPHORE -DHAVE_SYS_IOCTL -DHAVE_LINUX_CDROM -DSIM_HAVE_DLOPEN=so -DHAVE_UTIME -DHAVE_GLOB -DHAVE_SHM_OPEN PDP8/pdp8_cpu.c PDP8/pdp8_clk.c PDP8/pdp8_df.c PDP8/pdp8_dt.c PDP8/pdp8_lp.c PDP8/pdp8_mt.c PDP8/pdp8_pt.c PDP8/pdp8_rf.c PDP8/pdp8_rk.c PDP8/pdp8_rx.c PDP8/pdp8_sys.c PDP8/pdp8_tt.c PDP8/pdp8_ttx.c PDP8/pdp8_rl.c PDP8/pdp8_tsc.c PDP8/pdp8_td.c PDP8/pdp8_ct.c PDP8/pdp8_fpp.c scp.c sim_console.c sim_fio.c sim_timer.c sim_sock.c sim_tmxr.c sim_ether.c sim_tape.c sim_disk.c sim_serial.c sim_video.c sim_imd.c sim_card.c -I ./PDP8 -o BIN/pdp8 -lm -lrt -ldl
BIN/pdp8 RegisterSanityCheck /home/djg/simh/PDP8/tests/pdp8_test.ini </dev/null Running internal register sanity checks on PDP-8 simulator. *** Good Registers in PDP-8 simulator.

PDP-8 simulator V4.0-0 Current git commit id: ee34e295+uncommitted-changes Cmd 106 100-m 100 MQL MQA-m 101 ISZ 112 Cmd -m 102 JMP I 106 dep 5506 102 Cmd -m 103 JMP I 106 dep 5506 103 Cmd PC 100 PDP-8: Basic Instruction Test (1): dep 7402 5276 passed PDP-8: Basic Instruction Test (2): dep 7402 3740 passed ** PDP-8: Adder tests: dep 7402 4561

SIMAD SIMROT FCT RANDOM

7 EXTENDED BANKS OF MEMORY TO BANK 1

PDP-8: Adder test passed after running for 1,135,381,513 instructions. PDP-8: Random AND test: passed after running for 1,136,605,769 instructions. PDP-8: Random TAD test: dep 7402 6743 passed after running for 1,139,437,712 instructions. PDP-8: Random ISZ test:

FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC FC PDP-8: Random ISZ test: passed after running for 1,221,033,810 instructions. PDP-8: Random DCA test: dep 7402 404 passed after running for 1,223,482,075 instructions.

!! All Tests Passed after running for 1,223,482,075 instructions !!

I was trying to use SIMH to determine what memory was used by programs. I was confused by addresses 0102 and 0103 being non zero when I loaded multiple programs. Finally figured out that SIMH was putting contents in memory. Code left in memory didn't match what I found in pdp8_cpu.c so investigated until I found the cause of the missing commas.

Would also be good to reset the memory back to zero after the calibration. It surprised me to find SIMH left code in memory.

markpizz commented 9 months ago

Good digging and catch.

Meanwhile, what type of memory did these systems have? Was it always guaranteed to contain 0?

sim> DEPOSIT ALL 0

should have the desired effect

dgesswein commented 9 months ago

They had core and later semiconductor memory. PDP-8's didn't clear memory at least until the VT78. That had startup diagnostics which I think do a memory test so memory set by that. The current behavior isn't really wrong which is why I used Would also be good. With most emulators memory is all zeros except for memory that needs to be set to operate so its just not matching my expectations. Yes now that I know about it working around it isn't a big deal.

On Sat, Jan 06, 2024 at 07:08:06PM -0800, Mark Pizzolato wrote:

Good digging and catch.

Meanwhile, what type of memory did these systems have? Was it always guaranteed to contain 0?

sim> DEPOSIT ALL 0

should have the desired effect

-- Reply to this email directly or view it on GitHub: https://github.com/open-simh/simh/issues/342#issuecomment-1879923221 You are receiving this because you authored the thread.

Message ID: @.***>

pkoning2 commented 1 month ago

Fix was merged. Thanks Dave and Mark!