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.222.71 with SMTP id qk7mr5878405pbc.1.1328966164963; Sat, 11 Feb 2012 05:16:04 -0800 (PST) Path: wr5ni12377pbc.0!nntp.google.com!news2.google.com!goblin3!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail From: paramucho@hotmail.com (paramucho) Newsgroups: alt.sys.pdp11,vmsnet.pdp-11,comp.sys.dec Subject: Re: PDP11 Values from MFPT Date: Sat, 11 Feb 2012 13:15:52 GMT Organization: Aioe.org NNTP Server Message-ID: <4f396a03.27713593@nntp.aioe.org> References: <4f2e89be.49241029@nntp.aioe.org> <4f30d0d8.41682905@nntp.aioe.org> <4f313229.43518694@nntp.aioe.org> <4f37717c.29259157@nntp.aioe.org> <4f339e98.40806741@nntp.aioe.org> <4f360d68.39000374@nntp.aioe.org> Reply-To: paramucho@hotmail.com NNTP-Posting-Host: CmgvwL3sOlojnxUjt8znzA.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Forte Agent 1.5/32.451 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Fri, 10 Feb 2012 20:29:24 +0100, Johnny Billquist wrote: >>> There, now you don't have to take the word "architecture" in your mouth. >> >> Oh well, if you really want to go back there... > >I tried phrasing it to avoid the term "architecture", but still just >look at the behavior of MMR1, which can be done in several ways >(obviously), but still be "right". Yeah, but you were still using the term all over the post... >If you really want me to comment on the whole text, let me know. I'll >happily point out weaknesses in your analogies (just starting with the >fact that analogies are always problematic, as they are just that, >analogies). :-) Do whatever you want! It's no big thing... >(Oh, and that the VAX is no way as clear cut as you seem to think, or >what is your take on the vector option, or the various subsets that were >defined later on?) These are clearly architectural variations. The question then is, was a new architectural specification provided in a timely manner which clearly described the architectural variations. The "architecture" is a document and potentially a set of tests as well. It may be varied, but it is varied by an update to the architectural specification, not de facto by an unspecified modifications in some particular model. > It's incremented by four. If it wasn't my progam would crash. The PC >> itself is always incremented by the full and correct amount in these >> tests, except for those which test RTI etc. > >Aha. So I'd say that J11 in essence is doing wrong. It have updated the >PC more than just the instruction fetch, but this is not reflected in MMR1. >The processor handbooks say it should update MMR1. >So, a program that does a rollback cannot do it right with regards to >the PC, but have to use MMR2 for that. The fact there can even be a question about whether it's right or wrong indicates the lack of a clear reference architecture. This is not rocket science. >Why would your program crash if the PC wasn't incremented by 4, by the >way??? Because my code is very simple: [setup code] test instruction [report code] When the test instruction crashs the trap ISR simply registers the fact and RTI's with the C-bit and V-bit set. If the RTI PC was wrong then my test code would presumably fail. Note, the code which actually tests RTI, RETURN, JMP etc has a workaround. Of course there are better ways to do these things, but I was in a hurry and this is throw-away code... >>>> 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. >> >> But as I've said above, it's an often retrospective document. > >It was written way before the 11/93 came about. It was even written >before the 11/83 came about. I wasn't applying that book to the 11/8x or 11/9x, but to the CPUs which it described. >But I agree that it's a book that got updated after each new processor >was done, so that it held information that were relevant to the readers. I don't recall that manual being updated after each significant new CPU and I'm not even sure their was an "Architecture Handbook" which covered the 11/8x and 11/9x CPU's? BTW: there was an early architectural spec in one of Gordon Bell's books. Interestingly it has a completely different FPU instruction set and also lists a double-word instruction set. http://research.microsoft.com/en-us/um/people/gbell/Computer_Engineering/index.html Page 257 describes a floating point instruction set which is much close to FIS but also include FMOVE and FNEG. A double word instruction set is also presented: DMOVE, DADD, ..., DNEG. The operations were to be implemented with two-word instructions, the first being: "enter floating point mode and execute one instruction." The second word would have had full source and destination register specifications. I would have loved to have had the double-word ops. All the hassle we had with EIS addressing restrictions and lack of 32-bit operations. >> Architectures are not retrospective, they are working specifications >> of new implementations. The point I'm making about the PDP-11 is that >> it didn't stick to the architecture (unless you reduce the term >> "architecture" to something very fuzzy, almost aspirational). > >And I disagree. The different PDP-11s were not implemented out of a blue >sky, but did actually follow some principles defined way back in 1969. >The PDP-11 architecture. >If they didn't follow that, then the machines would not have been >usable. There is a reason why RT-11 and RSX will work on all different >PDP-11 models. They implement the same architecture. The reason that RT-11 works on all the PDP-11 models is because it contains code which manages all the architectural variations. RT-11 won't boot on a T11/SBC-11 unless you have the version of RT-11 which inserts NOPs here and there to manage the interrupt scheme. Code developed exclusively on an LSI-11 often crashs when moved to other PDP-11s because the LSI-11 does not implement odd address traps. That has always been a major drag. PDP-11 software was frequently distributed in a variety of NHD/EIS/FPU/FIS/EAE versions. I have noted in earlier posts that all PDP-11s share the same "base architecture", and that's where most of the compatibility comes from. That's not what the disagreement is about. What you call "implementation" variations are what I generally call "(model) architectural variations". >>>>> 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. >> >> I'll send you my code, although it won't help much. My C code is >> actually in a pre-processor language and the MACRO code is not >> stand-alone. But at least it will synch our efforts. > >Cool. But yeah, I'll probably rewrite the stuff in MACRO-11 then. But >it's nice if we have a common concept of what each test checks for, and >how it do it. It will be good to have alternate tests because my code may have (more) bugs. I'll send it tomorrow. SR1.R/SR1.MAC is mostly in MACRO, but relies on 40 years of MACRO libraries and personal habits. The rest of it is in a completely undocumented personal language which translates into DECUS C. I'll send the (unpretty) C code as well. >>>>>> +++++++++++++++++++++++++ >>>>>> 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) >>>>> >Not sure I understand what you are saying. >Bob states that he's not doing as the J11, yes. He instead updates MMR1 >with all PC modifications as well. So far all good. But, unless the >pushed PC for the trap also have that updated value, the contents of >MMR1 would be wrong. You need to push both the updated PC, and update >MMR1, or else do neither, to do it right. The "pushed PC for the trap" turns out to be irrelevant to the SR1 recovery process. All the information is in SR0, SR1 and SR2. MMU SR2 has the restart PC. The "pushed PC" can be thrown away. A compatible recovery process for the cases we've seen so far, except for two E11 cases, would be: 1. Use SR0 to locate the faulting page. Map it. 2. Apply all SR1 inc/decs to the appropriate saved registers. (R7 inc/decs may be made, but they will be discarded with the next step). 3. Restart the instruction at the location specified by SR2 (And this is also how the KDJ11-A manual describes the process). In TEST05 futher below SimH records the PC movement from 100000 to 100002 with [27] in SR1. J11 advances the PC, but leaves SR1 as [0]. It's a jungle. >As for "PC instructions", I assume you mean things like branching and >jumping? Any such modifications will never have taken effect on the PC >in the case of a trap. > >If you do a: > > JMP @(PC)+ > > >the MMR1 should show R7 modified by 2, and the PC on the stack should >point to the next instruction. The JMP @#ILLPTR instruction completes with PC=ILLPTR. The trap doesn't occur until the next instruction fetch (which is, of course, ILLPTR, which traps). Note SR2 in the listing below. That's the address of instruction which trapped. J11: E11: Test04: jmp @#100000 ; 100000 is the gap Before: R0=100000 SP=744 PC=3524 After: R0=100000 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=100000 TEST05: What you've described above is more like this, where half the instruction is mapped, and the other half ain't: 77776 000137 jmp @(pc)+ end of par4 (mapped) 100000 xxxxxx ;unmapped location beginning of par5 (unmapped) In the test below R0 reports the actual PC just before and after the instruction. J11 and SimH do point to the next instruction (100002 in r0). E11 doesn't. However, J11 doesn't update SR1 and SimH does. It's a wonderful world of color and variety. Operationally it's innocuous. J11: Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc Before: R0=77776 SP=744 PC=4060 After: R0=100002 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=77776 SimH: Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc Before: R0=77776 SP=744 PC=4060 After: R0=100002 SP=744 Err=250 SR0=100011 SR1=[0|27] SR2=77776 E11: Test05: jmp @#xxxxxx ; xxxxxx is in gap. r0=pc Before: R0=77776 SP=744 PC=4060 SR0=1 After: R0=100000 SP=744 Err=250 SR0=100011 SR1=[0|0] SR2=77776 >By the way, the stack and PC modifications of a MARK instruction are >also guaranteed to never have been done in case of a trap. I had looked in various "architectural" documents for information on MARK in this regard :-) Where did you find it? >> TEST16: >> However, leading on from that starting point I looked at an RTI in >> user mode. The user mode stack maps the RTI PC but not the PSW. The >> trap is taken in kernel mode of course, so the user mode stack is not >> overwritten. In this R0 records the user mode SP. >> >> SimH has a backed-out result and an unaltered user mode stack. The J11 >> upates SR1 and shows the double pop in the user mode stack. >> >> SimH: >> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped) >> Before: R0=77776 SP=744 PC=7174 >> After: R0=77776 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174 >> >> J11: >> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped) >> Before: R0=77776 SP=744 PC=7174 >> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[26|26] SR2=7174 > >Both are architecturally correct, but different. Both are "operationally compatible" if the algorithm mentioned above is followed (which effectively ignores R7 inc/decs). >> E11 gets it wrong. The stack is double-popped and, of course, there is >> no update information. >> >> E11 >> Test16: *rti ; [pc,*ps] r0 = user mode stack (unmapped) >> Before: R0=77776 SP=744 PC=7174 >> After: R0=100002 SP=744 Err=0 SR0=100151 SR1=[0|0] SR2=7174 > >Ouch. Bad. Another bug. :-) As we discussed, only if John is actually trying to implement SR1... Ian