"SuperVidel" style graphics for the DFB1X2?

Discussion and support for the DSTB1 & DFB1 boosters by BadWolf..
User avatar
exxos
Site Admin
Site Admin
Posts: 29858
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: "SuperVidel" style graphics for the DFB1X2?

Post by exxos »

alexh wrote:Looking good. Are you thinking Display Port type digital display output or old skool R2R DAC for SVGA output?
It's digital, through a standard HDMI-type socket. The FPGA generates the TMDS signals and they go through a MAX3814 driver chip to the socket, the same way @Icky did it, rather than driving the socket straight from the FPGA pins.

It will send plain DVI video, which any HDMI monitor or TV accepts, the same as most FPGA projects do. (I'm not sure where HDMI licensing stands these days. I half recall V1.1 being licence free, or that later versions let you build 100 prototype units without one, but it's been some years since I last looked.)

There's no analogue output planned, so no R2R DAC. Audio is left out for now, but I'm putting a small header on spare FPGA pins so something can be added later.
User avatar
exxos
Site Admin
Site Admin
Posts: 29858
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: "SuperVidel" style graphics for the DFB1X2?

Post by exxos »

The "plug in" board I was working on looked like this. It was basically routed all on the top layer on purpose.

DFB2X-VIDEO-stage8.png
DFB2X-VIDEO-stage8.png (447.95 KiB) Viewed 79 times

But like I said before, its not going to fit in the Falcon case. Plus it just seems a bit daft to have a PLD and FPGA stacked against each other. Hence moving to a FPGA on the DFB1X2.. Bringing up the booster *should* be the simple part. Then the Videl stuff gets added later.

Routing the FPGA will take some time.. Its a pretty big board rebuild.

Capture.PNG
Capture.PNG (340.79 KiB) Viewed 79 times

The PLD area was shifted to the top layer, and the videl routing gets shifted to the bottom. So you basically have DFB1X "on top" and "videl" on the bottom copper wise. Mix in other stuff and it turns into a hot mess very fast as I am finding out :lol: :roll:
User avatar
alexh
Site sponsor
Site sponsor
Posts: 1513
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: "SuperVidel" style graphics for the DFB1X2?

Post by alexh »

I read that "SuperVidel" implements "Shadow ST-RAM". It simultaneously writes to ST-RAM and shadow ST RAM (16 MB in its 0xA0xxxxxx address space) so "high speed ST RAM" reads can be achieved by adding 0xA0000000 to your pointers. Obviously it is not DMA capable so any manipulation of ST-RAM with DMA capable peripherals (e.g. blitter) will not be mirrored but still interesting feature. I wonder how practical it is?
Senior Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
ST,STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
User avatar
exxos
Site Admin
Site Admin
Posts: 29858
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: "SuperVidel" style graphics for the DFB1X2?

Post by exxos »

alexh wrote: Tue Nov 24, 2026 8:28 am I read that "SuperVidel" implements "Shadow ST-RAM". It simultaneously writes to ST-RAM and shadow ST RAM (16 MB in its 0xA0xxxxxx address space) so "high speed ST RAM" reads can be achieved by adding 0xA0000000 to your pointers. Obviously it is not DMA capable so any manipulation of ST-RAM with DMA capable peripherals (e.g. blitter) will not be mirrored but still interesting feature. I wonder how practical it is?
Basically it's a huge RAM cache. It's possible, but it breaks a lot of stuff as well.

Anders tried shadow ST-RAM on a TF536 as an experiment, and the problem was always DMA. Anything that writes to ST-RAM without going through the CPU never updates the shadow copy, so the copy goes stale. In the end only the onboard IDE could be used, because IDE is driven by the CPU, so every write goes through the accelerator.

On the Falcon it would be the same story. The floppy, SCSI, sound recording and the blitter all write to ST-RAM directly, so none of them would be mirrored. The only real fix is to snoop the bus while DMA is running and update the shadow copy from that. Nobody could decide whether that was possible or reliable, so the work never got done. A logic analyser on the 030 socket during a SCSI read would answer it one way or the other.

I did something similar on the ST536 by moving the low RAM system variables into TT-RAM. That works fine because only the CPU ever writes to them.

I'd also question how much it would actually be needed. On the ST it gives huge gains because the graphics live in ST-RAM. But if programs run in TT-RAM and the graphics live in the board's own memory, there isn't much left using ST-RAM in the first place. The only real exception is older programs without the TT-RAM flags set in their header, which still load into ST-RAM, and those are also the ones most likely to be using DMA, which is exactly where shadow RAM breaks.
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3194
Joined: Tue Nov 19, 2019 12:09 pm

Re: "SuperVidel" style graphics for the DFB1X2?

Post by Badwolf »

exxos wrote: Tue Nov 24, 2026 10:02 am The only real fix is to snoop the bus while DMA is running and update the shadow copy from that. Nobody could decide whether that was possible or reliable, so the work never got done. A logic analyser on the 030 socket during a SCSI read would answer it one way or the other.
On the ST the data lines are sniffable during DMA chip transfers, but not the address lines. Blitter runs CPU-side, but FDC and ASCI don't.

I don't know for sure, but I would be a little surprised if the Falcon doesn't follow the same path with FDC and SCSI.

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
User avatar
alexh
Site sponsor
Site sponsor
Posts: 1513
Joined: Tue Oct 17, 2017 4:51 pm
Location: Oxfordshire

Re: "SuperVidel" style graphics for the DFB1X2?

Post by alexh »

exxos wrote: Tue Nov 24, 2026 10:02 am On the Falcon it would be the same story.
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.
Senior Principal ASIC Engineer - SystemVerilog, VHDL
Thalion Webshrine - http://thalion.atari.org
ST,STf,STfm,STe,MegaST,MegaSTe,Falcon060
A500+,A600,A4000/060,CD32,CDTV
User avatar
exxos
Site Admin
Site Admin
Posts: 29858
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: "SuperVidel" style graphics for the DFB1X2?

Post by exxos »

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.
User avatar
Badwolf
Site sponsor
Site sponsor
Posts: 3194
Joined: Tue Nov 19, 2019 12:09 pm

Re: "SuperVidel" style graphics for the DFB1X2?

Post by Badwolf »

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.
I've pondered ST-RAM caching a few times. The issue is always what happens after flushing the cache.

There aren't any static DMA buffers in the Falcon's ST-RAM, the whole 14MB is DMA-accessible. Because the Falcon is a native 030 machine the OS flushes caches after each DMA request finishes. That's fine as the caches are tiny and they're designed as caches from the get-go.

The problem with a transparent write-through RAM cache using normal memory chips is once you've invalidated it, how do you know which bits are valid again later on? That's what tag-RAM was for. Without it, things get complicated quickly.

BW

PS. I did implement a write-through RAM cache when I was playing with the early port of PiStorm. I could do it there as there was ample time and memory for the Pi to check a parallel 'dirty tracker' array. You'd have to do all that in hardware fast enough that you didn't slow down access to ST-RAM on a cache miss: a big ask.
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
Post Reply

Return to “DSTB1 & DFB1 booster by BadWolf”