Hello ~
I saw the following information while referring to the document(R01US0015EJ0230 rev 2.30 page 40).
"Remark This number of clocks is for when the program is in the internal ROM (flash memory) area. When fetching aninstruction from the internal RAM area, the number of clocks is four times the number of clocks plus 6,maximum."In general, I know that when the code is performed in Ram, the execution speed is faster than flash XIP.However, in renesas RL78, I am confused to see that performing instruction in Ram is four times slower than performing in flash.
Did I misunderstand the document?
Code execution from RAM is faster for MPUs using external non-volatile memory to store the application. In such cases the application is copied from external memory to RAM during boot-process. In case of RL78 code execution is typically done directly from internal Flash Memory and no copying is necessary. Code execution from RAM is only necessary in special uses cases, e.g. self-programming of the Flash Memory. The RL78 RAM is optimized for fast data-access and the Flash memory for fast code execution.Your understanding of the manual is correct, Code execution from RAM is slower than from FLASH in case of RL78.
Hello Fragero.
First of all, thank you for your kind explanation.
In almost all flashes where XIP is supported, code execution speed is dramatically faster in RAM.
This is because the read speed of RAM is faster than the read speed of flash.
From this point of view, I do not understand that the operating speed in ram is four times slower than flash.
I think there are reasons such as the difference in bus clk used in flash and ram, or the limitation of ram of RL78.
I also assume that this is caused by bus clk and addition bus-interfaces. But as I explained, in case of RL78 code is executed from FLASH in normal operation mode and not from RAM. Therefore a slower code execution from RAM is no disadvantage.
I think the fact that Ram is slow is obvious disadvantage.As you know, when writing nonvolatile data in flash or self updating, you have to perform code in ram.It is clearly disadvantageous that RAM is four times slower than flash, and this is a point to consider when designing a system.
Anyway, thank you Fragero for checking that code execution is slow in RAM.
Sir. Renesas, if you know the root cause, please reply.
PV_Renesas
Just to add to what already Fragero has mentioned: