Do microcontrollers have cache?

  • Thread starter Thread starter EvLer
  • Start date Start date
Click For Summary

Discussion Overview

The discussion centers around whether microcontrollers (uCs) have cache, exploring the differences between RISC and CISC architectures and their implications for cache usage. Participants also inquire about the usefulness of not having cache and what alternatives exist.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants suggest that whether microcontrollers have cache depends on the architecture, noting that RISC architectures typically use cache while CISC architectures may not.
  • One participant expresses uncertainty about the prevalence of cache in CISC architectures.
  • A participant raises a question about the usefulness of not having cache and what alternatives are used in such cases.
  • Another participant provides a link to a tutorial discussing RISC and CISC architectures, explaining that RISC aims for simpler instructions and faster execution, which justifies the use of cache.
  • The tutorial mentions that RISC processors can execute instructions more quickly than CISC processors, which may require multiple cycles for instruction fetching.
  • It is noted that cache can be expensive and is used when performance enhancements justify the cost, particularly in RISC architectures.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the presence of cache in microcontrollers, as opinions vary based on architecture type. The discussion remains open regarding the usefulness of not having cache and the alternatives available.

Contextual Notes

There are limitations in the discussion regarding the specific types of microcontrollers being referenced and the varying definitions of cache across different architectures. The implications of performance trade-offs in relation to cache usage are also not fully resolved.

EvLer
Messages
454
Reaction score
0
Do microcontrollers have cache?
 
Engineering news on Phys.org
Depends on the uC. RISC architectures typically use cache, but I don't think it's common for CISC architectures. Not sure about that though. Do you have a uC in mind?
 
no, not really, just was wondering when someone asked me i could not think if they do or not. But thanks! now at least i know that they may or may not.
 
one more question: what is usefulness in NOT having cache or what is used in place of it?
Thanks!
 
I googled risc cisc cache tutorial, and got some great hits. Here's the first one:

http://www.laynetworks.com/RISC.htm

The goal with a RISC architecture is to have fewer and simpler instructions in the instruction set. As they say on that web page, ideally your RISC processor should be able to execute one of its instructions per clock cycle, versus many cycles in traditional CISC processors. In a traditional CISC processor, you spend several minor cycles fetching the first part of the instruction, then figure out if there is more to fetch (multi-word instructions like long jumps or add immediates), then mess around some more, then finally perform the instruction.

But since the RISC architecture is aimed at executing one simple instruction per clock cycle, it can gobble up data much faster than a CISC processor, so internal fast cache is used as a pipeline to keep the RISC engine running at full speed. But as with any pipeline architecture, if you get an unanticipated branch, you have to empty the pipe and start re-filling it, which lowers the effective speed of the processor.

You can have several levels of cache, with the smallest and fastest on the processor silicon itself, and an intermediate cache off-chip that is fed by the main RAM section of the motherboard. Since cache needs to be fast, it is expensive to use, and you only use it if you can justify the cost from the performance enhancement angle. With a CISC processor, you usually just have RAM outside and no justification for pipeline cache.
 
Last edited by a moderator:

Similar threads

Replies
2
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K