VOGONS


First post, by mkarcher

User metadata
Rank l33t
Rank
l33t

Due to some discussions on different BIOS contents for CL-GD5429 graphics card, I coded a simple memory clock adjust utility for Cirrus Logic chips between 5424 and 5429. The 5425 is explicitly unsupported, because it is focussed on TV genlock applications, and thus (a) not typically used in VGA-like PC applications, and (b) might be run at a different reference frequency than 14.318 MHz, I guess for PAL applications.

You can find the source code for the tool at my github project CLMCLK, or just download the compiled version from the 1.1 release.

Memory clocks matters, even in VGA modes. I measured performance in different modes (text, VGA 16- and 256-color modes, and 800x600 with 256 colors at 56Hz) at different MCLK values at FSB40 on a later VL system (using the Opti 895 chipset). I don't know whether these performance values are applicable for FSB33 operation or different chipsets. On that board, the cirrus card seems to be limited to 5 VL clock cycles per access. As the Cirrus CL-GD542x chips only have 16 data bits on the host bus, this limits the data rate to 8MB/s for 8-bit cycles and to 16MB/s for 16-bit cycles. 32-bit cycles automatically get downgraded to two 16-bit cycles, so the limit is 16MB/s as well.

CL-GD5429-performance.PNG
Filename
CL-GD5429-performance.PNG
File size
71.75 KiB
Views
2004 views
File license
Public domain
Last edited by mkarcher on 2021-10-11, 19:09. Edited 1 time in total.

Reply 1 of 27, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie

Run CLMCLK without parameter to read the current frequency.
Run CLMCLK 50 to set memory clock to 50 MHz.
Usage of this tool is at your own risk.
Remember to read the datasheet of your cirrus chip and your memory modules to find a proper setting.

Listed values are taken from heise's ctcm 1.7a

Reply 4 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t
Chadti99 wrote on 2021-10-12, 09:13:

Very cool, def going to try this!

Slightly off topic, is it possible to adjust memory clocks for any other old VLB and PCI video cards from S3 or Ark?

I never had an Ark card at hand, but every card that uses page mode and a FIFO to accellerate video RAM access needs to have a dedicate RAM clock. This also includes the well-known Tseng Labs ET4000 cards. Having a dedicated RAM clock doesn't necessarily mean the RAM clock is adjustable in software, though. For example, most ET4000 ISA designs use a fixed 40MHz clock for RAM access (Tesng calls it the "system clock"). For cards without integrated frequency synthesizers, switching between different RAM clocks, if possibly at all, is usually vendor dependent. Cards with integrated PLLs, like the S3 cards starting with the "Trio" chip (called that way, because it integrates the three components clocksynth, RAMDAC, and graphics chip), software-adjustable memory clock is a thing. I am definitely going to test memory clock adjustment on Virge Cards the next months. If something useful results, results will be published as open source, and a pointer posted on VOGONS. Stay tuned!

Reply 5 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t

A more elaborate MCLK tool for a wide variety of cards already exists, with source code, see http://files.mpoli.fi/unpacked/hardware/displ … er/mclk093b.zip for individually browsing files or http://files.mpoli.fi/hardware/DISPLAY/OTHER/MCLK093B.ZIP to download the complete ZIP. I'm not affiliated with the author of that tool.

Reply 6 of 27, by Rita's Cafe

User metadata
Rank Newbie
Rank
Newbie
mkarcher wrote on 2021-10-11, 18:31:

Due to some discussions on different BIOS contents for CL-GD5429 graphics card, I coded a simple memory clock adjust utility for Cirrus Logic chips between 5424 and 5429.

Interesting. I own three CL-GD5429 based VLB cards and all have the same 1.00A ROM. And I once searched for a newer ROM but couldn't find one.

From memory, the datasheet for the 542X says that the highest clock is 60MHz for the 5429 with the others being lower (50MHz?). But your chart goes beyond 65MHz. Is this safe to do? Does it automatically add wait states where needed?

BTW how did you record this data? I'd like to try benchmarking my VLB cards at 33MHz & 40MHz FSB.

Reply 7 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t
Rita's Cafe wrote on 2021-10-14, 05:04:
mkarcher wrote on 2021-10-11, 18:31:

Due to some discussions on different BIOS contents for CL-GD5429 graphics card, I coded a simple memory clock adjust utility for Cirrus Logic chips between 5424 and 5429.

Interesting. I own three CL-GD5429 based VLB cards and all have the same 1.00A ROM. And I once searched for a newer ROM but couldn't find one.

That's also the ROM I used on Disruptor's card where I benched those values. I compared that ROM with the ROM dump that recently appeared in different thread and found out that despite being the same version, one byte is different - it's the MCLK initialization value which is customizable by card vendors.

Rita's Cafe wrote on 2021-10-14, 05:04:

From memory, the datasheet for the 542X says that the highest clock is 60MHz for the 5429 with the others being lower (50MHz?). But your chart goes beyond 65MHz. Is this safe to do? Does it automatically add wait states where needed?

You are right. I recklessly exceeded the specified frequency, i.e. I overclocked the memory interface of the 5429. I can't tell you whether this might cause local overheating of the chip or accelerate the aging process and cause premature failure of the graphics controller. Use it at your own risk. I can tell you that I didn't observe any kind of garbage on the screen, though.

The chip doesn't add wait states to the RAM interface based on the MCLK. It does have a configuration strap (not overridable in software) that adds a wait state on page misses. The recommendation by Cirrus is to make use of the extra wait state on page misses to allow higher MCLK timings, that still work on page hits (the common case). Indeed, Disruptor's card uses the extra wait state (7MCLK RAS cycle), as likely most CL-GD5429 cards do. Page hits should be rare, so the performance loss by this wait state is likely insignificant in most use cases.

Rita's Cafe wrote on 2021-10-14, 05:04:

BTW how did you record this data? I'd like to try benchmarking my VLB cards at 33MHz & 40MHz FSB.

I used CTCM, a cache benchmark by the German c't magazine. It can measure video transfer speeds if you call it with "/VID", but it comes with a couple of pecularities so I wouldn't generally recommend it. For example even on VESA 1.2 BIOSes, the tool tries to bench 800x600 (256 colors) in LFB mode by default. That mode gets rejected by the BIOS, and the result is that the tool benches mode $13 twice, but calls it 800x600 in the result table. You need to specify "/vid=$103" to prevent it. The values I recorded are the MOVSB and MOVSD speeds, measured on L1 cache hits, which are nearly identical to STOSB/STOSD speeds. If you need a simple low level performance benchmark tool, I recommend VIDSPEED instead. As this low-level bench is very well defined (well, there is only one kind of REP STOSD...), the tool performing the test is likely irrelevant and the data is comparable even across different tools. I benchmarked modes $13 (VGA 256-color), $103 (not running CLMODE before, so at 56 Hz), $12 (VGA 16-color) and 3 (text). The byte performance of $13 and $12 is identical, so I merged those two values into "VGA bytes", not specifying the color count.

Reply 8 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t

And, if you try to use CTCM for main memory performance, be aware of another annoying bug: Recent versions try to display memory performance when using 64-bit MMX memory access instructions for comparison, even if the primary benchmark target is measuring string instruction performance. There is a check in place to run this reference measurement only on MMX-capable processors, but that check is bugged and doesn't work at all, crashing the 486 system while it says "MMOVI" at the bottom of the screen. You need to specify "/NOP" to avoid this extra measurement. This bug is irrelevant if you use CTCM for video performance only. You don't need to specify /NOP when you specify /VID.

Reply 9 of 27, by Rita's Cafe

User metadata
Rank Newbie
Rank
Newbie

This is fascinating. If you're interested I can provide a ROM dump for a 5429 that defaults to 57MHz (57.27MHz I think).

When I get some spare time I'll try out CTCM and VIDSPEED. Ordinarily I just use Phil's pack for benchmarking... until now.
I have two 5429s that are accessible. One has 2x 512, the other has 8x128. Both 70ns.

Is there a formula to determine MCLK frequency/wait states for 70ns and 60ns? I've been meaning to desolder my 70ns chips and put in some spare 60ns.

Reply 10 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t
Rita's Cafe wrote on 2021-10-14, 06:41:

This is fascinating. If you're interested I can provide a ROM dump for a 5429 that defaults to 57MHz (57.27MHz I think).

I'm not really interested. I guess it's just a single byte difference to BIOSes that default to other clocks, and you can easily calculate what that value would be. You can verify that theory by comparing the ROM dumps of your two 5429 cards.

Rita's Cafe wrote on 2021-10-14, 06:41:

Is there a formula to determine MCLK frequency/wait states for 70ns and 60ns? I've been meaning to desolder my 70ns chips and put in some spare 60ns.

Get the Cirrus 542x data sheet from the usual data sheet archive sites. Read Appendix B-19. It goes great lengths on how you can calculate the RAM timing requirements from the RAM clock and compares it to timings of 70ns RAM chips by different vendors.

Or you do the rule-of-the-thumb calculation: 60ns is 14% faster than 70ns, so you might turn up the clock from 50MHz to 57MHz. Let's guess: your 57MHz card uses 60ns RAM...

Reply 12 of 27, by Disruptor

User metadata
Rank Oldbie
Rank
Oldbie
Siran wrote on 2023-07-21, 12:13:

I'm trying to find a download source for ctcm 1.7a - heise.de only directs to an empty page. I could only find older versions. Does anyone have a current one? I'd like to test my CL-GD5429.

Thanks!

https://ftp.heise.de/ct/ctsi/ctcm17a.zip

Reply 14 of 27, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Since we're discussing c't utilities.. There's also 'Testbild' from the 1980s..
Just for the sake of completeness.. c't used to be good. 🙂
Re: XT video test

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 15 of 27, by BitWrangler

User metadata
Rank l33t++
Rank
l33t++

Awww man, how did I miss this before, always been waving my arms around like a conspiracy theorist with the "Some GD54xx implementations are faster than others, because reasons..."

Though I also knew about Tomi Engdahls VGA>>>TV stuff from way back and a util to prod clocks down to PAL/NTSC range there, and read up a bit on that, but didn't put together the memory clock thing. ... even knowing that cards with 80ns RAM on usually sucked and 60ns ones were better... and ppl telling me "it runs the same speed anyway." so nope it don't.

I gotta put a big flashing neon mental bookmark on this for when I'm playing with 60Mhz VLB again, extreme Cirrus hotrodding to be in sync with VLB might be interesting.

Unicorn herding operations are proceeding, but all the totes of hens teeth and barrels of rocking horse poop give them plenty of hiding spots.

Reply 16 of 27, by Siran

User metadata
Rank Newbie
Rank
Newbie
BitWrangler wrote on 2023-07-21, 16:06:

Though I also knew about Tomi Engdahls VGA>>>TV stuff from way back and a util to prod clocks down to PAL/NTSC range there, and read up a bit on that, but didn't put together the memory clock thing. ... even knowing that cards with 80ns RAM on usually sucked and 60ns ones were better... and ppl telling me "it runs the same speed anyway." so nope it don't.

Funny thing - my GD5429 even has 50ns memory chips. Albeit it's an ISA card. It's clocked at 46.54MHz on startup, I pushed it to 55MHz but I guess the ISA bus is hard-limiting pretty much any speed increase since I could barely measure an increase in VGA performance. Would also explain the very conservative standard memory clock since the 5429 is rated up to 60MHz afaik and the 50ns memory should also support it.

Reply 18 of 27, by mkarcher

User metadata
Rank l33t
Rank
l33t
kixs wrote on 2023-07-21, 21:09:

Try Windows benchmarks (Winbench, Wintach,...). I would expect at least some performance increase.

Yes. In the early accelerator chips (this includes S3 Virge, at least up to the /DX), the memory clock and the operating clock of the accelerator is identical. This makes a lot of sense, because the early accelerators were just pushing around data read from and written to video memory. The accelerated features (line drawing, rectangle filling, screen-to-screen copy) should scale directly with the memory clock. As long as the Windows graphics driver manages to keep the graphics card busy all the time, the benchmark results of accelerated features should thus also scale linearly with the memory clock.

If the card is only used for DOS gaming, the higher accelerator clock is irrelevant, though. Nevertheless, a higher memory clock can relieve the memory pressure caused by screen refresh at high refresh rates and resolution. At modes like 1024x768, 70Hz, the memory bandwidth left for CPU access might be low enough that you get back pressure even to the ISA bus, especially at low memory clocks.

Reply 19 of 27, by Siran

User metadata
Rank Newbie
Rank
Newbie

Thanks @mkarcher and @kixs for the detailed explanation! As I will use this machine exclusively for DOS gaming I guess overclocking the memory won't make much of a difference except shortening the lifespan of the card. Even though I plan on upgrading the 386 to a 486DX2-66 I don't think 1024x768 will be a resolution I'll use often, if at all. I don't plan on installing Windows 3.11 or even 95 on it either.

Btw here is a picture of the card - don't know the vendor sadly - next to the one it replaced (for picture quality alone it was way worth the change):

20230718_165557.jpg
Filename
20230718_165557.jpg
File size
960.36 KiB
Views
1209 views
File license
Fair use/fair dealing exception