VOGONS


First post, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie

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
362 views
File license
Public domain
Last edited by mkarcher on 2021-10-11, 19:09. Edited 1 time in total.

Reply 1 of 10, by Disruptor

User metadata
Rank Member
Rank
Member

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 10, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie
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 10, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie

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 10, 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 10, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie
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 10, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie

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 10, 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 10, by mkarcher

User metadata
Rank Oldbie
Rank
Oldbie
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...