From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Thread: fdd80,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Thread: 1164f8,5cdb0c1dbaceb85b X-Google-NewGroupId: yes X-Google-Attributes: gide311f70d09,gidd180ab3bd8,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.231.202 with SMTP id ti10mr3518312pbc.5.1328716983852; Wed, 08 Feb 2012 08:03:03 -0800 (PST) Path: wr5ni1705pbc.0!nntp.google.com!news2.google.com!goblin2!goblin.stu.neva.ru!news.stack.nl!newsfeed.Update.UU.SE!news.Update.UU.SE!not-for-mail From: Johnny Billquist Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Wed, 08 Feb 2012 17:03:02 +0100 Organization: Update Computer Club Message-ID: References: <4f2a3a1e.28631752@nntp.aioe.org> <4f2a8c5a.52418379@nntp.aioe.org> <4f2e5f77.65538828@nntp.aioe.org> <4f2e89be.49241029@nntp.aioe.org> <4f30d0d8.41682905@nntp.aioe.org> <4f313229.43518694@nntp.aioe.org> <4f37717c.29259157@nntp.aioe.org> NNTP-Posting-Host: 2620:0:105f:b:462a:60ff:fefb:aad8 Mime-Version: 1.0 X-Trace: Iltempo.Update.UU.SE 1328716982 7848 2620:0:105f:b:462a:60ff:fefb:aad8 (8 Feb 2012 16:03:02 GMT) X-Complaints-To: newsmaster@Update.UU.SE NNTP-Posting-Date: Wed, 8 Feb 2012 16:03:02 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: <4f37717c.29259157@nntp.aioe.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-02-08 14.34, paramucho wrote: > On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist > wrote: > > > > I've updated the previous tests with J11 status: > >>> TEST0: >>> In the first test, TEST00, we expect the trap to occur after after the >>> source field. R0 should have advanced by 2 and the low byte of SR1 >>> should hold "20", meaning R0 has been incremented by two. >>> >>> SIMH: >>> Test00: mov *(r0)+,(r0)+ >>> Before: R0=120000 SP=744 PC=2064 >>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=2064 > J11 is the same as SimH > >>> E11: >>> Test00: mov *(r0)+,(r0)+ >>> Before: R0=120000 SP=744 PC=2064 >>> After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2064 >>> >>> As you can see E11 doesn't increment R0 and leaves SR1 null. So E11 does not behave like the J11, even when asked to, in this case. But it does work correctly according to the architecture. >>> TEST01: >>> In TEST02 the trap occurs on the destination field. SimH is expected >>> to advance R0 by 4, as shown by the [20|20] SR1. >>> >>> SIMH: >>> Test01: mov (r0)+,*(r0)+ >>> Before: R0=117776 SP=744 PC=2266 >>> After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|20] SR2=2266 > J11 is the same as SimH > >>> E11: >>> Test01: mov (r0)+,*(r0)+ >>> Before: R0=117776 SP=744 PC=2266 >>> After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=2266 >>> >>> E11 backs the instruction out. Same comment as for TEST00 >>> TEST02: >>> This test is much the same as TEST00 and shows that MTPx doesn't push >>> anything on the stack in case of an error. >>> >>> SIMH: >>> Test02: mfpi *(r0)+ >>> Before: R0=120000 SP=744 PC=2462 >>> After: R0=120002 SP=744 Err=1 SR0=100153 SR1=[0|20] SR2=2462 > J11 is the same as SimH > >>> E11: >>> Test02: mfpi *(r0)+ >>> Before: R0=120000 SP=744 PC=2462 >>> After: R0=120000 SP=744 Err=1 SR0=100153 SR1=[0|0] SR2=2462 Same comment as for TEST00 >>> TEST03: >>> I was thinking about SR1 tests while was out riding my bike in circles >>> this evening, and I thought, the most likely place that the E11 tactic >>> would fail with be with MFPx/MTPx. And that's what happens with MTPI. >>> >>> SimH correctly shows that both R0 and SP have been incremented with >>> [20|26]. E11 backs R0 out, but fails to backout SP (it should be 744, >>> not 746). It's a bug, but probably easily fixed. >>> >>> SIMH: >>> Test03: mtpi *(r0)+ >>> Before: R0=120000 SP=744 PC=2700 >>> After: R0=120002 SP=746 Err=1 SR0=100153 SR1=[20|26] SR2=2700 > J11 is the same as SimH > >>> E11: >>> Test03: mtpi *(r0)+ >>> Before: R0=120000 SP=744 PC=2700 >>> After: R0=120000 SP=746 Err=1 SR0=100153 SR1=[0|0] SR2=2700 > E11 is really wrong. > Right. A real bug here. >> Other interesting tests: >> >> MOV (PC)+,(R0)+ >> >> where R0 points to invalid memory. Should affect PC (or back it out), as >> well as R0. > > In fact modifications of PC should not appear in SR1 at all and that's > because the instruction itself is always restarted from the beginning. Not necessarily. The 11/44 and 11/70 (according to the manuals) will update SR1 with modifications to the PC as well (page 164 in the processor handbook for those models). The text says: "MMR1 records any autoincrement/decrement of the general purpose registers, including explicit references through the PC." However, I'm not sure what the point of that is, since MMR2 will hold the PC at the start of the instruction anyway, so you don't really need to adjust the PC anyway. > SimH gets this wrong: > > J11: > Test06: mov (pc)+,*(r0)+ > Before: R0=120000 SP=744 PC=4166 > After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=4166 > **** J11 would appear to work differently than the 11/44 or 11/70. What is the saved PC on the stack at this point? Has it been updated or not? > SimH: > Test06: mov (pc)+,*(r0)+ > Before: R0=120000 SP=744 PC=4166 SR0=153 > After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[20|27] SR2=4166 > SimH is wrong! ***** Definitely wrong if it tries to act like a J11. Perhaps not wrong for some other CPU models. > This is a generic SimH difference which is easily fixed. It's probably > just a matter of modifying calc_MMR1 to exclude R7 (something like: > (((val)&7)==7)? (MMR1):... Possibly. But it needs to be different depending on which CPU model you are trying to simulate. > E11 is as expected. > > E11: > Test06: mov (pc)+,*(r0)+ > Before: R0=120000 SP=744 PC=4176 SR0=1 > After: R0=120000 SP=744 Err=250 SR0=100013 SR1=[0|0] SR2=4176 E11 backs all out, yup. > +++++++++++++++++++++++++ > TEST07: > TEST08: > TEST09: > TEST10: >> Also, something like the LDD instruction (FPP) could be used to check >> for other increments, like 4 and 8, which should also be possible, as >> well as partials perhaps, if the argument pointed to is partially >> outside of valid memory. > > I'll deal with the four variations of this test together: single and > double precision with the error at the start of the data area or > halfway through it. > > SimH treats FPU instructions as it does the base instruction set as > shown below: SR1 has the modifications made to R0 in SR1 in all cases > below. > > SimH: > Test07: ldf (r0)+,%0 ; 32-bit > Before: R0=120000 SP=744 PC=4444 SR0=13 > After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4444 > ****** **** > > Test08: ldf (r0)+,%0 ; 32-bit > Before: R0=117776 SP=744 PC=4722 SR0=13 > After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|40] SR2=4722 > ****** **** > > Test09: ldf (r0)+,%0 ; 64-bit > Before: R0=120000 SP=744 PC=5200 SR0=13 > After: R0=120010 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5200 > ****** ***** > > Test10: ldd (r0)+,%0 ; 64-bit > Before: R0=117774 SP=744 PC=5460 SR0=13 > After: R0=120004 SP=744 Err=1 SR0=100013 SR1=[0|100] SR2=5460 > ****** ***** That looked very reasonable. > However, the J11 FPU doesn't use SR1 to record register modifications. > Instead, it acts more like E11, backing out the registers instead (or > , more likely, not updating them until all accesses are complete). > > Thus, SimH is *different* on all the above tests. The fix here is more > extensive, but the FPU source module is considerably easier to work > with the main CPU module. It's probably a matter of using the internal > MMR1 information to backout the registers. > > J11 and E11: > Test07: ldf (r0)+,%0 ; 32-bit > Before: R0=120000 SP=744 PC=4444 SR0=13 > After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4444 > ****** *** > Test08: ldf (r0)+,%0 ; 32-bit > Before: R0=117776 SP=744 PC=4722 SR0=13 > After: R0=117776 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=4722 > ****** *** > Test09: ldf (r0)+,%0 ; 64-bit > Before: R0=120000 SP=744 PC=5200 SR0=13 > After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5200 > ****** *** > Test10: ldd (r0)+,%0 ; 64-bit > Before: R0=117774 SP=744 PC=5460 SR0=13 > After: R0=177774 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=5460 > ****** *** Interesting. > This J11 behavior may well be undocumented. There's no guarantee that > this behavior is the same with earlier FPU implementations. We'd need > an 11/45, and 11/40, an 11/34 etc to test that. Definitely. Also, it would be interesting to see if J11 behaves the same with and without the FPA. I can (eventually) set up to test this on a real 11/70. > +++++++++++++++++++++++++ > TEST13: > The FPU result also suggests that EIS and CIS tests be done (I don't > have CIS). This EIS test has identical results on J11 and SimH. CIS - That would mean either 11/23, 11/24 or 11/44, as those were the only ones to even have that option. But they were not common... Tricky to test in other words. > J11/SimH: > Test13: mul (r0)+,r2 > Before: R0=120000 SP=744 PC=6306 SR0=13 > After: R0=120002 SP=744 Err=1 SR0=100013 SR1=[0|20] SR2=6306 > > And has the expected backed-out E11 result: > > E11: > Test13: mul (r0)+,r2 > Before: R0=120000 SP=744 PC=6306 SR0=1 > After: R0=120000 SP=744 Err=1 SR0=100013 SR1=[0|0] SR2=6306 Yeah. Same as for the basic tests. Same comment as TEST00 > +++++++++++++++++++++++++ > TEST12: > TEST14: > I thought it would be useful to compare bus errors (traps to 4) with > MMU errors (traps to 250). In fact, the R0 register outcomes look to > be the same for both MMU and BUS errors. > > Note: the displayed value "Err" now holds the vector address, i.e. 4 > or 250. > > J11/SimH: > Test12: ldd (r0)+,%0 ; bus error > Before: R0=160000 SP=744 PC=6336 SR0=13 > After: R0=160010 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722 > > Test14: tst (r0)+ ; bus error > Before: R0=160000 SP=744 PC=7060 SR0=13 > After: R0=160002 SP=744 Err=4 SR0=13 SR1=[0|0] SR2=1722 > > E11: > Test12: ldd (r0)+,%0 ; bus error > Before: R0=160000 SP=744 PC=6336 SR0=1 > After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722 > > Test14: tst (r0)+ ; bus error > Before: R0=160000 SP=744 PC=7060 SR0=1 > After: R0=160000 SP=744 Err=4 SR0=1 SR1=[0|0] SR2=1722 Does not look like the MMR registers are being used at all for bus errors, which in fact is not surprising. > +++++++++++++++++++++++++ > Summary: > > It's all a bit higgledy-piggledy above, so I'll summarise, using the > J11 behavior as the benchmark, where: > > "Correct" means the same as the J11 > > "Different" means not the same, but still functional. > You may willing to accept these. I'm less so inclined. > > "Wrong" means a real bug (marked with ****). > > 1. Base and EIS instruction sets. > SimH: Correct on all, except, > **** Wrong for (PC) inc/dec's which should be ignored > (because instruction restarts). I'm not it should be classified as a bug. It depends on what the PC pushed on the stack looks like. It might be fully correct, but not the same as J11 (see other comments about this above). > E11: Different on all because it backs modifications out. > **** Wrong for MTPI because it doesn't backout the stack pop. Right. That's a clear bug. > 2. FPU instruction set. > SimH: Different on all because it doesn't back inc/dec's out. > E11: Correct on all (more by chance than design though :). SimH is different to the J11, yes. > (And, yes, to those who've asked before, I will inform Bob Supnik and > John Wilson about these differences (in the fullness of time when the > list is completed.)) Cool. > Going forward (sometime): > > o I still need to do some tests with RTS Rn and RTI. A slight > redesign of the utility is required for that. RTI? I could see potential for RTS as well as JSR, if the SP points to invalid memory. But RTI... Hmm... Am I thinking wrong here. But that could only come from a broken kernel SP, and a trap will then become a double trap, since you can't trap for the error without a stack. Or what am I missing? (Too tired to think more...) > o I need to extend the testbed to also capture PSW NZVC flags before > and after instructions. Clearly ADC, ROL etc will fail if the > condition codes are not preserved. I don't expect errors, but, to > quote W.C. Fields, (or was it Fats Waller) one never knows, does > one. After, you have them on the stack. Before, just do a MFPS. > o More comparison between bus errors and page errors is needed. Not sure why. You tests above all clearly showed that at bus errors, no MMR registers are involved anyway. > o More instruction tests Always. :-) > (I should explain that my interest in these tests comes from the > desire to actually utilize the SR1 paging facility at some time down > the track. I'm not just interested here in seeing if SimH and E11 are > compatible with the hardware, I'm also interested in seeing if the J11 > functionality has bugs in it, 'cos if it does I may as well not waste > my precious time). Me interested too. :-) Johnny