Re: "Fast" PDIP 6502 design feedback
Posted: Fri Jul 21, 2023 12:10 am
I think there were plenty of mistakes in my logic earlier - hopefully this is a bit better now! This is using discrete D-flipflops rather than a PLD, though I may still go either way on that. The main change here is making use of asynchronous resets to reduce some of the complexity and deal better with the end of an I/O cycle - I'm pretty sure that's OK now, and this diagram shows two I/O cycles in quick succession as well as an I/O cycle without another following it.
IOCLK is probably 4MHz, we have two flipflops in a row before IOCS is generated so hopefully decent metastability safeguards, one more flipflop to generate the IOREADY signal, and no extra glue logic needed so the only propagation delays are in the flipflops which are all clocked by IOCLK.
The delay between IOREADY rising and IOWAIT falling is probably about 30ns plus the clock period of the CPU clock, so to arrive in time for the next IOCLK it could probably support clock periods up to about 200ns, i.e. frequencies down to about 5MHz. So long as the CPU clock is always faster than that, IOWAIT will get reset in time to avoid wrongly repeating an I/O cycle.
I did think about more robust ways to make that safe, and it's mostly down to the way the IOWAIT/IOREADY handshake works between the two modules. If the I/O module responded straight away to IOWAIT then the system module could deassert it, and still wait for IOREADY, acknowledging that separately. Then either module could wait for the other as necessary. I think it's probably OK how it is though.
It's getting to a point where I can probably soon finish designing a basic I/O module, and post a whole-system schematic.
IOCLK is probably 4MHz, we have two flipflops in a row before IOCS is generated so hopefully decent metastability safeguards, one more flipflop to generate the IOREADY signal, and no extra glue logic needed so the only propagation delays are in the flipflops which are all clocked by IOCLK.
The delay between IOREADY rising and IOWAIT falling is probably about 30ns plus the clock period of the CPU clock, so to arrive in time for the next IOCLK it could probably support clock periods up to about 200ns, i.e. frequencies down to about 5MHz. So long as the CPU clock is always faster than that, IOWAIT will get reset in time to avoid wrongly repeating an I/O cycle.
I did think about more robust ways to make that safe, and it's mostly down to the way the IOWAIT/IOREADY handshake works between the two modules. If the I/O module responded straight away to IOWAIT then the system module could deassert it, and still wait for IOREADY, acknowledging that separately. Then either module could wait for the other as necessary. I think it's probably OK how it is though.
It's getting to a point where I can probably soon finish designing a basic I/O module, and post a whole-system schematic.