mortbopet / Ripes

A graphical processor simulator and assembly editor for the RISC-V ISA

Home Page:https://ripes.me/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Cache Replacement Policy

tinhanho opened this issue · comments

Hi @mortbopet,
I find that contributing to the cache replacement policy is a good way to work with. The replacement policy which possesses from now on are Random and LRU. Intuitively, FIFO can be added and it has been done through few lines of code. What I am doing now is trying to add policy like least frequently used. However, I cannot find out where the code is to expand the slot just like LRU doing. For example, when 2 ways cache used, you click Repl. policy LRU and the LRU slots show up.
image

I guess that it might be the UI problem but I do not know how to modify it. Could you help me?

You can review line 440 in the incachegraphic.cpp file within issue #335, and you'll discover the relevant information there.

if (m_cache.getReplacementPolicy() == ReplPolicy::LRU && m_cache.getWays() > 1)