1
0
mirror of https://github.com/prirun/p50em.git synced 2026-02-08 08:41:31 +00:00
Commit Graph

199 Commits

Author SHA1 Message Date
Jim Wilcoxson
280634b67e em.c: fix precendence bug caught by compiler
Only affects the display of keys (float exception enabled) on a fatal error.
2020-04-26 12:27:48 -04:00
Jim Wilcoxson
33f748f778 em.c: simpler iget16 and iget16t with same performance
Previously iget16 was used for all instruction fetches, with the
assumption that any could trap.  But actually, only the first word of
the instruction stream can trap in V mode, which is why these
instructions must be short.  Both words of a long R-mode instruction
can trap.

Tested change by booting R19 with and without -DFAST, all other revs
with -DFAST, and basic with trace on in R19 (this executes code from
the DFAC)
2020-04-20 16:14:03 +00:00
Jim Wilcoxson
6693ab36e2 Merge branch 'master' of https://github.com/prirun/p50em 2020-04-19 02:04:48 +00:00
Jim Wilcoxson
b3cada1dbf em.c: add a small benchmark loop to set the initial value of instpermsec
to a reasonable value.  This avoids clock anomolies during startup.
2020-04-19 01:14:15 +00:00
Dennis Boone
1d8476a807 Fix crash executing from registers during boot
In slow mode (compiled without -DFAST), Rev. 19 would crash during
boot.  On investigation, the code was branching to '4 after setting
up an instruction there.  However, instruction fetch found a '0
instead of the expected instruction.

Instructions might be fetched from registers via trap.  Fast iget16()
checks for fault.  Slow iget16() does not, and just calls get16() which
does not check.
2020-04-18 01:48:22 -04:00
Jim Wilcoxson
4a1bfefa4a Minimize clock inaccuracies during system boot
The initial estimate for instructions per millisec (instpermses) was
much too low for modern CPUs, and was also only updated every 5
seconds.  Combined, these were causing the clock to be erratic during
the first 5-15 seconds of system boot.

This was easily noticed by running the MIPS benchmark program right
after a system boot, where instead of delaying 5 seconds, it might
only delay 2 seconds, and then would report a bogus MIPS rating.
Waiting a minute and running it again would give an accurate rating.

Adjusting the instpermsec initial value from 2000 to 40000 and
IPMSTIME time from 5000 ms to 1000 ms (every second vs 5 seconds)
fixes the problem.
2020-04-18 03:11:56 +00:00
Jim Wilcoxson
cd2b4516e5 em.c: remove searchloadmap from SR-mode flow tracing
The emulator reads SEG load maps for Primos and displays symbolic
names and offsets during tracing.  But when running in S/R modes
during initial startup, there is no point in doing a load map lookup
and it's somewhat confusing to see segment 0 symbol names printed for
all effective addresses.  A blank name was already printed for
user-mode S/R traces because the segment number is > 01777, usually
04000.
2020-04-17 20:26:25 +00:00
Jim Wilcoxson
02f841d87f em.c: remove boot_tv as it's no longer used 2020-04-17 20:19:23 +00:00
Jim Wilcoxson
4561acc0b1 Revised & expanded comments about phyiscal memory
Removed comment about memory needing to be a power of 2.  Testing
-mem 9 worked fine with rev 20:

OK, stat sys

System is currently running PRIMOS rev. 20.2.8
Copyright (c) Prime Computer, Inc. 1985

9216K bytes memory in use
2020-04-16 19:47:54 +00:00
Jim Wilcoxson
d0cb6629c1 em.c: change MAXMB to DEFMB, remove MEMSIZE and MEMMASK
It was confusing that MAXMB is the default memory size, so renamed it
to DEFMB.  MEMSIZE was not necessary (half of MAXMB) and MEMMASK was
used only in mapva to limit physcal addresses when segmentation was
not enabled.  However, this appears to be a bug, because it would
cause memory addresses larger than physical memory to wrap and succeed
rather than generate a missing memory check.
2020-04-16 15:09:14 +00:00
Jim Wilcoxson
f9f77c3c99 Check if Prime RAM allocation succeeded instead of seg faulting 2020-04-13 22:00:00 +00:00
Jim Wilcoxson
932224bf0f Check -mem limit against 512, not MAXMB 2020-04-13 21:12:02 +00:00
Jim Wilcoxson
918b771dfa Remove comment about not sharing emulator source 2020-04-13 19:50:15 +00:00
Jim Wilcoxson
5ef05d79b4 Set Prime physical memory with -mem 2020-04-13 17:15:40 +00:00
Dennis Boone
087fd30e83 Make sure stderr is still unbuffered after the reopen. This is
likely unnecessary, but belt.  Suspenders.
2020-04-12 12:56:24 -04:00
Dennis Boone
527611669b Convert strcpy() calls to strncpy().
Raise the size of the symbol name variable.
2020-04-11 12:51:44 -04:00
Jim
1624437939 em: move #define to force inline to start of code 2020-03-09 22:36:26 -04:00
Jim
364792c169 Remove stopwatch-related calls and stopwatch.h stub 2020-03-09 22:30:09 -04:00
Jim
4a6a3aff5d em: add macro to force gcc to obey inline keyword
History: when the emulator was first developed on OSX 10.4 (PowerPC),
the inline keyword was added by profiling with Apple's pretty
fantastic Shark profiler.  Apple's version of gcc had an -fobey-inline
switch that the makefile used to force gcc to obey the inline keyword.
This macro does the same thing
2020-03-09 01:12:45 -04:00
Jim
9054d69446 em.c, etc: use gv.xxx instead of gvp->xxx for 13% speed increase, from
37.5 Prime MIPS on Linode VM to 42.5 MIPS.  gvp-> was faster on the
PowerPC architecture when gvp was kept in a dedicated register, but
that does not apply to Intel.

Old:

Timing CPU,  20.0 ticks per second...
  35.3 Prime MIPS for 16-bit ADD loop
  40.0 Prime MIPS for 16-bit MPY loop
  42.1 Prime MIPS for 16-bit DIV loop
  21.4 Prime MIPS for 32-bit ADD loop
  30.8 Prime MIPS for 32-bit MPY loop
  28.6 Prime MIPS for 32-bit DIV loop
  57.1 Prime MIPS for 16-bit X=0 loop
  44.4 Prime MIPS for 32-bit X=0 loop
  37.5 average Prime MIPS

New:

Timing CPU,  20.0 ticks per second...
  42.9 Prime MIPS for 16-bit ADD loop
  53.3 Prime MIPS for 16-bit MPY loop
  47.1 Prime MIPS for 16-bit DIV loop
  24.0 Prime MIPS for 32-bit ADD loop
  38.1 Prime MIPS for 32-bit MPY loop
  32.0 Prime MIPS for 32-bit DIV loop
  57.1 Prime MIPS for 16-bit X=0 loop
  44.4 Prime MIPS for 32-bit X=0 loop
  42.4 average Prime MIPS
2020-03-08 23:46:14 -04:00
Jim
c18704894f merge -naddr changes 2020-03-01 22:06:56 -05:00
Jim
73d2479dba em: comment cleanups 2020-03-01 22:02:47 -05:00
Dennis Boone
83f130aba5 devpnc.h: use global bindaddr variable instead of hardcoded INADDR_ANY.
em.c: command line option -naddr to set bind address for pnc socket.
2020-03-01 04:35:23 +00:00
Jim
9de65ca516 em: decode keys and modals in fatal error message 2020-02-25 20:11:15 -05:00
Jim
00205c830b add lights (Dennis) 2020-02-25 14:15:03 -05:00
Jim
a4cc429fad Linux cleanup to remove demo/dongle code, remove PowerPC stuff, fix slow PNC I/O, fix a nasty devmt bug 2020-02-24 23:55:03 -05:00
Jim
4061b6adc9 Changes to allow emulator to run on Linux for hosting at Linode 2019-09-25 10:56:48 -04:00
Jim
5bf0eb8362 typo 2019-07-04 11:53:04 -04:00
Jim
233ef630d4 Don't install signals with dedicated registers 2012-07-24 15:41:56 -04:00
Jim
371c051d16 em: save pid and boot file inode for security checks 2012-07-18 23:56:49 -04:00
Jim
441a3f5845 Updates after testing on PPC G4 Tiger machine (makefile changes), and
tighten secure.h a bit
2012-07-09 22:13:25 -04:00
Jim
75a4b59312 em: don't use localhost if license server DNS fails; update copyright 2012-07-02 17:15:42 -04:00
Jim
2b0bb15902 em: if instpermsec starts at 15000, CPU.TIMER.SAVE diag fails in case 4 2012-06-09 17:55:54 -04:00
Jim
e60628f2d1 Fix trace format 2011-12-14 16:50:54 -05:00
Jim
4c2594beb4 Change long to int for instruction counts 2011-12-04 11:01:14 -05:00
Jim
f1a7e6f501 -cpuid takes model numbers too, STPM stores emulator version 2011-11-24 00:10:12 -05:00
Jim
dc24f26eb1 Use registers on PPC for demo/production build, don't install sigquit,
don't use async I/O for PNC.  Signals don't work with registers enabled.
2011-11-23 15:07:45 -05:00
Jim
ad35ffb6f7 Fixed SSSN byte-swap problem 2011-11-18 15:06:47 -05:00
Jim
d30cef0848 Add -mmacosx-version-min=10.4 to PPC builds; fix trace printf's 2011-11-15 18:28:41 -05:00
Jim
83e05663cb - Replace HOBBY #ifdef with DEMO,
- Remove long integers so x86_64, where long is 8 bytes, is like i686
compile, where long is 4 bytes.
- Dont' handle xon/xoff on sys console in full duplex
- Add geom hash for DEMO emulator
- Add -mmacosx-version-min=10.4 option for DEMO emulator
- Add 1-line AMLC and 2-node PNC to DEMO emulator
2011-11-15 14:01:58 -05:00
Jim
7b2ea3828b Don't print memory contents on a fatal error. Diag CPU.TIMER causes a
fatal error in get16trap, and printing the memory contents causes a
nested fatal error.
2011-10-24 22:59:04 -04:00
Jim
5ae86cca58 bs: fix major bug in get64r: plp jimmy>date_af would fail, l command
(ld -packed -sort_name) would fail after running jimmy>lines>lines.run
2011-10-24 16:47:10 -04:00
Jim
d829b0efd9 Hey, it runs Primos again! This time on Intel. :) 2011-10-21 18:55:43 -04:00
Jim
53893d85ae bs: more changes, functions for symbolic register access, incl DMX 2011-10-20 17:23:15 -04:00
Jim
e43a2167f0 bs: flt.pt. fixes, fix ecb copy in PCL 2011-10-20 10:44:04 -04:00
Jim
7075729d8c lrs: don't try to shift 32 bits: works on PPC, fails on Intel 2011-10-20 09:42:33 -04:00
Jim
ff791c1b9c Remove bogus var from ea64v.h, add quit handler to flush trace buffers 2011-10-19 11:02:23 -04:00
Jim
ec9496ec75 bs: change add32 to a function, use get/put in callers 2011-10-18 10:43:00 -04:00
Jim
3ed4d26624 bs: change tch and tcr to functions, change callers to use get/put 2011-10-17 22:45:33 -04:00
Jim
f77c58a69b bs: remove remaining crs[] references: BI/DX/Y, I/DRX, ... 2011-10-17 22:39:30 -04:00