RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » Z280 buglist (A place to compile known bugs in the Z280)
Z280 buglist [message #10180] Fri, 09 December 2022 11:14 Go to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
Ok, separate thread for this.

So, beginning with plasmo's list from an old post:
Quote:
I re-read Tilmann Reh's description of Z280 bugs (section 10 of CPU280 Software Manual):
* OUTJMP bug is associated with I/O-write with wait state. This applies to both CPU access as well as DMA access. I can confirm that without wait state in I/O-write, the CPU access is not subject to the OUTJMP bug. I have not tried I/O write with DMA so far.
* DIVUW gives wrong results.
* DMA may not release the bus after I/O write for up to 20uS. There is a software fix named "Stefan Nitschke Chaos" for that.
* CPU may have invalid carry flag when instruction is sandwiched between two EX AF,AF' instructions. That error is also influenced by whether cache is enabled or not.
I would point to one of the major users of Z280 chips, Specialix, and their firmware for their SI/XIO intelligent multiport serial cards: http://web.mit.edu/freebsd/head/sys/dev/si/si2_z280.c Perhaps an analysis of this code could yield known bugs and workarounds.



--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: Z280 buglist [message #10183 is a reply to message #10180] Thu, 15 December 2022 11:53 Go to previous messageGo to next message
hperaza is currently offline  hperaza
Messages: 68
Registered: March 2017
Member
This is my list, which includes the bugs you already mentioned:

  1. Possible cache corruption in Z80 (8-bit) bus mode (rev G of silicon): a memory read of 16-bit even-aligned data (not instruction) causes the cache to be updated inadvertently. Workaround: use Z-bus (16-bit) mode (this bug was documented by Zilog.)
  2. Burst mode memory cycle does not work as specified when in the X2 and X4 clock mode (rev G of silicon): IE signal behaves as if it were a normal memory access cycle. Workaround: use the X1 clock mode (also documented by Zilog.)
  3. There may not be a jump instruction (including call/restart) directly following an I/O write transaction which uses wait states. This is both for the CPU (OUT instruction) and the DMA (in flow-through, single-byte and burst modes). Supposedly, the problem occur for lots of wait states and not for the four wait states of the CPU280. Workaround: add an IN instruction or 4x NOPs between the two critical instructions. For the DMA, by design there can be no workaround! (Bug mentioned by Tilmann Reh, and known as the "OUTJMP" bug; I haven't been able to reproduce it on the CPU280 or Z280RC.)
  4. The DIVUW supposedly gives wrong results in certain cases, such as when bit 15 of the divisor is set; the signed DIVW is supposedly correct (mentioned also by Tilmann Reh, but no details and no examples are given, and I haven't been able to reproduce it either - testing DIVUW for all possible cases against a division routine is a very long, time-consuming test; I ran a partial test with the bit 15 of divisor set and unset using a pseudo-random number generator for dividend and divisor and found no discrepancies even after several hours of running the test.)
  5. After an I/O write the DMA sometimes will not release the bus, but stay in a wait state for as much as 20us. Workaround: refer to UZI280 release 1.02snc (bug reported by Stefan Nitschke; apparently not really a bug, but a consequence of the refresh timing register not being initialized as the register was not documented in early Zilog docs. Stefan's workaround consisted of writing a value to an I/O address that was later documented by Zilog.)
  6. One single arithmetic or logical instruction that uses the ALU sandwiched between two ex af,af' instructions causes the flags register to be copied instead of swapped, for example:
            scf
            ex      af,af'
            sub     c       ; arithmetic instruction sandwiched between 2 exaf's
            ex      af,af'  ; CY is gone!
    
    the bug depends on the code location (triggered if the starting address of the sequence is even, but not if odd) and can be influenced by enabling or disabling the cache. Workaround: add a nop after the arithmetic or logic instruction (I can reproduce this bug.)
  7. DMA linking not working properly? (Tilmann Reh also mentions it, but gives no details. Haven't tried it.)
  8. Data pushed on the stack big-endian by early chip revisions? (This was one of the earliest Z280 bug reports I came across, but it was either not true or was quickly fixed by Zilog.)
  9. M1 pin active only on RETI instructions? Haven't tried this one.
  10. The CPU pipeline is not flushed after a MMU register is changed (this is actually documented on page 7-6 of the Zilog manual.)
  11. This fails even with all the caches off and a cache flush in the middle:
            ld      hl,0    ; a ROM address
            ld      a,(hl)
            inc     (hl)
            purge
            cp      (hl)
    
    On RAM it works fine. Apparently, the CPU is keeping (hl) internally as an optimization and not flushing it. The problem can also appear when using external memory bank switching (i.e. not using the Z280 MMU). Z80 bus mode only? (Bug reported by Alan Cox.)
I've been using the Z280 for quite a long time already, and in my experience the Z280 is very stable and pleasant chip to work with (at least on the Z280RC which uses 16-bit bus mode). I've used it to develop and test RSX280, keeping the system running for days and weeks connecting from several terminals and running a dozen of tasks concurrently, exercising the MMU, I/O, DMA, timer, UART, etc. and never recorded a hardware-related bug or crash. I didn't even have to use the OUTJMP workaround anywhere. I love the new 16-bit instructions, although I miss a push/pop iop one, as saving/restoring the I/O page register on interrupt routines using ldctl consumes 4 instructions and 2 registers. My CPU280 did misbehave randomly while doing floppy I/O, but the problem resulted to be power-supply-related and vanished after I switched to a new supply; other than that, it is as stable as the Z280RC.
Re: Z280 buglist [message #10185 is a reply to message #10183] Thu, 22 December 2022 06:16 Go to previous messageGo to next message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
Hector, many thanks for the detailed answer and for all of your work on Z280 software!

Number 9 is actually documented as 'normal' behavior since Z80 peripheral chips look for the M1 and check the fetched opcode for RETI for mode 2 interrupt chaining.


--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Re: Z280 buglist [message #10193 is a reply to message #10185] Sat, 31 December 2022 00:22 Go to previous messageGo to next message
hperaza is currently offline  hperaza
Messages: 68
Registered: March 2017
Member
lowen wrote on Thu, 22 December 2022 06:16
Hector, many thanks for the detailed answer and for all of your work on Z280 software!
Thank you for reviving the interest in the Z280, and for making the CPU280 board available again! And to Plasmo, of course, whose clever ROM-less Z280RC board makes software development much easier!
Re: Z280 buglist [message #10198 is a reply to message #10193] Mon, 02 January 2023 08:25 Go to previous message
lowen is currently offline  lowen
Messages: 226
Registered: August 2016
Location: Western NC USA
Senior Member
Quote:
Thank you for reviving the interest in the Z280, and for making the CPU280 board available again! And to Plasmo, of course, whose clever ROM-less Z280RC board makes software development much easier!
Thanks, but I really was just a catalyst; Tilmann Reh deserves the credit for the design and build, and for sending me the files to do this revival.

And Plasmo's work is elegant, for sure.


--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
Previous Topic: ECB Ethernet board
Next Topic: New eZ80 Small Encased System


Current Time: Tue May 21 22:27:10 PDT 2024

Total time taken to generate the page: 0.01021 seconds