gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Penalty for self-modifying code in ITCM?

#149505 - Dwedit - Mon Jan 21, 2008 8:49 am

What is the cycle penalty for using self-modifying code in ITCM?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#149507 - chishm - Mon Jan 21, 2008 9:37 am

ITCM is single ported, which is why you have a 1 cycle penalty when loading data from ITCM instead of DTCM from code within ITCM. It's just a guess, but I'd say you'd have the same 1 cycle penalty when writing data to ITCM. Don't forget about the instruction pipeline either.
_________________
http://chishm.drunkencoders.com
http://dldi.drunkencoders.com

#149509 - PypeBros - Mon Jan 21, 2008 10:23 am

chishm wrote:
Don't forget about the instruction pipeline either.


there's the procedure for self-modifying code in ITCM on this link, iirc. The good news is that it should still be preferrable to do self-modifiying code in ITCM than in "regular" memory, since the ITCM is its own cache (less flushes/invalidates required).
_________________
SEDS: Sprite Edition on DS :: modplayer