D-Bug & Automation Forum
D-Bug & Automation Forum >> Coding >> MegaSTE cache
https://d-bug.mooo.com/dbugforums/cgi-bin/yabb2/YaBB.pl?num=1179312820

Message started by tobe on 16.05.07 at 10:53:38

Title: MegaSTE cache
Post by tobe on 16.05.07 at 10:53:38
Hey,

I'm looking for infos about the MegaST(e) cache... How it works... How can I optimize my code for it...
I'm pretty curious about it, I'm going to try to execute code while the blitter is running, maybe it's possible, I don't think the blitter access the cache so... well... since the cpu access the cache we don't care if the blitter locks the bus... maybe... and then... you can imagine :D \o\ |o| /o/

Title: Re: MegaSTE cache
Post by ggn on 16.05.07 at 13:19:12
Hi Tobe! How's your game going? ;)

Well, from what I gathered so far from reading various sources, the MSTE has a fairly large cache (I think it's 16k?????). Anyway, the way to control it is through a hardware register as you may already know:

[code]$FF8E21|byte |Mega STe Cache/Processor Control           BIT 15-1 0|R/W (MSTe)
      |     |Cache enable lines (set all to 1 to enable) -----'  ||
      |     |CPU Speed (0 - 8mhz, 1 - 16mhz) --------------------'|
[/code]

Some speculate that this is false and that only bits 0 and 1 are used. I guess noone took the pain to test this behaviour, and that includes us ;). I'll be very interested in your findings, since we can maybe tweak some stuff for the MegaSTE specific, which would rock :)

Title: Re: MegaSTE cache
Post by Cyprian_K on 29.07.07 at 11:14:34

tobe wrote on 16.05.07 at 10:53:38:
Hey,

I'm looking for infos about the MegaST(e) cache... How it works... How can I optimize my code for it...
I'm pretty curious about it, I'm going to try to execute code while the blitter is running, maybe it's possible, I don't think the blitter access the cache so... well... since the cpu access the cache we don't care if the blitter locks the bus... maybe... and then... you can imagine :D \o\ |o| /o/

Hi Tobe,
Have you checked it?

Title: Re: MegaSTE cache
Post by ggn on 29.07.07 at 11:54:02
I knew I read this somewhere, now I found a reference ;)

ZWF's Atari STE fanpage has Paranoid's excellent STE programmer's documents, and on page 6 I found the following:


Quote:
 ? How fast is the Mega STE at 16 MHz without the cache ?

 ! Unfortunately, not very much faster than an ordinary 8 MHz STE. The cache might seem small according to todays standard (16 KBytes), but for a system like the Mega STE, it reduces memory accesses dramatically. If you turn off the cache, the 68000 has to fetch everything directly over the 8 MHz bus. Only operations that completely work in the 68000's registers will gain performance.


So if you don't have bus write cycles during the blitter execution, then I guess you can use the cache like that :)

Title: Re: MegaSTE cache
Post by Cyprian_K on 29.07.07 at 13:58:43

ggn wrote on 29.07.07 at 11:54:02:

So if you don't have bus write cycles during the blitter execution, then I guess you can use the cache like that :)


are you sure?
cache should be able to catch write words, too.

Title: Re: MegaSTE cache
Post by ggn on 29.07.07 at 14:48:54

Cyprian wrote on 29.07.07 at 13:58:43:

ggn wrote on 29.07.07 at 11:54:02:

So if you don't have bus write cycles during the blitter execution, then I guess you can use the cache like that :)


are you sure?
cache should be able to catch write words, too.


Well, if the cache shares the same bus with the blitter, and the blitter is hogging it, wouldn't the cache create a bus stall if it tries to write at that moment?

Title: Re: MegaSTE cache
Post by Cyprian_K on 29.07.07 at 21:01:02
probably yes,
but with 16kbytes cache, should be possible to cache  4Kbyte instructions who generate 12Kbyte data without flushing their to main memory. e.g c2p

Title: Re: MegaSTE cache
Post by ggn on 30.07.07 at 06:27:32

Cyprian wrote on 29.07.07 at 21:01:02:
probably yes,
but with 16kbytes cache, should be possible to cache  4Kbyte instructions who generate 12Kbyte data without flushing their to main memory. e.g c2p


Agreed, but I don't know how the cache operates. For example, when the cache starts flushing data into RAM. My suspicion is that the flushing occurs as soon as possible and if that's true then you can have a stall immediately. Tests are required for that.

Title: Re: MegaSTE cache
Post by Cyprian_K on 30.07.07 at 08:26:40

ggn wrote on 30.07.07 at 06:27:32:

Agreed, but I don't know how the cache operates. For example, when the cache starts flushing data into RAM. My suspicion is that the flushing occurs as soon as possible and if that's true then you can have a stall immediately. Tests are required for that.


definitely, we need to learn the ropes how to manage megaste cache.
IMO, blitter and cache are the most underappreciate part of STE

Title: Re: MegaSTE cache
Post by Dbug on 23.03.09 at 19:17:06
I believe the cache is write-through, in which case whatever is written will go directly to the main memory. The cache is really just a way to speed up reads.

But I may be wrong.

D-Bug & Automation Forum » Powered by YaBB 2.6.0!
YaBB Forum Software © 2000-2022. All Rights Reserved.