1
0
mirror of https://github.com/wfjm/w11.git synced 2026-04-26 04:08:17 +00:00

pdp11_mmu.vhd: BUGFIX: correct trap and PDR A logic

- tools/asm-11/lib/defs_mmu.mac: rename md.a??, saner names for ACF
- tcode/cpu_mmu.mac: add E1.1, test m0.trp, pdr aia/aiw transitions (verify fix)

Closes #34
Closes #33
Closes #26
Closes #25
This commit is contained in:
wfjm
2022-09-09 09:01:06 +02:00
parent fe5cb6d757
commit 1644863a58
5 changed files with 458 additions and 50 deletions

View File

@@ -36,7 +36,7 @@ The full set of tests is only run for tagged releases.
- remove Atlys support (only test designs, a w11 design was never done)
- cleanup SimH setup files (\*.scmd), use autoconfig, set disk types
- cleanup code base, use page,mmr\*,pdr,par instead of segment,ssr\*,sdr,sar
- sysid encodes now system type, allows to distingish w11,SimH,e11
- sysid encodes now system type, allows to distinguish w11,SimH,e11
- added dasm-11, a PDP-11 disassembler
### New features
- new verification codes
@@ -90,12 +90,15 @@ The full set of tests is only run for tagged releases.
- *.scmd: set sysid to 110234 --> emu Simh
- *.ecmd: set sysid to 120345 --> emu e11
### Bug Fixes
- rtl/w11a
- pdp11_mmu: BUGFIX: correct trap and PDR A logic, see
[ECO-033](ECO-033-MMU_AFC-1_PDR-A.md)
- src/librwxxtpp
- RtclRw11Cpu.cpp: quit before mem write if asm-11 error seen
- tools/asm-11/lib
- tcode_std_start.mac: fix sdreg probe code
- tools/mcode
- m9312/bootw11.mac: proper init of unit number in getnam
- src/librwxxtpp
- RtclRw11Cpu.cpp: quit before mem write if asm-11 error seen
<!-- --------------------------------------------------------------------- -->
---

View File

@@ -0,0 +1,58 @@
# ECO-033: MMU: ACF=1 trap and PDR A fix (2022-09-07)
### Scope
- was in w11a since 2009
- affects: all w11a systems
### Symptom summary
- part 1: ACF=1 traps on any access
Test 055 of `ekbee1` fails with
```
MEMORY MANAGEMENT TRAP OR ABORT HAD INCORRECT CONDITION
EXPECTD ERROR AUTOI/D VIRTUAL
CONDITN REGISTR REGISTR ADDRESS TESTNO PC AT ABORT
020011 030011 013427 054032 000055 054040
```
- part 2: `PDR` A bit is set for every access
This was discovered in a code review. The `PDR` A bit was set for
all accesses. The `PDR` A bit should be set only when
_"trap condition met by the Access Control Field (ACF)"_ is fulfilled.
Thus for
```
ACF=001 read-only trap and A bit on read
ACF=100 read/write trap and A bit on read or write
ACF=101 read/write trap and A bit on write
```
`ekbee1` only checks whether this bit is set when expected, but does
_not_ verify that is stays '0' when it should.
### Analysis
- part 1: ACF=1 traps on any access
Caused by a simple mistake in the `ACF` handling in pdp11_mmu.vhd
```vhdl
case PARPDR.acf is -- evaluate accecc control field
when "001" => -- read-only; trap on read
if CNTL.wacc='1' or CNTL.macc='1' then
abo_rdonly := '1';
end if;
dotrap := '1'; -- <== BUG, should be 'not write'
```
- part 2: PDR A bit is set for every access
Caused simplistic AIB handling in pdp11_mmu.vhd
```vhdl
if doabort = '0' then
AIB_SETA <= '1'; -- <== BUG, should be 'dotrap'
AIB_SETW <= CNTL.wacc or CNTL.macc;
end if;
```
### Fixes
- part 1: `AIB_SETA <= dotrap;`
- part 2: `dotrap := not iswrite;`
### Hindsight
Took 13 years to fix. The MMU traps and `PDR` A and W bits are 11/45 and 11/70
specific and not used by any operating system. Only tests like `ekbee1` use
this functionality.