StephenHorn wrote: ↑Wed Mar 15, 2023 10:15 pm If someone wanders in wondering, that was
post #26204 that linked to the half-cycle shadow access concept.
Yes, looking at the 65C02's timing, I don't think that could be made to work easily. Much easier to, instead, catch when the 65C02 performs a write to an appropriate register on the "DMA controller" (in quotes with respect to some conversation on Discord) and then just hold the CPU in limbo in its entirety with RDY.
Thanks for that -- from looking at SRAM & EEEPROM datasheets for the CP/M SBC sketches, I expected it would be 70ns FlashROM and 55ns SRAM.
One option to bear in mind, if you don't want to kill the ability to process interrupts while the DMA is in process, is to do the DMA in batches (say, 8 bytes in 16 clocks), triggered by the SYN line, so that instructions continues to execute, just with an extra overhead of 8 clocks per instruction. Then a "pause" capability could be used by a timing sensitive interrupt routine to pause any ongoing DMA operation until the timing sensitive part of the interrupt routine is completed.
__________________________
picosecond wrote: ↑Thu Mar 16, 2023 12:59 pm
BruceRMcF wrote: ↑Wed Mar 15, 2023 3:00 pm
Note that while the 65C02 CPU timings are the foundation, some of the expansion port timings will be due to other parts of the design ... specifically for a bus mastering card, you'd need to know the ROM and RAM speeds and the logic family & number of gates between asserting addresses and generating the ROM and RAM chip selects.
Not so. These already work with the 65C02. Expansion card slots drive/receive the exact same wires as the CPU. Address decode/RAM/ROM have no idea and do not care if the 65C02 or a slot is in control. This is why meeting or exceeding 65C02 timing is all you need.
To be sure, if you generate the address on or before the address set-up time for the 65C02, you can't be in trouble, but that doesn't tell you the minimum set-up time for the RAM or the ROM. If the RAM is qualified by Phi1=1, then so long as the address is asserted before the end of the first phase, you are OK for RAM (which is to say, any DMA Write cycle), but if ROM is not qualified by Phi1=1 (which is typical practice above 4MHz clocks, to cope with the longer set-up time requirements of EEPROMs), then the actual minimum set-up time to read from ROM is the ROM set-up time plus the X16 gate delay.
Which was my point above. The DMA will be a state machine. If the internal clock runs at 4 times the system clock, then start of a read or write cycle can be triggered by the drop of the main system clock, and the address asserted on the next drop of the internal clock. That asserts the clock in the middle of the first phase of the system clock.
The 65C02 address set-up at 5v, TA=0-70 degrees C is 30ns. A four beat internal clock places the start of the second beat at +31.25ns plus whatever internal gate delays are happening in the FPGA. So to hit the 65C02 timing, you'd need to crank up the clock to 6 times the system clock (to have an integer number of internal bus cycles per 65C02 clock phase).
But it may be that the maximum gate delay of generating the /ROM_CS, the minimum address set-up time per the datasheet specification of the gates used to generate the /ROM_CS shorter than the 95ns that can be inferred from the 65C02 data sheet and the 8MHz clock frequency. If it is short enough, then generating the address in the middle of the first clock phase works for both ROM and RAM.