GenDev SpritesMind Website SpritesMind.Net
Sega Megadrive/Genesis development
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DMA and cache

 
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Super 32X
View previous topic :: View next topic  
Author Message
ob1
Very interested


Joined: 06 Dec 2006
Posts: 362
Location: Aix-en-Provence, France

PostPosted: Sun Feb 28, 2010 9:58 am    Post subject: DMA and cache Reply with quote

Wandering on Bit-Blit, I asked myself something I could not answer.
When reading SDRAM from SH2, reads are done by 8 16-bits words burts, due or for the cache. But how does this run for DMA ?
SH2 has a DMAc, which is mainly used for DREQ, from 68k to 32X, or for PWM (never really used if I got it right).
Anyway, in the case of an intra-32X DMA operation, for example, to copy data from SDRAM to Frame Buffer DRAM, does the DMA read 8 16-bits words burst, even if it just need, let's say 8 bytes ?
Back to top
View user's profile Send private message
Chilly Willy
Very interested


Joined: 17 Aug 2007
Posts: 1960

PostPosted: Sun Feb 28, 2010 6:39 pm    Post subject: Reply with quote

Read the SH7604 Hardware Manual, sections 7.5.3 and 7.5.4. Basically, "bursts" work for 16 byte reads on 16 byte aligned addresses. Cache line fills always fit those requirements, so they always use burst mode. DMA reads will only fit that requirement if the buffer is on a 16 byte boundary, is multiples of 16 bytes, and you use 16 byte mode for the xfer. When you do all that, DMA also uses "burst" mode for reading the data.

Note that the 32X has the SDRAM set for burst mode. This gives rise to wasted cycles on "single reads" as documented in 7.5.4. While burst mode speeds up cache line fetches, single reads can waste six or seven cycles on the bus (8 word bus operations, of which only one or two actually contain useful data). Cache-through reads and DMA operations that don't fit burst mode are single reads, and waste bus cycles as described.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SpritesMind.Net Forum Index -> Super 32X All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group