• H
    asid: add asid, mainly work when hit check, not in sfence.vma (#1090) · 45f497a4
    happy-lx 提交于
    add mmu's asid support.
    1. put asid inside sram (if the entry is sram), or it will take too many sources.
    2. when sfence, just flush it all, don't care asid.
    3. when hit check, check asid.
    4. when asid changed, flush all the inflight ptw req for safety
    5. simple asid unit test:
    asid 1 write, asid 2 read and check, asid 2 write, asid 1 read and check. same va, different pa
    
    * ASID: make satp's asid bits configurable to RW
    * use AsidLength to control it
    
    * ASID: implement asid refilling and hit checking
    * TODO: sfence flush with asid
    
    * ASID: implement sfence with asid
    * TODO: extract asid from SRAMTemplate
    
    * ASID: extract asid from SRAMTemplate
    * all is down
    * TODO: test
    
    * fix write to asid
    
    * Sfence: support rs2 of sfence and fix Fence Unit
    * rs2 of Sfence should be Reg and pass it to Fence Unit
    * judge the value of reg instead of the index in Fence Unit
    
    * mmu: re-write asid
    
    now, asid is stored inside sram, so sfence just flush it
    it's a complex job to handle the problem that asid is changed but
    no sfence.vma is executed. when asid is changed, all the inflight
    mmu reqs are flushed but entries in storage is not influenced.
    so the inflight reqs do not need to record asid, just use satp.asid
    
    * tlb: fix bug of refill mask
    
    * ci: add asid unit test
    Co-authored-by: NZhangZifei <zhangzifei20z@ict.ac.cn>
    45f497a4
XSCore.scala 14.5 KB