ytmytm / c128-z80-8mhz

Double the clock speed of Z80 in C128
19 stars 2 forks source link

Support Z80 part with cache #3

Open 0x444454 opened 1 week ago

0x444454 commented 1 week ago

Memory access is still a bottleneck. Consider using a more modern CPU (e.g. Z280) which adds instruction and data cache, plus several other nice features. See also here:

https://github.com/Konamiman/Z280TechnicalManual/blob/master/A-Z80_Z280_Compatibility.md

ytmytm commented 1 week ago

Interesting, I didn't know about this part. Thanks!

I'll put it on my to do list to obtain it to see if it can be used as a drop-in replacement here.

lgblgblgb commented 1 week ago

I'm not sure about Z280, but for Z180, it's problematic as it does not implement all Z80 things, for example the "undocumented" opcodes like using the IX register as two 8 bit ones (IXL and IXH) + same for IY, and possible other stuffs. Also, there can be a problem, that more modern Z80-compatible CPUs/MCUs have on-chip peripherals which uses the I/O space partly and I/O ops are not even routed then to the outside bus :( For example the "very modern" eZ80 would be nice to use in places where I have a Z80 but there for example every ports 0x00...0xFF are used by the chip itself :( So usually is a big no-no to use them in existing designs then, where Z80 was used before :( But I would be very much interested to know if there is a good candidate to replace existing Z80 with a more modern parts which do not have problems like I mentioned ...

0x444454 commented 1 week ago

Indeed, the eZ80 and other modern Z80 variants may be tricky to adapt, but most importantly they don’t have cache memory so even if they are more efficient at the same clock frequency, they will still be impacted by the C128 memory bottleneck.

I am not an expert on the Z280, so I am not sure how feasible/easy it is to use it as a replacement. While the Z280 can be configured to work on a classic 8-bit Z80 bus (“OPT” pin tied to GND), it still multiplexes (AD0..AD7), so there is at least some demultiplexing needed.

lgblgblgb commented 1 week ago

Btw eZ80 - IMHO/IIRC - also has a Z80 bus mode, I would more worrying on other details as well (and yes, eZ80 doesn't have a cache, in fact one of the design factors was that SRAM is cheaper/faster than ever before so even no need for that ... unlike with some older though newer than Z80-family parts).

ytmytm commented 1 week ago

Perhaps such Z80 replacement should be isolated from C128 bus until access is needed. Something like this project for C64: https://github.com/kneehighspy/Z80-Card_for_Commodore_C64 just not in form of a cartridge, but something that would be plugged into Z80 socket on C128's mainboard.