Skip to main content
gbm
Super User
July 1, 2026
Question

Incorrect statement in STM32U3, STM32H5, STM32U5 docs

  • July 1, 2026
  • 6 replies
  • 183 views

While looking at STM32U3C5 and STM32H503 datasheets I found incorrect information on ICACHE. Quote:

Hit ratio improved by two-ways set-associative architecture and pLRU-t
replacement policy (pseudo-least-recently-used, based on binary tree), algorithm
with best complexity/performance balance

 

The problem is: pseudoLRU may only be applied to 3- (or more) way set-associative caches. With 2-way set-associative, the single flip-flop per set provides true LRU and there is no such thing like “pseudoLRU” for 2 ways. You can’t do binary tree with a single flip-flop.  PseudoLRU is normally used with 4 or more ways, since for 4 ways pseudoLRU requires 3 flip-flops organized as 2-level tree, with simple state transition logic while true LRU - 4 flip-flops and 12 states with much more complex state transition logic.

I suspect the same error might be present in all the STM32 documents describing MCU caches which are 2-way set-associative.

6 replies

mƎALLEm
ST Technical Moderator
July 1, 2026

Hello,

Need to check internally.

I’ll get back to you as soon as I have a feedback.

Internal ticket for follow-up: CDM0063991

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
mƎALLEm
ST Technical Moderator
July 3, 2026

Hello and here is the feedback from the team:

The phrase was meant to express that both elements independently :

  • two-ways set-associative architecture
  • pLRU replacement policy

Contribute to improve hit ratio

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
gbm
gbmAuthor
Super User
July 3, 2026

But there is NO psedoLRU in this cache design. PseudoLRU is simply not possible with associativity below 4, so the statement is pure mistake.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
mƎALLEm
ST Technical Moderator
July 9, 2026

Hello,

Here is the feedback from the team:

“Pseudo-LRU behaves like true LRU when the associativity is below 4.
The statement in the Datasheet : "Hit ratio improved by two-ways set-associative architecture and pLRU-t replacement policy (pseudo-least-recently-used, based on binary tree), algorithm with best complexity/performance balance"

Therefore the statement is generic and it is correct.

Hope that answered your question.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
gbm
gbmAuthor
Super User
July 10, 2026

Well, it wasn’t a question, it was an observation.

The bottom line is: it is simply LRU - real, true LRU, not pseudoLRU. So calling it “pseudoLRU” is a mistake. PseudoLRU is used when true LRU cannot be efficiently implemented - typically with 4 or more cache ways. And there is no binary tree of flip-flops with 2-way cache, so that’s yet another mistake.

Of course you may call the light switch in your room “a single-level binary tree of switches, improving the light control using pseudo on/off control” but I believe that “the on/off light switch” name suits and describes it better.

;)

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
David Littell
Senior II
July 10, 2026

Give it up, hahaha!  This is the same mindset that decides decades-old cache terminology “flush” is now henceforth to be known as “clean”.  Can’t help ‘em.  🙄