1. 01 11月, 2022 1 次提交
  2. 13 10月, 2022 1 次提交
  3. 01 9月, 2022 1 次提交
  4. 23 8月, 2022 1 次提交
  5. 18 7月, 2022 1 次提交
    • L
      l1tlb: tlb's req port can be configured to be block or non-blocked (#1656) · f1fe8698
      Lemover 提交于
      each tlb's port can be configured to be block or non-blocked.
      For blocked port, there will be a req miss slot stored in tlb, but belong to
      core pipeline, which means only core pipeline flush will invalid them.
      
      For another, itlb also use PTW Filter but with only 4 entries.
      Last, keep svinval extension as usual, still work.
      
      
      * tlb: add blocked-tlb support, miss frontend changes
      
      * tlb: remove tlb's sameCycle support, result will return at next cycle
      
      * tlb: remove param ShouldBlock, move block method into TLB module
      
      * tlb: fix handle_block's miss_req logic
      
      * mmu.filter: change filter's req.ready to canEnqueue
      
      when filter can't let all the req enqueue, set the req.ready to false.
      canEnqueue after filtering has long latency, so we use **_fake
      without filtering, but the filter will still receive the reqs if
      it can(after filtering).
      
      * mmu.tlb: change name from BTlbPtwIO to VectorTlbPtwIO
      
      * mmu: replace itlb's repeater to filter&repeaternb
      
      * mmu.tlb: add TlbStorageWrapper to make TLB cleaner
      
      more: BlockTlbRequestorIO is same with TlbRequestorIO, rm it
      
      * mmu.tlb: rm unused param in function r_req_apply, fix syntax bug
      
      * [WIP]icache: itlb usage from non-blocked to blocked
      
      * mmu.tlb: change parameter NBWidth to Seq of boolean
      
      * icache.mainpipe: fix itlb's resp.ready, not always true
      
      * mmu.tlb: add kill sigal to blocked req that needs sync but fail
      
      in frontend, icache,itlb,next pipe may not able to sync.
      blocked tlb will store miss req ang blocks req, which makes itlb
      couldn't work. So add kill logic to let itlb not to store reqs.
      
      One more thing: fix icache's blocked tlb handling logic
      
      * icache.mainpipe: fix tlb's ready_recv logic
      
      icache mainpipe has two ports, but these two ports may not valid
      all the same time. So add new signals tlb_need_recv to record whether
      stage s1 should wait for the tlb.
      
      * tlb: when flush, just set resp.valid and pf, pf for don't use it
      
      * tlb: flush should concern satp.changed(for blocked io now)
      
      * mmu.tlb: add new flush that doesn't flush reqs
      
      Sfence.vma will flush inflight reqs and flushPipe
      But some other sfence(svinval...) will not. So add new flush to
      distinguish these two kinds of sfence signal
      
      morw: forget to assign resp result when ptw back, fix it
      
      * mmu.tlb: beautify miss_req_v and miss_v relative logic
      
      * mmu.tlb: fix bug, when ptw back and bypass, concern level to genPPN
      
      bug: when ptw back and bypass, forgot to concern level(1GB/2MB/4KB)
      when genPPN.
      
      by the way: some funtions need ": Unit = ", add it.
      
      * mmu.filter: fix bug of canEnqueue, mixed with tlb_req and tlb.req
      
      * icache.mainpipe: fix bug of tlbExcp's usage, & with tlb_need_back
      
      Icache's mainpipe has two ports, but may only port 0 is valid.
      When a port is invalid, the tlbexcp should be false.(Actually, should
      be ignored).
      So & tlb_need_back to fix this bug.
      
      * sfence: instr in svinval ext will also flush pipe
      
      A difficult problem to handle:
      Sfence and Svinval will flush MMU, but only Sfence(some svinval)
        will flush pipe. For itlb that some requestors are blocked and
        icache doesn't recv flush for simplicity, itlb's blocked ptw req
        should not be flushed.
      It's a huge problem for MMU to handle for good or bad solutions. But
        svinval is seldom used, so disable it's effiency.
      
      * mmu: add parameter to control mmu's sfence delay latency
      
      Difficult problem:
        itlb's blocked req should not be abandoned, but sfence will flush
        all infight reqs. when itlb and itlb repeater's delay is not same(itlb
        is flushed, two cycles later, itlb repeater is flushed, then itlb's
        ptw req after flushing will be also flushed sliently.
      So add one parameter to control the flush delay to be the same.
      
      * mmu.tlb: fix bug of csr.priv's delay & sfence valid when req fire
      
      1. csr.priv's delay
      csr.priv should not be delayed, csr.satp should be delayed.
      for excep/intr will change csr.priv, which will be changed at one
      instruction's (commit?). but csrrw satp will not, so satp has more
      cycles to delay.
      2. sfence
      when sfence valid but blocked req fire, resp should still fire.
      3. satp in TlbCsrBundle
      let high bits of satp.ppn to be 0.U
      
      * tlb&icache.mainpipe: rm commented codes
      
      * mmu: move method genPPN to entry bundle
      
      * l1tlb: divide l1tlb flush into flush_mmu and flush_pipe
      
      Problem:
      For l1tlb, there are blocked and non-blocked req ports.
      For blocked ports, there are req slots to store missed reqs.
      Some mmu flush like Sfence should not flush miss slots for outside
      may still need get tlb resp, no matter wrong and correct resp.
      For example. sfence will flush mmu and flush pipe, but won't flush
      reqs inside icache, which waiting for tlb resp.
      For example, svinval instr will flush mmu, but not flush pipe. so
      tlb should return correct resp, althrough the ptw req is flushed
      when tlb miss.
      
      Solution:
      divide l1tlb flush into flush_mmu and flush_pipe.
      The req slot is considered to be a part of core pipeline and should
      only be flushed by flush_pipe.
      flush_mmu will flush mmu entries and inflight ptw reqs.
      When miss but sfence flushed its ptw req, re-send.
      
      * l1tlb: code clean, correct comments and rm unused codes
      
      * l2tlb: divide filterSize into ifiterSize and dfilterSize
      
      * l2tlb: prefetch req won't enter miss queue. Rename MSHR to missqueue
      
      * l1tlb: when disable vm, ptw back should not bypass tlb and should let miss req go ahead
      f1fe8698
  6. 12 7月, 2022 1 次提交
    • Y
      ctrl: optimize the timing of dispatch2 stage (#1632) · 1cee9cb8
      Yinan Xu 提交于
      * ctrl: copy dispatch2 to avoid cross-module loops
      
      This commit makes copies of dispatch2 in CtrlBlock to avoid long
      cross-module timing loop paths. Should be good for timing.
      
      * dpq: re-write queue read logic
      
      This commit adds a Reg-Vec to store the queue read data. Since
      most queues read at most the current numRead and the next numRead
      entries, the read timing can be optimized by reading the data one
      cycle earlier.
      1cee9cb8
  7. 28 6月, 2022 1 次提交
  8. 09 5月, 2022 1 次提交
  9. 07 5月, 2022 1 次提交
  10. 06 5月, 2022 1 次提交
    • H
      feat: parameterize load store (#1527) · 46f74b57
      Haojin Tang 提交于
      * feat: parameterize load/store pipeline, etc.
      
      * fix: use LoadPipelineWidth rather than LoadQueueSize
      
      * fix: parameterize `rdataPtrExtNext`
      
      * SBuffer: fix idx update logic
      
      * atomic: parameterize atomic logic in `MemBlock`
      
      * StoreQueue: update allow enque requirement
      
      * feat: support one load/store pipeline
      
      * feat: parameterize `EnsbufferWidth`
      
      * chore: resharp codes for better generated name
      46f74b57
  11. 04 5月, 2022 1 次提交
    • Y
      rob: WFI depends on mip&mie only · 5c95ea2e
      Yinan Xu 提交于
      This commit fixes the implementation of WFI. The WFI instruction
      waits in the ROB until an interrupt might need servicing.
      
      According to the RISC-V manual, the WFI must be unaffected by the
      global interrupt bits in `mstatus` and the delegation register
      `mideleg`.
      5c95ea2e
  12. 28 4月, 2022 1 次提交
    • Y
      core,rob: support the WFI instruction · b6900d94
      Yinan Xu 提交于
      The RISC-V WFI instruction is previously decoded as NOP. This commit
      adds support for the real wait-for-interrupt (WFI).
      
      We add a state_wfi FSM in the ROB. After WFI leaves the ROB, the next
      instruction will wait in the ROB until an interrupt.
      b6900d94
  13. 14 4月, 2022 1 次提交
    • L
      mmu.l2tlb: divide missqueue into 'missqueue' and llptw (#1522) · 92e3bfef
      Lemover 提交于
      old missqueue: cache req miss slot and mem access-er
      Problem: these two func are totally different, make mq hard to handle in a single select policy.
      Solution: divide these two funciton into two module.
        new MissQueue: only hold reqs that page cache miss and need re-req cache, a simple flushable queue
        llptw: Last level ptw, only access ptes, priorityMux queue
      
      * mmu: rename PTW.scala to L2TLB.scala
      
      * mmu: rename PTW to L2TLB
      
      * mmu: rename PtwFsm to PTW
      
      * mmu.l2tlb: divide missqueue into 'missqueue' and llptw
      
      old missqueue: cache req miss slot and mem access-er
      Problem: these two func are totally different, make mq hard to handle
        in single select policy.
      Solution: divide these two funciton into two module.
        new MissQueue: only hold reqs that page cache miss and new re-req
        cache
        llptw: Last level ptw, only access ptes
      
      * mmu.l2tlb: syntax bug that misses io assign
      
      * mmu.l2tlb: fix bug that mistakes ptw's block signal
      92e3bfef
  14. 28 1月, 2022 1 次提交
  15. 01 1月, 2022 1 次提交
  16. 21 12月, 2021 1 次提交
    • Y
      lsq: add LsqEnqCtrl to optimize enqueue timing (#1380) · 10551d4e
      Yinan Xu 提交于
      This commit adds an LsqEnqCtrl module to add one more clock cycle
      between dispatch and load/store queue.
      
      LsqEnqCtrl maintains the lqEnqPtr/sqEnqPtr and lqCounter/sqCounter.
      They are used to determine whether load/store queue can accept new
      instructions. After that, instructions are sent to load/store queue.
      This module decouples queue allocation and real enqueue.
      
      Besides, uop storage in load/store queue are optimized. In dispatch,
      only robIdx is required. Other information is naturally conveyed in
      the pipeline and can be stored later in load/store queue if needed.
      For example, exception vector, trigger, ftqIdx, pdest, etc are
      unnecessary before the instruction leaves the load/store pipeline.
      10551d4e
  17. 10 12月, 2021 2 次提交
    • W
      icache: support data/tag r/w op (#1337) · 70899835
      William Wang 提交于
      * mem,cacheop: fix read data writeback
      
      * mem,cacheop: rename cacheop state bits
      
      These bits are different from w_*, s_* bits in cache
      
      * mem: enable icache op feedback
      
      * icache: update cache op implementation
      
      * chore: remove cache op logic from XSCore.scala
      70899835
    • Y
      core: refactor hardware performance counters (#1335) · 1ca0e4f3
      Yinan Xu 提交于
      This commit optimizes the coding style and timing for hardware
      performance counters.
      
      By default, performance counters are RegNext(RegNext(_)).
      1ca0e4f3
  18. 09 12月, 2021 1 次提交
    • Y
      core: refactor writeback parameters (#1327) · 6ab6918f
      Yinan Xu 提交于
      This commit adds WritebackSink and WritebackSource parameters for
      multiple modules. These traits hide implementation details from
      other modules by defining IO-related functions in modules.
      
      By using WritebackSink, ROB is able to choose the writeback sources.
      Now fflags and exceptions are connected from exe units to reduce write
      ports and optimize timing.
      
      Further optimizations on write-back to RS and better coding style to
      be added later.
      6ab6918f
  19. 06 12月, 2021 1 次提交
  20. 05 12月, 2021 1 次提交
  21. 01 12月, 2021 1 次提交
  22. 16 11月, 2021 1 次提交
    • J
      Fix multi-core dedup bug (#1235) · 5668a921
      Jiawei Lin 提交于
      * FDivSqrt: use hierarchy API to avoid dedup bug
      
      * Dedup: use hartId from io port instead of core parameters
      
      * Bump fudian
      5668a921
  23. 12 11月, 2021 2 次提交
  24. 11 11月, 2021 1 次提交
  25. 07 11月, 2021 1 次提交
  26. 05 11月, 2021 1 次提交
  27. 30 10月, 2021 1 次提交
  28. 27 10月, 2021 1 次提交
  29. 24 10月, 2021 1 次提交
  30. 23 10月, 2021 1 次提交
  31. 22 10月, 2021 3 次提交
  32. 21 10月, 2021 2 次提交
    • W
      mem: add CSR based l1 cache instructions (#1116) · e19f7967
      William Wang 提交于
      e19f7967
    • 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
  33. 16 10月, 2021 1 次提交
  34. 14 10月, 2021 1 次提交
    • L
      l2tlb: add next-line prefetcher (#1108) · bc063562
      Lemover 提交于
      预取时机:
      
          或者 发生miss时
          或者 发生hit,但是hit的entry是预取上来的
          当 页表2MB的level命中
          当 预取项不跨2MB项对应的4KB page frame
      
      前面两个限制是为了限制预取的数量
      
      后面两个限制是限制预取请求只会访问最后一级页表 -› 不占用FSM & (几乎)不会重新访问cache,造成卡死。
      
      =============
      some workloads: gcc(5.4%), wrf(13.6%),milc(9.2%)'s ipc increase.
      some workloads decrease: namd(-2.5%).
      but l2tlb's perf counters are better.
      So I think it is worthy to adding the simple next-line prefetch.
      
      The workloads are of ci and in cold-start state, so prefetch may seems to be much better than it should be.
      But l2tlb's memory access ability is much better than what it needs, so the prefetch can be added.
      =============
      
      * mmu.l2tlb: add params filterSize
      
      * mmu.l2tlb: add prefetch,dont work well
      
      * mmu.l2tlb: add prefetch relative perf counter
      
      * l2tlb: prefetch recv miss req and 'hit but pre-fetched' req
      
      * l2tlb: fix some perf counter about prefetch
      
      * l2tlb: prefetch not cross 2MB && not recv when 2MB level miss
      
      * ci: when error, copy emu and SimTop.v to WAVE_HOME
      bc063562
  35. 13 10月, 2021 1 次提交