alexh wrote: Tue Nov 24, 2026 3:01 pm
The ST has no 68k cache and no 68k MMU but the Falcon has both? (not sure it has a 68k MMU?) Does that mean that DMA buffers in ST-RAM are typically marked as "don't cache"?
I only mentioned it because others have/are doing it on the Falcon and (presumably?) found a use for it and I thought if you knew about it you could "provision" for enough RAM should you want to try this.
The cache is a side issue really, the main problem is simpler than that.
The shadow copy only gets updated when the CPU writes to ST-RAM, because the CPU's own writes are the only thing the accelerator sees. Anything that writes to ST-RAM without going through the CPU, like the floppy, SCSI or sound recording, changes the real ST-RAM but never touches the shadow copy. As you said yourself, the SuperVidel doesn't mirror the blitter either. From that point on the two copies no longer match, and anything reading the shadow gets old data, with nothing to tell it the data is wrong.
Shadow ROM is a different story, and the ST536 already does it. That's simple because nothing ever writes to ROM, so the copy can never go out of date. The ROM is copied into a reserved area of TT-RAM, and the CPU's ROM reads come from that 32-bit copy. The blitter can't reach the shadow, so its reads still go to the real 16-bit ROM, which is fine as speed doesn't matter there. So nothing breaks.
The 030's own data cache has the same problem as shadow RAM, which is why TOS deals with it. Looking at the TOS 4.04 ROM, the MMU table marks all of ST-RAM as cacheable, so DMA buffers aren't marked as don't cache. Instead TOS just clears the data cache after floppy and DMA transfers, and after blitter jobs. That's fine for a 256 byte cache, it's one instruction. You can't do that with a 14MB shadow copy, you'd have to copy back whatever the DMA wrote, and only the driver knows where that went.
On the SuperVidel the shadow is a separate 16MB window at $A0000000, so it's opt-in. Normal programs never touch it, only software written to use it, and that software has to know its data didn't arrive by DMA.
Which brings me back to what would actually use it. If programs run in TT-RAM and the graphics live in the board's own RAM, I'm not sure what's really left in ST-RAM worth shadowing in the first place. The things that have to stay in ST-RAM, like disk and sound DMA buffers, are there because the DMA can't reach TT-RAM, and they're exactly the ones a shadow can't keep in sync. Was there a particular program you had in mind?
As for provisioning RAM, the DFB1X already has 128MB of TT-RAM run by the same FPGA, so in theory 16MB could be set aside for a shadow in the logic later, with no extra RAM needed. I've no plans to add it though, unless something turns up that would actually make use of it.
Even then, I'd question whether the speed gain would be worth breaking the blitter, hard drives and all that sort of thing.