Excellent.Mike wrote:In the broad picture, yes.
Although deciding wether we want the new CPU inside or on the cart port seems secondary to me at this point, your suggestion seems excellent.The 6502 is removed, and replaced by a small logic which provides A14, A15 and Phi1, Phi2 from the clock input. The new CPU sits on an external cartridge. However, the extra signals do not necessarily need to be provided on the cartridge port, IMO they could just use a signal cable.
Yes.I think it is important, that the new CPU is able to have its memory access stretched. It will put the required memory address on the bus, and the CPLD needs enough time to decide, whether the access can be satisfied by fast memory or it has to stall the CPU during the memory access for at least a full non-VIC cycle on the mainboard.
I am a bit confused. I expected the CPU to be stalled for at leat one complete standard VIC cycle upon access by the new CPU to the old bus. Am I missing something?
Perhaps, on writes to the old bus, we could get the CPLD to latch the written address and value and simply make the required access when the old bus becomes available, freeing the new CPU to operate at high speed for subsequent cycles thereby creating a one byte write-back cache. Of course, this cannot be done for reads to the 6522 and VIC registers.
If this one byte cache is already loaded with data to write on the old bus and the new CPU performs another read or write destined for the old bus then we have no choice but to stall the CPU until the CPLD can complete the required accesses at slow speed.
I suggest we define a policy concerning accesses to the old bus.
1. All accesses to areas other than $1000-$1FFF or $9000-$9FFF go directly to the fast bus (with a possible temporary exception on the BLK5 area at startup to copy the data from the slow bus to ram on the fast bus)
2. All writes to $1000-$1FFF are "write-back" cached by the CPLD. The data is copied in both the fast bus's ram and copied to chip ram on the next available VIC cycle.
3. All reads to $1000-$1FFF are performed on the fast bus at high speed just as if it was meeting criterias for policy 1
4. All writes to $9000-9FFF are identical to policy 2 except there is nothing to write to at this address range on the fast bus. The old bus receives the written data on the next available VIC cycle.
5. All reads to $9000-$9FFF require a complete stall of the CPU for at least one complete VIC cycle. The CPLD stalls the CPU until the beginning of the next available VIC cycle and the subsequent half cycle, applies to the old bus the requested address, waits a little less than half a VIC cycle to retrieve the data, passes the information to the CPU as soon as it has been properly read from the old bus. Only once the operation is complete can the CPU be unstalled and returned to high speed operation.
Policy 5 is, of course, the most technically demanding and speed taxing.
I await your feedback on this.