QuickDraw Speed - Fast Card Benchmarks

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
Curious how you achieve this. NuBus is quite slow compared to the CPU in the Quadra and PPC era. Just sending command over the bus is going to take time. The 8*24GC "solved" the issue by offloading larger chunks of work, but that comes at the cost of compatibility. In my Quadra, the QuadraFPGA destroyed the NuBusFPGA performance-wise even though the internal acceleration engine & acceleration init are the same.
The chip on the card is a late 1996 Cirrus Logic chip - it has a very fast blit engine / accelerated rectangles and SDRAM. I'm trying to minimise register writes and VRAM writes over Nubus (the best I'm getting over Nubus is about 7.5MB/s write, and weirdly only 3.5MB/s read).
Some of the gains are just over benefiting the synthetic benchmark, such as my font and small image caches, other stuff I'm doing 1bit writes and colouring once on the card which especially benefits higher bitdepths (not shown above).

It is probably the fastest Nubus hardware out there to start with, but yes - Nubus being a bottleneck is the biggest issue.

Some stuff I've also cached on the host side so lookups / compares can be done quickly. Basically I've spent every non-work waking minute trying to squeeze every last bit out of it. Sadly its a battle with the cost of patches, especially with line drawing. I really should test on a slower machine where the CPU isn't so fast though - I'm worried I'm dismissing stuff that would benefit an 030.

Also curse Nubus not benefiting from MOVE16 on these machines (as far as I know).
 
Last edited:

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
In my Quadra, the QuadraFPGA destroyed the NuBusFPGA performance-wise even though the internal acceleration engine & acceleration init are the same.
Same would happen here - a PDS card would give huge - insanely huge - gains. Especially in the bitcopy tests and picture, which are copies from RAM I believe. The actual throughput really matters for real world stuff - for example illustrator uses its own routines to memory and then just copies to VRAM, so you only really gain by speeding that copy up and I'm already knocking my head on the ceiling there. This chipset is begging for a faster host connection.

If I was building a card from scratch I'd try and put it in the PDS slot. I wish 040 connectors were more easy to get.

To optimise I used a QuickDraw profiler which recorded all the calls and how long each took. That helped me work out where time was spent, what was worth optimising and also whether I was seeing improvements. I used it to record a few things (Marathon just writes to the frame buffer, so no gains there), but the useful one is the MacBench "Graphics" test, which seems to just replay quickdraw calls like a VCR and gives a good general productivity usage activity to observe.
 

Melkhior

Tinkerer
Jan 9, 2022
118
72
28
The chip on the card is a late 1996 Cirrus Logic chip - it has a very fast blit engine / accelerated rectangles and SDRAM
Help once you're inside... not over the bus :-( (my engine is not "very fast" in the NuBusFPGA as i'ts just a RISC-V core, but its DDR3 beats your SDRAM :) )

But I'm nowhere near that fast - too much overhead sending commands to NuBus, plus the slow m68k path to filer what is sent and what should be kept on the CPU.

It is probably the fastest Nubus hardware out there to start with
... that was available during the NuBus era :) And I'm not sure my little Artix-7 could beat a dedicated ASIC from the PPC era in all honesty...

I'm worried I'm dismissing stuff that would benefit an 030.
The '030 doesn't like if you add too much CPU overhead before going to NuBus...

Also curse Nubus not benefiting from MOVE16 on these machines (as far as I know).
You can do block *read* from NuBus to the memory, the NuBusFPGA does that for the RAM disk IIRC (haven't looked at the code in a while). But you need to know the physical address, so the host has to do the translation first if VM is on.

If I was building a card from scratch I'd try and put it in the PDS slot. I wish 040 connectors were more easy to get.
You're telling me :) The only reason the IIsiA7 Mini exists is because of the lack of '040 PDS connector.

Maybe AI will enable so many PDS '040 project someone will bite the bullet, buy 200 connectors, and resell them to people like you and me...

To optimise I used a QuickDraw profiler which recorded all the calls and how long each took. That helped me work out where time was spent, what was worth optimising and also whether I was seeing improvements. I used it to record a few things (Marathon just writes to the frame buffer, so no gains there), but the useful one is the MacBench "Graphics" test, which seems to just replay quickdraw calls like a VCR and gives a good general productivity usage activity to observe.

Hehe, I did start building a QD acceleration infrastructure with AI (to perhaps improves acceleration in the *FPGA), and I ended up with tracing QD calls in Qemu... try to guess which game I used as one of my inputs :) Great minds think alike :)

Marathon (1994) — a workload nothing else resembles​

tools/install-app.py copies an unpacked Mac application into the image with both forks; tools/marathon-workload.py drives Bungie's Marathon demo from the Finder into a game and walks the character around.

It is the first workload here that is not a desktop application, and it profiles nothing like one:

trapcallspixels
DrawSlab1,222,43384.4%31,283,3857.2%
DrawLine168,36111.6%5,011,1261.2%
StretchBits30,0672.1%208,569,02348.3%
BitBlt27,2351.9%177,638,83641.1%
RgnBlt410.0%9,484,4192.2%

(StretchBits → RgnBlt → BitBlt is a call chain, so these do not sum to a workload total.)
 

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
Hehe, I did start building a QD acceleration infrastructure with AI (to perhaps improves acceleration in the *FPGA), and I ended up with tracing QD calls in Qemu... try to guess which game I used as one of my inputs :) Great minds think alike :)
Heh - yeah, I've also been working on a brand new card - this project was a side project to get my brain in gear thinking about drivers for down the road.

I'm targeting the LC-PDS with a Lattice ECP5 and 8MB of SDRAM I think. I've done a load of the core work, but need to sit down and route the PCB and have been lazy. To test the core what I did is I used MAME to record VRAM writes, and made a little playback engine in the FPGA that simulates writes coming in over the PDS. There are some £30 SODIMM style dev boards available from China. I've been having great fun. I'm looking forward to getting it inside a computer. I'm aiming for a pixel clock of 180MHz.


That's about where I've got to. It draws and it copes with colour tables. No acceleration or anything yet. Just want to get the basics done first and return to the acceleration later. Interestingly the development stuff I'm using also has a 50MHz RISC-V - are we using the same stuff by chance? I've been good and while I'm aware of it, I've intentionally not looked at your stuff because I'm trying to learn rather than fast forward to the answer.
 

Melkhior

Tinkerer
Jan 9, 2022
118
72
28
I'm targeting the LC-PDS with a Lattice ECP5 and 8MB of SDRAM I think
Nice if you want a reasonably inexpensive device - but SDRAM won't support Full HD at Millions. You need about 125 MB/s of read bandwidth per byte of depth for 1920x1080@60. a 16-bit wide SDRAM at 133 MHz is barely above what's needed for thousands, so is probably only suitable for 8-bits. OTOH, '020/'030 machine don't have the CPU needed to deal with high-resolution/high-depth... my IIsi can tell you that :)

Also do you target the original PDS slot or the expanded one from the LCIII?

I have a LC32FPGA but it was never properly released (too high FPGA board, can't close the case) though Jockelill build a batch for himself. I'm thinking about a 'LCA7 Network' that would take the 'IIsiA7 Mini' FPGA hardware, clean it up a little and port to the LC form factor/connector, add a SEthernet clone, to get both HDMI and Ethernet on a single device for LC, but that requires the extended slot of the LCIII.

I'm using also has a 50MHz RISC-V - are we using the same stuff by chance?
It's a VexRiscv core (an old version), plus support for additional instructions to help with the software (barrel shifter forr realignment, 64-bits load/store for bandwidth, ...)

I've been good and while I'm aware of it, I've intentionally not looked at your stuff because I'm trying to learn rather than fast forward to the answer.
That's the fun of it. I spent a lot more time designing, building and debugging that actually using those boards :)
 

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
Nice if you want a reasonably inexpensive device - but SDRAM won't support Full HD at Millions.
Yeah - I'm able to get about 200MB/s I thought (but that will be for everything, not just the display out) - it is a few weeks since I looked. I'll check back. Perhaps I'm getting muddled.

I wasn't expecting Millions at all resolutions though to be honest. I mostly use old computers at 256 colours, and don't mind dropping to lower resolutions for higher depths. My tests so far I've been able to do 1024x768 at millions of colours, which quick maths says is... 60*1024*768*4/(1024*1024) = 180MB/s... So I know I can do that at least. If I remember this is around the limit of the RAM. 8bit 1920x1080 would need about 119 MB/s so I should be good for that. Pixel clock would be ~148MHz, which I also should be good for. So don't expect to be able to do thousands of colours at 1080p.

Also do you target the original PDS slot or the expanded one from the LCIII?
Knowing that there is a speed sacrifice, I am targeting the original slot for compatibility (which should give something like 23MB/s or something? I forget - need to re-read my notes) - again, I'm not prioritising speed, but would prefer the first version to work in my LC II as well if possible, so that is a secondary target after my 475 and 630. If everything goes well, I'll look at taking advantage of the full LC III style slot down the road.

The main thing I really want is a slightly bigger display and HDMI out, but mostly "hobby project".

That's the fun of it. I spent a lot more time designing, building and debugging that actually using those boards
If there is any way what I've been doing can help with your drivers I'm more than willing to help, but be aware I'm just a fool playing with fancy tools.

Your raw data throughput will be worth more in real use than any amount of quickdraw acceleration. The important ones are just making sure you can scroll an image and punch stuff to the screen efficiently. All this drawing primitives is just bragging rights really at the end of the day!

We could have a think about what really matters acceleration wise and if there is anything that mine does that would have a significant benefit to yours if you like. Feel free to drop me a message or add me on Discord.
 
Last edited:

Melkhior

Tinkerer
Jan 9, 2022
118
72
28
Yeah - I'm able to get about 200MB/s I thought (but that will be for everything, not just the display out) - it is a few weeks since I looked. I'll check back. Perhaps I'm getting muddled.

Sounds reasonable for a 16-bits 133 MHz SDRAM; wire speed is not achievable. 75% efficiency is fairly good.

(..) don't mind dropping to lower resolutions for higher depths
Do you dynamically reset the pixel clock for lower resolutions, or do you go windowboxed? I eventually added the ability to change resolution including the pixel clock, that's a nice feature but you really need to deep dive into the specifics of your FPGA.

Pixel clock would be ~148MHz
148.5 or 148.35 ('cause of the 1/1.001 thing I don't understand), those numbers are burned into my brains by now... all the way back when I was hacking my Sun TurboGX+ w/ 4MiB to get FullHD @ 8 bits. Then I did the SBusFPGA :)

Knowing that there is a speed sacrifice
Not that much speed (the slot is 32-bits despite rumors to the contrary), only the /STERM vs. /DSACK extra clock, but versatility; you're missing some address lines, which is annoying if you want access to the superslot and/or more complex memory map.

/STERM is hard to use for 2-clock cycles at high speed anyway. The LC32FPGA has difficulty passing timings at 25MHz (LCIII) and fail at 33MHz (LCIII+).

, I am targeting the original slot for compatibility (which should give something like 23MB/s or something? I forget - need to re-read my notes) -
Nominally 16MHz/32bits which is 64MB/s wire speed, but with /DSACK you need at least three cycles per word, so in practice ~20MB/s if everything is full-speed. Easy for writes (just post them in a FIFO), reads will be a lot slower if you go through the FPGA (I'm assuming you do, and don't implement SDRAM-on-CPU-bus with arbitration).

The main thing I really want is a slightly bigger display and HDMI out, but mostly "hobby project".
Beware, "hobby project" can quickly gets out of control, you design a simple "slightly bigger display" board and ends up with a whole family of weird hardware :)

Your raw data throughput will be worth more in real use than any amount of quickdraw acceleration
Only if used from inside the FPGA with acceleration; otherwise the latency to access the DDR3 becomes a problem for reads. That's why the one real benefits is for scrolling at high depth - tons of data not going over NuBus or PDS.
 

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
Do you dynamically reset the pixel clock for lower resolutions, or do you go windowboxed? I eventually added the ability to change resolution including the pixel clock, that's a nice feature but you really need to deep dive into the specifics of your FPGA.
Not implemented yet due to clock limitations of the FPGA - but for the PCB I'm working on I intend to use an external Si5351A and so will be able to hot switch pixel clock up to about 180MHz. I'm also needing to use a TFP410PAP and TPD12S016PWR for the HDMI output otherwise I wouldn't be able to get anywhere near the speeds needed for higher resolutions.

/STERM is hard to use for 2-clock cycles at high speed anyway.
Yeah - I wasn't going to be able to do 2-clock anyway I don't think.

reads will be a lot slower if you go through the FPGA
Yes - all through the FPGA because I'm using a pre-built module and the RAM hangs off the FPGA.
Beware, "hobby project" can quickly gets out of control, you design a simple "slightly bigger display" board and ends up with a whole family of weird hardware
Oh I know :) - I once had to sheepisly admit to the boiler inspector that the old central heating controller broke so I just built my own. They were surprisingly un-judgemental (it was all downstream of a fuse and the pump was interlocked with the heat, plus it was an open loop water circuit blah blah).
Only if used from inside the FPGA with acceleration; otherwise the latency to access the DDR3 becomes a problem for reads. That's why the one real benefits is for scrolling at high depth - tons of data not going over NuBus or PDS.
Yeah, I was meaning if your card can move data fast from RAM / CPU to the VRAM and back then you'll get good general performance in most instances. But after that, keeping big moves on the card is a huge advantage.
 
  • Like
Reactions: Melkhior

Melkhior

Tinkerer
Jan 9, 2022
118
72
28
Not implemented yet due to clock limitations of the FPGA - but for the PCB I'm working on I intend to use an external Si5351A and so will be able to hot switch pixel clock up to about 180MHz. I'm also needing to use a TFP410PAP and TPD12S016PWR for the HDMI output otherwise I wouldn't be able to get anywhere near the speeds needed for higher resolutions.
The benefits of the 7-series from Xilinx - programmable PLL/MMCM, plus the ability to do TMDS natively on the pins. Externally I only "need" the TPD12S016 for an HDMI output, the internal PLL/MMCM does the clock generation for all resolution. Entry-level Spartan-7 are not too expensive, Artix-7 a bit more.

Downside, the power circuitry... The IIsiA7 Mini already needs 3 rails, but that's because I used one for both the FPGA's AUX and the DDR2 (both 1.8V) - that's probably the minimum for a 7-series. The 100T/200T from my homebrew project has 1V0 (core), 1V0 (high-performance bank, and in theory a different rail...), 1V2 (high-performance pins, yes two power rails just for those HP banks), 1V35 (DDR3L), 1V8 (AUX), and 3V3 (all the other pins to talk to 3V3 hardware). And a specific order to turn them all on...
 
  • Like
Reactions: phipli

phipli

Active Tinkerer
Sep 23, 2021
402
264
63
The benefits of the 7-series from Xilinx - programmable PLL/MMCM, plus the ability to do TMDS natively on the pins. Externally I only "need" the TPD12S016 for an HDMI output, the internal PLL/MMCM does the clock generation for all resolution. Entry-level Spartan-7 are not too expensive, Artix-7 a bit more.

Downside, the power circuitry... The IIsiA7 Mini already needs 3 rails, but that's because I used one for both the FPGA's AUX and the DDR2 (both 1.8V) - that's probably the minimum for a 7-series. The 100T/200T from my homebrew project has 1V0 (core), 1V0 (high-performance bank, and in theory a different rail...), 1V2 (high-performance pins, yes two power rails just for those HP banks), 1V35 (DDR3L), 1V8 (AUX), and 3V3 (all the other pins to talk to 3V3 hardware). And a specific order to turn them all on...
Yeah - I believe 1024x768 is already technically out of spec for my FPGA - but it copes. I have a Spartan dev board of some sort somewhere. I forget what model it is. I don't expect it to be a particularly fancy one. From a previous learning FPGAs project - weirdly what I've always struggled with is being forced to uninstall the IDEs due to their excessive size!
That was one of the benefits of these dev boards, the opensource toolchain is much more harddisk friendly.