SpinalHDL / SpinalDoc-RTD

The sources of the online SpinalHDL doc
https://spinalhdl.github.io/SpinalDoc-RTD/
Creative Commons Zero v1.0 Universal
25 stars 61 forks source link

Add Plru Docs #249

Open MahirAbbas opened 8 months ago

Dolu1990 commented 8 months ago

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 commented 8 months ago

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

MahirAbbas commented 8 months ago

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 commented 8 months ago

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 commented 7 months ago

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