From: Johnny Billquist <bqt@softjar.se>
Subject: Re: PDP11 Values from MFPT
Date: Wed, 08 Feb 2012 23:29:52 +0100 [thread overview]
Message-ID: <jgut10$glf$1@Iltempo.Update.UU.SE> (raw)
In-Reply-To: <4f339e98.40806741@nntp.aioe.org>
On 2012-02-08 17:58, paramucho wrote:
> On Wed, 08 Feb 2012 17:03:02 +0100, Johnny Billquist<bqt@softjar.se>
> wrote:
>
>> On 2012-02-08 14.34, paramucho wrote:
>>> On Tue, 07 Feb 2012 17:20:06 +0100, Johnny Billquist<bqt@softjar.se>
>>> wrote:
>>>
>>> <snip>
>>>
>>> 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.
>
> Let's not go back to the "architecture" debate...we're never gonna
> agree. I've avoided the issue below with the terms "correct",
> "different" and "wrong".
Heh. Well, you can perhaps at least agree that according to the
perceived function of MMR1, E11s behavior is consistent with the idea of
how MMR1 is used, and any code written that use MMR1 will turn out the
correct result both with the E11 implementation as well as the J11
implementation, even though they behave differently in their
implementation of it.
There, now you don't have to take the word "architecture" in your mouth.
>>>> 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.
>
> It's an oxymoron.
I wouldn't call it an oxymoron, but maybe me knowledge of english fails
me here.
It would only appear (to me) that the information is stored in two
places. They should end up with the same result at the end, but this is
just a case of redundancy.
>>> 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?
>
> The PC on the stack is always updated. At present my test program
> would crash if it wasn't. That's what I need to change to test RTI
> etc.
Is the PC on the stack updated by two, or by four? That is the question.
It should always at least have been updated by two, since the
instruction fetch have always taken place. And that update is not ever
reflected in MMR1. However, the additional two, from the (PC)+, should
be recorded in MMR1, if the PC on the stack has been incremented by 4.
>>> +++++++++++++++++++++++++
>>> 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
>>> ****** ****
> <snip>
>
>> 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
> <snip>
>> 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.
>
> I found the following comment in the SimH sources tonight:
>
> According to the PDP-11 Architecture Handbook, MMR1 records all
> autoincrement and autodecrement operations, including those which
> explicitly reference the PC. For the J-11, this is only true for
> autodecrement operands, autodecrement deferred operands, and
> autoincrement destination operands that involve a write to memory.
Wow, the J11 is rather more tricky. Interesting. It can partially back
out of these things then.
The reference is the same I read about in the Processor Handbook.
The comment is helpful, since obviously Bob have checked this then (come
to think of it, wasn't he even involved in the J11 microcode
development, or was it just the FPA microcode development?). Anyway, he
possibly knows a lot about the internals of the J11.
> The simulator follows the Handbook, for simplicity.
>
> The document he's referencing is here (and I think I used to have a
> copy of it):
>
> http://www.vaxcluster.de/mambo/index.php?option=displaypage&Itemid=224&op=incl&SubMenu=&slideshow=16&directory=dec_manuals
Yes. That is the handbook that I referred to a few posts ago as well.
It's really a better source for how a PDP-11 should work (I won't call
it the architecture, since you object so much). But it leaves a lot up
to specific implementations on how to do things. Like the handling of
MMR1 in respect to backing out of changes. Which J11 takes advantage of.
Simh consiously chose to not fully simulate the J11 here.
That handbook is, by the way, just the last incarnation of the PDP-11
Processor Handbook. Unfortunately I don't have my copy where I'm sitting
(living). But if I remember right, it covers the T11, F11 and J11.
Possibly also the LSI11. It also touches on the 11/44, and I think the
11/34 and the 11/70 with friends. But most of the book is not about
specific implementations, but about the PDP-11 as such.
> So, Bob Supnik is stating here that he's not slavishly following the
> J11, so I'll just mark it "different" for the moment.
Right.
>> 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.
>
> It would be great to see if the older implementations actually do
> update PC and/or FPU instructions. What system runs on the 11/70...let
> me guess :-)
:-)
I'll need to start by just writing a small program that runs under RSX
and that presents me with the information. Once I have that up and
running, I can use it on all machines I have.
>>> +++++++++++++++++++++++++
>>> 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).
> Correction:
> Different for (PC) incs/decs (see source comment above)
>>
>> 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).
>
> The comment from the source, shown above, shows he's being generic
> rather than specific to the J11.
Right. But unless Simh then also have pushed the "correct" PC on the
stack, Simh could have a bug here, or just be different. You cannot just
mess around with MMR1 without also making sure that the registers as
such have the correct values, with respect to MMR1 and state before the
trap.
>>> 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.
>
> But, again, I think he's being "generic". It makes sense with this
> functionality which is never used.
Yes. But it means his simulation of a J11 is faulty. It does not behave
like a J11. But since nothing actually normally use this, it has not
really been a problem. Furthermore, Simh's implementation is not wrong.
It's just different than J11.
>>> (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.
>
> However, there's nothing left on the SimH list now.
>
>>> 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...)
>
> I was thinking of an RTI on a good stack but where the popped PC/PSW
> in fact point to unmapped memory. That would be quite common when the
> kernel returns to user mode. The MMU trap will occur on the kernel
> stack...but that trap should overwrite the popped PC/PSW...
Um. The MMU will (as always) push the information on the kernel stack,
but it should not be any different from if your code just happens to run
off memory into non-existent memory in a straight program flow.
The RTI should not make any difference here, as far as I can tell. The
instruction fetch will trap. The updated PC should be pushed on the
kernel stack, and MMR1 should be 0.
Of course the old PC,PSW will be overwritten by the new. The old were
popped off the stack, and the data is dead. Then new data is pushed on
to the stack.
> (I have been thinking about double traps as well, but not a lot).
It's bad. :-)
>>> 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.
>
> I have to rewrite the app a little. Tonight I was doing other stuff
> (getting MicroPower Pascal off the floppies).
Saw that. Nice work.
>>> o More instruction tests
>>
>> Always. :-)
>
> I forgot one:
>
> o Find out more about the E11 commands SET CPU NOFPBACKOUT and SET CPU
> SR1.
Ah, yes. Those are still mysterious.
Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
next prev parent reply other threads:[~2012-02-08 22:29 UTC|newest]
Thread overview: 222+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-15 14:37 PDP11 Values from MFPT Jerome H. Fine
2012-01-18 6:03 ` paramucho
2012-01-18 11:28 ` Johnny Billquist
2012-01-18 13:05 ` glen herrmannsfeldt
2012-01-18 13:26 ` Johnny Billquist
2012-01-26 3:24 ` Jerome H. Fine
2012-01-26 13:38 ` Johnny Billquist
2012-01-29 1:32 ` Jerome H. Fine
2012-01-29 1:43 ` Johnny Billquist
2012-01-26 3:23 ` Jerome H. Fine
2012-01-18 16:02 ` paramucho
2012-01-18 18:12 ` Johnny Billquist
2012-01-19 14:30 ` paramucho
2012-01-19 16:42 ` Johnny Billquist
2012-01-19 20:32 ` glen herrmannsfeldt
2012-01-20 13:32 ` paramucho
2012-01-20 13:29 ` paramucho
2012-01-20 16:48 ` Johnny Billquist
2012-01-21 12:25 ` paramucho
2012-01-21 20:15 ` Johnny Billquist
2012-01-26 3:25 ` Jerome H. Fine
2012-01-26 6:09 ` paramucho
2012-01-26 6:30 ` paramucho
2012-01-26 13:50 ` Johnny Billquist
2012-01-29 1:52 ` Jerome H. Fine
2012-01-29 2:08 ` Johnny Billquist
2012-01-26 13:48 ` Johnny Billquist
2012-01-26 13:46 ` Johnny Billquist
2012-01-29 1:35 ` Jerome H. Fine
2012-01-18 12:41 ` glen herrmannsfeldt
2012-01-18 13:18 ` Johnny Billquist
2012-01-18 14:28 ` glen herrmannsfeldt
2012-01-18 15:14 ` Johnny Billquist
2012-01-18 21:54 ` glen herrmannsfeldt
2012-01-18 22:32 ` Al Kossow
2012-01-19 0:22 ` Johnny Billquist
2012-01-19 1:30 ` glen herrmannsfeldt
2012-01-19 14:32 ` Bob Koehler
2012-01-19 16:45 ` Johnny Billquist
2012-01-20 17:55 ` Bob Koehler
2012-01-20 18:38 ` Bill Gunshannon
2012-01-18 16:25 ` paramucho
2012-01-18 18:00 ` Johnny Billquist
2012-01-19 14:25 ` paramucho
2012-01-19 16:50 ` Johnny Billquist
2012-01-20 13:32 ` paramucho
2012-01-20 16:54 ` Johnny Billquist
2012-01-21 13:16 ` paramucho
2012-01-21 13:58 ` Bob Eager
2012-01-21 20:02 ` Johnny Billquist
2012-01-22 11:59 ` Johnny Billquist
2012-01-22 14:03 ` paramucho
2012-01-22 16:15 ` Johnny Billquist
2012-01-23 4:14 ` paramucho
2012-01-18 13:20 ` Bob Eager
2012-01-19 14:29 ` Bob Koehler
2012-01-21 12:44 ` Tim Shoppa
2012-01-21 13:50 ` paramucho
2012-01-22 16:56 ` Tim Shoppa
2012-01-22 18:11 ` glen herrmannsfeldt
2012-01-23 3:52 ` paramucho
2012-01-21 14:25 ` glen herrmannsfeldt
2012-01-21 16:46 ` Bob Eager
2012-01-25 22:12 ` Tim Shoppa
2012-01-26 3:22 ` Jerome H. Fine
2012-01-26 13:46 ` paramucho
2012-01-29 1:34 ` Jerome H. Fine
2012-01-29 15:46 ` paramucho
2012-02-01 3:53 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2012-02-01 11:48 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-01 14:43 ` stan
2012-02-01 16:37 ` paramucho
2012-02-01 18:05 ` stan
2012-02-02 2:24 ` Jerome H. Fine
2012-02-02 0:14 ` Johnny Billquist
2012-02-02 2:25 ` Jerome H. Fine
2012-02-02 9:29 ` Johnny Billquist
2012-02-02 18:52 ` glen herrmannsfeldt
2012-02-03 0:12 ` Johnny Billquist
2012-02-03 4:07 ` Jerome H. Fine
2012-02-03 14:15 ` Johnny Billquist
2012-02-03 15:00 ` paramucho
2012-02-02 13:31 ` paramucho
2012-02-02 19:07 ` glen herrmannsfeldt
2012-02-03 0:16 ` Johnny Billquist
2012-02-03 4:23 ` glen herrmannsfeldt
2012-02-03 12:01 ` Johnny Billquist
2012-02-03 15:36 ` Joe Oswald
2012-02-07 10:46 ` Johnny Billquist
2012-02-03 4:29 ` Jerome H. Fine
2012-02-03 12:50 ` Bill Gunshannon
2012-02-04 8:42 ` Charles Richmond
2012-02-04 13:38 ` paramucho
2012-02-04 16:03 ` Bill Gunshannon
2012-02-04 16:39 ` paramucho
2012-02-03 10:48 ` paramucho
2012-02-03 11:24 ` Johnny Billquist
2012-02-04 17:06 ` paramucho
2012-02-04 18:22 ` paramucho
2012-02-04 18:55 ` Johnny Billquist
2012-02-04 19:13 ` Bill Gunshannon
2012-02-05 13:28 ` Johnny Billquist
2012-02-05 18:15 ` glen herrmannsfeldt
2012-02-04 18:51 ` Johnny Billquist
2012-02-04 23:09 ` glen herrmannsfeldt
2012-02-05 14:01 ` paramucho
2012-02-05 15:31 ` Johnny Billquist
2012-02-06 13:50 ` paramucho
2012-02-06 14:45 ` Johnny Billquist
2012-02-06 14:58 ` paramucho
2012-02-06 16:25 ` Johnny Billquist
2012-02-05 14:27 ` Johnny Billquist
2012-02-05 13:57 ` paramucho
2012-02-05 15:44 ` Johnny Billquist
2012-02-06 13:51 ` paramucho
2012-02-06 14:56 ` Johnny Billquist
2012-02-06 16:40 ` Johnny Billquist
2012-02-07 14:50 ` paramucho
2012-02-07 16:20 ` Johnny Billquist
2012-02-08 13:34 ` paramucho
2012-02-08 16:03 ` Johnny Billquist
2012-02-08 16:58 ` paramucho
2012-02-08 22:29 ` Johnny Billquist [this message]
2012-02-10 13:12 ` paramucho
2012-02-10 19:20 ` glen herrmannsfeldt
2012-02-11 13:12 ` paramucho
2012-02-11 20:06 ` glen herrmannsfeldt
2012-02-11 20:23 ` Johnny Billquist
2012-02-10 19:29 ` Johnny Billquist
2012-02-11 13:15 ` paramucho
2012-02-11 21:09 ` Johnny Billquist
2012-02-12 17:23 ` paramucho
2012-02-12 18:35 ` paramucho
2012-02-13 17:30 ` paramucho
2012-02-14 13:14 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:30 ` Johnny Billquist
2012-02-13 23:18 ` Johnny Billquist
2012-02-14 16:20 ` paramucho
2012-02-14 17:47 ` Johnny Billquist
2012-02-14 18:17 ` paramucho
2012-02-14 19:54 ` Johnny Billquist
2012-02-15 12:58 ` paramucho
2012-02-15 17:12 ` Johnny Billquist
2012-02-16 13:54 ` paramucho
2012-02-16 20:15 ` Johnny Billquist
2012-02-17 12:41 ` paramucho
2012-02-17 17:13 ` Johnny Billquist
2012-02-18 11:24 ` Johnny Billquist
2012-02-18 14:28 ` paramucho
2012-02-18 20:07 ` Johnny Billquist
2012-02-18 11:55 ` paramucho
2012-02-18 20:58 ` Johnny Billquist
2012-02-20 2:29 ` Jerome H. Fine
2012-02-20 5:54 ` paramucho
2012-02-20 17:14 ` Jerome H. Fine
2012-02-20 18:05 ` Johnny Billquist
2012-02-21 6:16 ` paramucho
2012-02-21 17:38 ` Jerome H. Fine
2012-02-21 19:31 ` Johnny Billquist
2012-02-20 5:53 ` paramucho
2012-02-20 10:28 ` Johnny Billquist
2012-02-21 3:33 ` Jerome H. Fine
2012-02-21 6:17 ` paramucho
2012-02-21 10:23 ` Johnny Billquist
2012-02-21 11:37 ` paramucho
2012-02-21 14:16 ` Johnny Billquist
2012-02-21 16:42 ` paramucho
2012-02-21 19:43 ` Johnny Billquist
2012-02-22 12:21 ` paramucho
2012-02-22 14:12 ` paramucho
2012-02-22 15:26 ` Johnny Billquist
2012-02-22 14:33 ` paramucho
2012-02-22 15:53 ` Johnny Billquist
2012-02-22 16:48 ` paramucho
2012-02-22 21:17 ` Johnny Billquist
2012-02-23 12:42 ` paramucho
2012-02-23 13:51 ` paramucho
2012-02-23 15:17 ` Johnny Billquist
2012-02-20 2:22 ` Jerome H. Fine
2012-02-20 6:07 ` paramucho
2012-02-21 3:29 ` Jerome H. Fine
2012-02-21 8:06 ` paramucho
2012-02-21 10:38 ` Johnny Billquist
2012-02-21 11:54 ` paramucho
2012-02-21 14:20 ` Johnny Billquist
2012-02-21 15:13 ` paramucho
2012-02-21 15:20 ` Johnny Billquist
2012-02-22 2:51 ` Jerome H. Fine
2012-02-22 6:37 ` paramucho
2012-01-18 11:20 ` Johnny Billquist
2012-01-26 3:21 ` Jerome H. Fine
2012-01-26 14:12 ` Johnny Billquist
2012-01-26 15:26 ` paramucho
2012-01-29 1:41 ` Jerome H. Fine
2012-01-29 2:04 ` Johnny Billquist
2012-01-29 2:31 ` Johnny Billquist
2012-01-29 1:39 ` Jerome H. Fine
2012-01-29 1:45 ` Johnny Billquist
2012-01-30 2:21 ` Bob Supnik
2012-01-31 7:14 ` paramucho
2012-01-31 9:42 ` Johnny Billquist
2012-01-31 14:24 ` Bill Gunshannon
2012-01-31 20:17 ` Johnny Billquist
2012-01-31 21:39 ` Bill Gunshannon
2012-01-31 23:43 ` glen herrmannsfeldt
2012-02-01 3:56 ` Jerome H. Fine
2012-02-01 11:53 ` Johnny Billquist
2012-02-01 13:48 ` paramucho
2012-02-02 0:20 ` Johnny Billquist
2012-02-02 2:22 ` Jerome H. Fine
2012-02-01 12:14 ` Johnny Billquist
2012-02-01 16:27 ` glen herrmannsfeldt
2012-02-01 5:28 ` Charles Richmond
2012-02-01 11:54 ` Johnny Billquist
2012-02-01 3:55 ` Jerome H. Fine
2012-02-01 11:22 ` paramucho
2012-02-01 12:03 ` Johnny Billquist
2012-02-01 3:54 ` Jerome H. Fine
2012-02-01 12:09 ` Johnny Billquist
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox