Home » RBC Forums » General Discussion » TinyZZ, a Z280 SBC (Exploring Z280)
|
|
Re: TinyZZ, a Z280 SBC [message #4464 is a reply to message #4458] |
Mon, 19 March 2018 10:09   |
 |
lowen
Messages: 226 Registered: August 2016 Location: Western NC USA
|
Senior Member |
|
|
plasmo wrote on Sun, 18 March 2018 14:56I can observe the exaf bug on my machine. Using a test code based on hperaza's 2nd example, my hardware will get identical F, F' if the first ex af,af' instruction is located on an even address. I wrote a program that relocates the test code by one byte every iteration; and the error occurs every other iteration. What's interesting is that to observe the problem, the test code must not be in the cache. If the test code is in the cache, the error will occur every time regardless of the location. To flush the test code out of the cache, I'd call a routine that has more than 256 NOP before returning to the test code again.
You can also disable the cache for instructions for testing. I would find it interesting to make sure that register A is also being exchanged not copied if the first ex af,af' is on an odd address; if an internal data bus collision is occurring for F and F' on even, I would be suspicious of A and A' on odd. Ken Shirriff's blog has a great discussion of the Z80's register implementation at the silicon level; I would suspect the Z280, even though it's CMOS and not NMOS, might use some of the same features. His blog entry is http://www.righto.com/2014/10/how-z80s-registers-are-impleme nted-down.html
Quote:
One difference between my hardware and Tilmann Reh's CPU280 is that I've not implemented the burst mode memory transaction.
I was going to ask if you were using burst mode.
It is very nice to see some of these bugs being investigated again, and one (delay after DMA) being put to rest as 'not a bug' instead. Nice!
Oh, almost forgot:
plasmo wrote on Fri, 16 March 2018 08:59...
CPU280 have DRAM as well, so it must have a different way of refreshing the memory and not relying on the internal refresh counter.
CPU280 doesn't use the refresh counter as far as I know, but uses CAS-before-RAS refresh. This isn't well documented in the English manual; the German Hardware Handbuch shows the timing diagrams on page 22 (PDF page number).
--
Bughlt: Sckmud
Shut her down Scotty, she's sucking mud again!
[Updated on: Mon, 19 March 2018 12:15] Report message to a moderator
|
|
|
|
|
|
Re: TinyZZ, a Z280 SBC [message #4481 is a reply to message #4477] |
Mon, 19 March 2018 18:03   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
lowen wrote on Mon, 19 March 2018 18:12Yeah, it does sound a bit confusing. The Z280 manual does say that if an external bus transaction doesn't occur within the number of cycles defined in the refresh control register, that a refresh transaction will be inserted anyway, even if refresh is disabled. This means that an idle loop, running entirely in cache, would trigger refresh cycles even with refresh disabled.
This is the last paragraph of section 9.3 Refresh Controller

Thanks for the reminder. I remember reading it but not understanding it and moved on. Didn't worry about it since I turned on the refresh controller anyway. Reading between the lines it basically says the refresh rate register can't have a value of zero (refresh disable and rate = 0). This is why it crashed when I write 0x0 to the refresh rate register. This also tells that SNC (Stefan Nitschke Chaos) can't work because it supposedly wrote 0's to the refresh controller. Or perhaps it did worked with older date code parts, but now it won't work. I wonder whether this is part of the UZI280 problems?
----------
Edit: Thinking about it more, even if SNC had set the rate field to non-zero value it can create insidious bugs because if program is idling in cache, the refresh mechanism would work properly, but if program starts running some tasks then the refresh cycles won't start and parts of the memory will become corrupted gradually. This is insidious because the tasks that run regularly will get refreshed, but the tasks that seldom get called will become corrupted and then crashed in random ways. DRAM can actually retain its data for many seconds without refresh but it is highly variable and strongly temperature dependent--a nightmarish problem to debug.
[Updated on: Mon, 19 March 2018 18:35] Report message to a moderator
|
|
|
|
Re: TinyZZ, a Z280 SBC [message #4489 is a reply to message #4481] |
Tue, 20 March 2018 07:23   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
plasmo wrote on Mon, 19 March 2018 18:03I wonder whether this is part of the UZI280 problems?
Is there a list somewhere of UZI280 problems? Haven't had the time to look at the sources in detail, but I don't think it has the SNC fix (floppies are not supported at all). OTOH, OUTJMP fixes can be found in e.g. the IDE code.
Quote:Thinking about it more, even if SNC had set the rate field to non-zero value it can create insidious bugs because if program is idling in cache, the refresh mechanism would work properly, but if program starts running some tasks then the refresh cycles won't start and parts of the memory will become corrupted gradually. This is insidious because the tasks that run regularly will get refreshed, but the tasks that seldom get called will become corrupted and then crashed in random ways. DRAM can actually retain its data for many seconds without refresh but it is highly variable and strongly temperature dependent--a nightmarish problem to debug.
I was wondering about the same. The DRAM on the CPU280 relies on the Z280 CPU for refresh, and after the SNC fix the software cannot longer be expected to work reliably.
Just wanted to do a quick test to see how long it would take before memory contents begin to fade, but since the BIOS enables protected mode I could not access the refresh register. Also, it is not a trivial test, as the memory will get refreshed just by reading it or by instruction fetches, etc.
|
|
|
Re: TinyZZ, a Z280 SBC [message #4501 is a reply to message #4489] |
Thu, 22 March 2018 05:03   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
Did a couple experiments with turning off refresh logic to DRAM on TinyZ280. The test condition is at room temperature (70F). I filled 52K of DRAM with test patterns that's unique for each 16-bit word; turned off the refresh controller (the program itself is constantly refreshed by code fetches); wait for some period of time then check the memory for number of mismatches:
DRAM #1 (TI TMS417409)
time without refresh (seconds) error count
5 no error
10 no error
15 1
20 7
25 10
30 17
35 25
DRAM #2 (NANYA NT511740)
2.5 no error
5 1
10 8
15 21
20 50
25 61
Even at room temperature, DRAM's data retention time is orders of magnitude greater than what manufacturer's datasheet required (32mS). Literature showed that retention time is dramatically increased at colder temperature. Retention is also different for different manufacturers.
So depending on the operating temperature and SIP DRAM manufacturers, idling processor with SNC fix will remain operational indefinitely; processor that's actively running with SNC fix may remain operational for many seconds, possibly minutes depending on where the data corruption had occurred.
[Updated on: Thu, 22 March 2018 05:04] Report message to a moderator
|
|
|
|
Re: TinyZZ, a Z280 SBC [message #4542 is a reply to message #4508] |
Wed, 04 April 2018 20:12   |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
With Spring growing season upon us, I find myself not able to spend much time on the Z280 exploration. Fortunately the hardware development is at a stable point. Other than the EX AF,AF' bug, many other bugs that were rumored did not materialized on my hardware. I went as far as built up all 6 remaining pc boards and checked them out. They all worked, and worked the same. I have a working monitor, CPM2.2 and CPM3 (non banked). I wanted very much to port CPM3 banked version, but that'll have to wait to late Fall. UZI280 is but a dream, I had no idea how even to approach it.
I'm pleased with the simplicity of the hardware (and low cost, too). It consists of 5 active components: Z280, Altera EPM7128 CPLD, SIMM72 memory (either 4Meg or 16 Meg), CF disk and 24MHz oscillator, There is an optional RTC based on DS12887. There are plenty of room for other devices even on a small 10cm*10cm pc board. The CPLD is about 75% utilized with a dozen spare pins.
The design is posted on my builderpages starting with this page:
https://www.retrobrewcomputers.org/doku.php?id=builderpages: plasmo:tinyz280:final_step
I welcome ideas, recommendations and constructive criticisms, but they'll have to wait til the Fall to be realized.
Bill
|
|
|
|
|
|
|
|
|
Re: TinyZZ, a Z280 SBC [message #7684 is a reply to message #7683] |
Sat, 23 May 2020 00:29   |
hperaza
Messages: 68 Registered: March 2017
|
Member |
|
|
etchedpixels wrote on Fri, 22 May 2020 11:40On RAM it works fine. I suspect it is keeping (hl) internally as an optimization and not flushing it. There is other stuff going on too, when I try and do ordinary bank switching weirdness happens (again cache on or off) in Z80 bus mode if I execute code, flip banks, do some I/O into memory in the new bank, flip back and then do stuff. Again caches on or off, prefetch hazards accounted for as far as I can see. Unfortunately I don't see any way to debug it without a fairly fancy logic analyzer.
That behavior is actually documented: see page 7-6 of the Z280 Technical Manual, last paragraph near the bottom-right corner of the page, which warns about the CPU pipeline not being flushed after a MMU register is changed. It also has that phrase in parenthesis "(However, no data accesses are pre-fetched.)" where the parenthesis do not make that much sense until you remember that the docs says "Preliminary" (like most Zilog's docs do, BTW).
I've respected that caveat in RSX280, and never ran into any problems.
I'd stay away of the Z80 bus mode as well, as Zilog itself discouraged its use.
[Updated on: Sat, 23 May 2020 03:13] Report message to a moderator
|
|
|
|
|
|
Re: TinyZZ, a Z280 SBC [message #7696 is a reply to message #7693] |
Sun, 24 May 2020 11:31  |
plasmo
Messages: 916 Registered: March 2017 Location: New Mexico, USA
|
Senior Member |
|
|
OK, I believe your ROM case is for Z280 operating in Z80 compatible mode, and the MMU and cache are disabled? I'll try it.
Bill
|
|
|
Current Time: Mon Mar 17 05:00:41 PDT 2025
Total time taken to generate the page: 0.00864 seconds
|