exxos wrote: 19 Apr 2022 16:35
Normal version.
Cache version.
Thing is, there is no ST-RAM cache code in my 536 yet....
Could still make sense. The 68030 doesn't care about the CIIN pin when it comes to writes.
(It will also actually ignore the pin even on reads, if what it attempts to read is already in the cache)
The only case it actually cares about that pin is when the cpu is doing a read from something that is not in the cache already.
Personally I find it a bit crap/odd.. but that's what Motorola decided :)
So with maprom not cache-inhibiting ST-RAM, writes will actually make the data end up in the cache.
And subsequent readbacks from these will retrieve from cache if they're still in it..
The firmware change is needed so cpu-reads can put things in cache too.
exxos wrote: 19 Apr 2022 16:35
With ST-RAM cache enabled in code:
Oddly seems slower. :shrug: I might have screwed the code up :shrug:
You should be able to verify if your firmware side is working by running Gembench from ST-RAM.
If everything is working it should give you an integer-division score of 1729 exactly like when you run it from alt-ram.
You should also notice a pretty nice speed boost in Hard Drivin, Driller or other 3D games that has to run from ST-RAM (remember have cache enabled in TOS)
But the result you got actually mirrors my result so I think it's working?
My previous best result in Gembench (run from alt-ram, have st-ram relocation enabled in maprom) became slower with ST-RAM cache enabled.
Possibly things fighting over space in the cache, causing additional misses which makes some of the tests slower than if it had no cache. Don't really know :)
All my other variations of Gembench tests became quicker with ST-RAM cache enabled though, sometimes by quite a bit.
There is really no "best everywhere" when it comes to caches, especially when dealing with software that was written before caches existed.
Having a cache can easily be detrimental to performance if the software is cache-unfriendly enough.
A miss costs 8x of what a normal read does. A hit on the other hand, is extremely fast.
A miss fills 16 bytes into the cache though, potentially allowing for multiple subsequent hits unless the software is "jumping all over the place" in memory and constantly trashes the cache..
It all depends on the software and what ratio of hits/misses it produce.
Generally speaking, it'll most likely give you an overall net gain.
For things dealing mostly with alt-ram I don't think you'll gain anything though.
Maprom is already relocating a bunch of the low st-ram to fastram so that area wont benefit from the cache.
Running something from ST-RAM is where it will make a huge difference.
I think it's absolutely worth it.
Most games are unable to run from altram, and these can get a pretty huge boost in performance.
The few that are alt-ram optimised (are there any other than Frontier?) are sufficiently fast already so even if the performance increase is zero or if it makes a benchmark a small bit slower I think it's worth it for bumping the performance on the lower-end of the spectrum?