Page Index Toggle Pages: 1 Send TopicPrint
MegaSTE cache (Read 1928 times)
tobe
RoMzkiddiEz
*
Offline


Des filles ! Des filles
!

Posts: 6
Joined: 13.05.07
MegaSTE cache
16.05.07 at 10:53:38
Print Post  
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 Cheesy \o\ |o| /o/
« Last Edit: 16.05.07 at 10:54:04 by tobe »  
Back to top
 
IP Logged
 
ggn
D-Bug member
Reboot Member
*****
Offline


D-Bug debugger

Posts: 1465
Location: Somewhere in Greece
Joined: 22.02.07
Gender: Male
Re: MegaSTE cache
Reply #1 - 16.05.07 at 13:19:12
Print Post  
Hi Tobe! How's your game going? Wink

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
Select All
$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) --------------------'|
 



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 Wink. I'll be very interested in your findings, since we can maybe tweak some stuff for the MegaSTE specific, which would rock Smiley
« Last Edit: 16.05.07 at 13:19:34 by ggn »  
Back to top
 
IP Logged
 
Cyprian
RoMzkiddiEz
*
Offline


D-BUGer

Posts: 5
Location: Warsaw/Poland
Joined: 29.07.07
Re: MegaSTE cache
Reply #2 - 29.07.07 at 11:14:34
Print Post  
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 Cheesy \o\ |o| /o/

Hi Tobe,
Have you checked it?
  
Back to top
WWW  
IP Logged
 
ggn
D-Bug member
Reboot Member
*****
Offline


D-Bug debugger

Posts: 1465
Location: Somewhere in Greece
Joined: 22.02.07
Gender: Male
Re: MegaSTE cache
Reply #3 - 29.07.07 at 11:54:02
Print Post  
I knew I read this somewhere, now I found a reference Wink

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 Smiley
  
Back to top
 
IP Logged
 
Cyprian
RoMzkiddiEz
*
Offline


D-BUGer

Posts: 5
Location: Warsaw/Poland
Joined: 29.07.07
Re: MegaSTE cache
Reply #4 - 29.07.07 at 13:58:43
Print Post  
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 Smiley


are you sure?
cache should be able to catch write words, too.
« Last Edit: 29.07.07 at 14:02:27 by Cyprian »  
Back to top
WWW  
IP Logged
 
ggn
D-Bug member
Reboot Member
*****
Offline


D-Bug debugger

Posts: 1465
Location: Somewhere in Greece
Joined: 22.02.07
Gender: Male
Re: MegaSTE cache
Reply #5 - 29.07.07 at 14:48:54
Print Post  
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 Smiley


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?
  
Back to top
 
IP Logged
 
Cyprian
RoMzkiddiEz
*
Offline


D-BUGer

Posts: 5
Location: Warsaw/Poland
Joined: 29.07.07
Re: MegaSTE cache
Reply #6 - 29.07.07 at 21:01:02
Print Post  
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
  
Back to top
WWW  
IP Logged
 
ggn
D-Bug member
Reboot Member
*****
Offline


D-Bug debugger

Posts: 1465
Location: Somewhere in Greece
Joined: 22.02.07
Gender: Male
Re: MegaSTE cache
Reply #7 - 30.07.07 at 06:27:32
Print Post  
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.
  
Back to top
 
IP Logged
 
Cyprian
RoMzkiddiEz
*
Offline


D-BUGer

Posts: 5
Location: Warsaw/Poland
Joined: 29.07.07
Re: MegaSTE cache
Reply #8 - 30.07.07 at 08:26:40
Print Post  
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
  
Back to top
WWW  
IP Logged
 
Dbug
RoMzkiddiEz
*
Offline


D-BUGer

Posts: 15
Joined: 23.03.09
Re: MegaSTE cache
Reply #9 - 23.03.09 at 19:17:06
Print Post  
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.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
 
  « Board Index ‹ Board  ^Top