Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Plru Docs #249

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Add Plru Docs #249

wants to merge 16 commits into from

Conversation

MahirAbbas
Copy link
Contributor

No description provided.

@MahirAbbas MahirAbbas marked this pull request as draft March 30, 2024 13:25
@Dolu1990
Copy link
Member

Dolu1990 commented Apr 1, 2024

Hi ^^

I would say, the PLRU thing should be documented independently of the Plugin / pipeline framework.

  val io = new Bundle{
    val context = new Bundle{
      //user -> plru, specify the current state
      val state = Plru.State(entries) 
      //user -> plru, allow to specify prefered entries to remove. each bit set mean : "i would prefer that way to not to be selected by PLRU"
      val valids = withEntriesValid generate Bits(entries bits) 
    }
    val evict = new Bundle{
      //PLRU -> user, Tells you the least recently used entry for the given context provided above
      val id =  UInt(log2Up(entries) bits)
    }
    val update = new Bundle{
      // user -> PLRU specify which entry the user want to mark as most recently used
      val id = UInt(log2Up(entries) bits)
     // PLRU -> user specfy what should then be the new value of the PLRU status 
      val state = Plru.State(entries)
    }
  }

@MahirAbbas
Copy link
Contributor Author

Yeah i just copied those over for notes, i was planning to update it so that it's independent of anything else

@MahirAbbas
Copy link
Contributor Author

I haven't fully got round to using it so I won't be able to document it all now. Once I understand it's usage better I should be able to add more docs.

@Dolu1990
Copy link
Member

Dolu1990 commented Apr 1, 2024

That PLRU utils doesn't contain any state, only combinatorial behaviour, usefull in the control logic of a cache to figure out what way to evict, and also logic to update the PLRU with the last way usage

@MahirAbbas MahirAbbas marked this pull request as ready for review April 2, 2024 10:35
@MahirAbbas
Copy link
Contributor Author

@Dolu1990 is there anything else you want to add or would you be happy with these docs?

val ram = Mem.fill(nSets)(Plru.State(wayCount))
val write = ram.writePort
val fromLoad, fromStore = cloneOf(write)
write.valid := fromLoad.valid || fromStore.valid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say, this is when you have two pipeline (one load and one store) which want to update the PLRU state.
For the doc itself, we shouldn't have that complexity.

There is two example of PLRU usage you may haven't seen :

@MahirAbbas MahirAbbas marked this pull request as draft April 16, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants