Skip to content

Commit

Permalink
Bump Chisel and rocket-chip
Browse files Browse the repository at this point in the history
  • Loading branch information
poemonsense committed Oct 7, 2023
1 parent d26711d commit b2fcd16
Show file tree
Hide file tree
Showing 38 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion HuanCun
Submodule HuanCun updated 49 files
+4 −1 Makefile
+1 −1 Utility
+9 −9 build.sc
+1 −1 rocket-chip
+1 −1 src/main/scala/huancun/BankedXbar.scala
+1 −1 src/main/scala/huancun/BaseDirectory.scala
+1 −1 src/main/scala/huancun/BaseMSHR.scala
+1 −1 src/main/scala/huancun/BaseSinkC.scala
+1 −1 src/main/scala/huancun/Common.scala
+1 −1 src/main/scala/huancun/CtrlUnit.scala
+1 −1 src/main/scala/huancun/DataStorage.scala
+3 −2 src/main/scala/huancun/HCCacheParameters.scala
+1 −1 src/main/scala/huancun/HuanCun.scala
+1 −1 src/main/scala/huancun/MSHRAlloc.scala
+1 −1 src/main/scala/huancun/RefillBuffer.scala
+1 −1 src/main/scala/huancun/RequestBuffer.scala
+1 −1 src/main/scala/huancun/SinkA.scala
+1 −1 src/main/scala/huancun/SinkB.scala
+1 −1 src/main/scala/huancun/SinkD.scala
+1 −1 src/main/scala/huancun/SinkE.scala
+2 −2 src/main/scala/huancun/Slice.scala
+1 −1 src/main/scala/huancun/SourceA.scala
+1 −1 src/main/scala/huancun/SourceB.scala
+1 −1 src/main/scala/huancun/SourceC.scala
+1 −1 src/main/scala/huancun/SourceD.scala
+1 −1 src/main/scala/huancun/SourceE.scala
+1 −1 src/main/scala/huancun/TopDownMonitor.scala
+1 −1 src/main/scala/huancun/debug/DirectoryLogger.scala
+1 −1 src/main/scala/huancun/inclusive/Directory.scala
+1 −1 src/main/scala/huancun/inclusive/MSHR.scala
+1 −1 src/main/scala/huancun/inclusive/SinkC.scala
+1 −1 src/main/scala/huancun/noninclusive/Directory.scala
+1 −1 src/main/scala/huancun/noninclusive/MSHR.scala
+1 −1 src/main/scala/huancun/noninclusive/ProbeHelper.scala
+2 −2 src/main/scala/huancun/noninclusive/SinkC.scala
+1 −1 src/main/scala/huancun/noninclusive/SliceCtrl.scala
+1 −1 src/main/scala/huancun/prefetch/BestOffsetPrefetch.scala
+1 −1 src/main/scala/huancun/prefetch/PrefetchParameters.scala
+1 −1 src/main/scala/huancun/prefetch/PrefetchReceiver.scala
+1 −1 src/main/scala/huancun/prefetch/Prefetcher.scala
+1 −1 src/main/scala/huancun/utils/Throttle.scala
+3 −3 src/main/scala/huancun/utils/XSPerfAccumulate.scala
+1 −1 src/test/scala/huancun/ExampleSystem.scala
+1 −1 src/test/scala/huancun/FakeClient.scala
+1 −1 src/test/scala/huancun/L2Tester.scala
+1 −1 src/test/scala/huancun/TLDebugNode.scala
+3 −3 src/test/scala/huancun/TestTop.scala
+1 −1 src/test/scala/huancun/tlctest/DirConflictTester.scala
+1 −1 src/test/scala/huancun/tlctest/TLCTest.scala
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
init:
git submodule update --init
cd rocket-chip && git submodule update --init hardfloat api-config-chipsalliance
cd rocket-chip && git submodule update --init hardfloat cde

compile:
mill -i CoupledL2.compile
Expand Down
20 changes: 10 additions & 10 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import scalafmt._
import os.Path
import publish._
import $file.`rocket-chip`.common
import $file.`rocket-chip`.`api-config-chipsalliance`.`build-rules`.mill.build
import $file.`rocket-chip`.cde.common
import $file.`rocket-chip`.hardfloat.build

val defaultVersions = Map(
"chisel3" -> "3.5.0",
"chisel3-plugin" -> "3.5.0",
"chisel3" -> "3.5.4",
"chisel3-plugin" -> "3.5.4",
"chiseltest" -> "0.3.2",
"scala" -> "2.12.13",
"scalatest" -> "3.2.7"
Expand All @@ -29,7 +29,7 @@ trait CommonModule extends ScalaModule {
override def scalacOptions = Seq("-Xsource:2.11")

val macroParadise = ivy"org.scalamacros:::paradise:2.1.1"
val chisel3Plugin = ivy"edu.berkeley.cs:::chisel3-plugin:3.5.0"
val chisel3Plugin = ivy"edu.berkeley.cs:::chisel3-plugin:3.5.4"

override def compileIvyDeps = Agg(macroParadise)
override def scalacPluginIvyDeps = Agg(macroParadise, chisel3Plugin)
Expand All @@ -46,8 +46,8 @@ object rocketchip extends `rocket-chip`.common.CommonRocketChip {

override def millSourcePath = rcPath

object configRocket extends `rocket-chip`.`api-config-chipsalliance`.`build-rules`.mill.build.config with PublishModule {
override def millSourcePath = rcPath / "api-config-chipsalliance" / "design" / "craft"
object cdeRocket extends `rocket-chip`.cde.common.CDEModule with PublishModule {
override def millSourcePath = rcPath / "cde" / "cde"

override def scalaVersion = T {
rocketchip.scalaVersion()
Expand All @@ -70,21 +70,21 @@ object rocketchip extends `rocket-chip`.common.CommonRocketChip {
}

def chisel3IvyDeps = if(chisel3Module.isEmpty) Agg(
common.getVersion("chisel3")
`rocket-chip`.common.getVersion("chisel3")
) else Agg.empty[Dep]

def chisel3PluginIvyDeps = Agg(common.getVersion("chisel3-plugin", cross=true))
def chisel3PluginIvyDeps = Agg(`rocket-chip`.common.getVersion("chisel3-plugin", cross=true))
}

def hardfloatModule = hardfloatRocket

def configModule = configRocket
def cdeModule = cdeRocket

}

object utility extends SbtModule with ScalafmtModule with CommonModule {

override def ivyDeps = Agg(common.getVersion("chisel3"))
override def ivyDeps = Agg(`rocket-chip`.common.getVersion("chisel3"))

override def millSourcePath = os.pwd / "utility"

Expand Down
2 changes: 1 addition & 1 deletion rocket-chip
Submodule rocket-chip updated 301 files
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/AcquireUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import chisel3.util._
import utility._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import huancun.{PreferCacheKey}

class AcquireUnit(implicit p: Parameters) extends L2Module {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package coupledL2

import chisel3._
import chisel3.util._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink.TLPermissions._
import utility.MemReqSource

Expand Down Expand Up @@ -176,7 +176,7 @@ class MSHRInfo(implicit p: Parameters) extends L2Bundle {
// to drop duplicate prefetch reqs
val isAcqOrPrefetch = Bool()
val isPrefetch = Bool()

// whether the mshr_task already in mainpipe
val s_refill = Bool()
val mergeA = Bool() // whether the mshr already merge an acquire(avoid alias merge)
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/coupledL2/CoupledL2.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import freechips.rocketchip.diplomacy._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.util._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import scala.math.max
import coupledL2.prefetch._
import coupledL2.utils.XSPerfAccumulate
Expand Down Expand Up @@ -315,13 +315,13 @@ class CoupledL2(implicit p: Parameters) extends LazyModule with HasCoupledL2Para
case (((in, edgeIn), (out, edgeOut)), i) =>
require(in.params.dataBits == out.params.dataBits)
val rst_L2 = reset
val slice = withReset(rst_L2) {
val slice = withReset(rst_L2) {
Module(new Slice()(p.alterPartial {
case EdgeInKey => edgeIn
case EdgeOutKey => edgeOut
case BankBitsKey => bankBits
case SliceIdKey => i
}))
}))
}
val sourceD_can_go = RegNextN(!hint_fire || i.U === OHToUInt(hint_chosen), hintCycleAhead - 1)
release_sourceD_condition(i) := sourceD_can_go && !slice.io.in.d.valid
Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/coupledL2/CustomL1Hint.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package coupledL2
import chisel3._
import chisel3.util._
import utility._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink.TLMessages._
import coupledL2.utils._

Expand Down Expand Up @@ -88,7 +88,7 @@ class CustomL1Hint(implicit p: Parameters) extends L2Module {
val s4_l2_hit_grant_data = task_s4.valid && req_grantbuffer_next_cycle_s4 && task_s4.bits.opcode === GrantData && task_s4.bits.fromA && !task_s4.bits.mshrTask && !task_s4.bits.fromL2pft.getOrElse(false.B)

val hint_s1, hint_s2, hint_s3, hint_s4, hint_s5 = Wire(io.l1Hint.cloneType)

// S1 hint
// * l1 acquire and l2 miss situation, **no hit situation**
val s1_l2_miss_refill_grant_data = task_s1.valid && task_s1.bits.fromA && task_s1.bits.opcode === GrantData
Expand Down Expand Up @@ -185,8 +185,8 @@ class CustomL1Hint(implicit p: Parameters) extends L2Module {
// S4 hint
// * l1 acquire and l2 miss situation
val s4_l2_miss_refill_grant_data = d_s4 && task_s4.bits.opcode === GrantData && task_s4.bits.fromA && task_s4.bits.mshrTask && !task_s4.bits.fromL2pft.getOrElse(false.B)
val s4_l2_miss_refill_counter_match = Mux(d_s5 && task_s5.bits.opcode(0), (globalCounter + 3.U) === hintCycleAhead.U,
Mux(d_s5 && !task_s5.bits.opcode(0), (globalCounter + 2.U) === hintCycleAhead.U,
val s4_l2_miss_refill_counter_match = Mux(d_s5 && task_s5.bits.opcode(0), (globalCounter + 3.U) === hintCycleAhead.U,
Mux(d_s5 && !task_s5.bits.opcode(0), (globalCounter + 2.U) === hintCycleAhead.U,
(globalCounter + 1.U) === hintCycleAhead.U ))
val validHintMiss_s4 = s4_l2_miss_refill_grant_data && s4_l2_miss_refill_counter_match

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/DataStorage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chisel3._
import chisel3.util._
import coupledL2.utils.SRAMTemplate
import utility.RegNextN
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters

class DSRequest(implicit p: Parameters) extends L2Bundle {
val way = UInt(wayBits.W)
Expand Down Expand Up @@ -50,7 +50,7 @@ class DataStorage(implicit p: Parameters) extends L2Module {
gen = new DSBlock,
set = blocks,
way = 1,
singlePort = true
singlePort = true
))

val arrayIdx = Cat(io.req.bits.way, io.req.bits.set)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/Directory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import chisel3.util._
import freechips.rocketchip.util.SetAssocLRU
import coupledL2.utils._
import utility.{ParallelPriorityMux, RegNextN}
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.prefetch.PfSource
import freechips.rocketchip.tilelink.TLMessages._

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/GrantBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package coupledL2
import chisel3._
import chisel3.util._
import utility._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import coupledL2.prefetch.PrefetchResp
Expand Down Expand Up @@ -242,7 +242,7 @@ class GrantBuffer(implicit p: Parameters) extends L2Module {
}

io.e.ready := true.B

// =========== handle blocking - capacity conflict ===========
// count the number of valid blocks + those in pipe that might use GrantBuf
// so that GrantBuffer will not exceed capacity [back pressure]
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/coupledL2/L2Param.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* See the Mulan PSL v2 for more details.
* *************************************************************************************
*/

package coupledL2

import chisel3._
import chisel3.util.log2Ceil
import freechips.rocketchip.diplomacy.BufferParams
import freechips.rocketchip.tilelink._
import freechips.rocketchip.util._
import chipsalliance.rocketchip.config.Field
import org.chipsalliance.cde.config.Field
import huancun.CacheParameters
import coupledL2.prefetch._
import utility.{MemReqSource, ReqSourceKey}
Expand Down Expand Up @@ -114,7 +114,7 @@ case class L2Param

// Client (these are set in Configs.scala in XiangShan)
echoField: Seq[BundleFieldBase] = Nil,
reqField: Seq[BundleFieldBase] = Nil,
reqField: Seq[BundleFieldBase] = Nil,
respKey: Seq[BundleKeyBase] = Seq(IsHitKey),
// Manager
reqKey: Seq[BundleKeyBase] = Seq(AliasKey, VaddrKey, PrefetchKey, ReqSourceKey),
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/MSHR.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import utility.{MemReqSource, ParallelLookUp, ParallelPriorityMux}
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.tilelink.TLPermissions._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.prefetch.{PfSource, PrefetchTrain}
import coupledL2.utils.XSPerfAccumulate

Expand Down Expand Up @@ -540,7 +540,7 @@ class MSHR(implicit p: Parameters) extends L2Module {
when (req_valid) {
timer := timer + 1.U
}

val no_schedule = state.s_refill && state.s_probeack && state.s_merge_probeack && state.s_release // && state.s_triggerprefetch.getOrElse(true.B)
val no_wait = state.w_rprobeacklast && state.w_pprobeacklast && state.w_grantlast && state.w_releaseack && state.w_replResp
val will_free = no_schedule && no_wait
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/MSHRBuffer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package coupledL2

import chisel3._
import chisel3.util._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils._
import java.util.ResourceBundle

Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/coupledL2/MSHRCtl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package coupledL2
import chisel3._
import chisel3.util._
import utility._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import coupledL2.prefetch.PrefetchTrain
Expand Down Expand Up @@ -69,7 +69,7 @@ class MSHRCtl(implicit p: Parameters) extends L2Module {
val sinkD = new RespBundle
val sourceC = new RespBundle
})

val releaseBufWriteId = Output(UInt(mshrBits.W))

/* nested writeback */
Expand Down Expand Up @@ -184,7 +184,7 @@ class MSHRCtl(implicit p: Parameters) extends L2Module {
// _ =>
// XSPerfAccumulate(cacheParams, "prefetch_trains", io.prefetchTrain.get.fire)
// }

if (cacheParams.enablePerf) {
val start = 0
val stop = 100
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/MainPipe.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chisel3._
import chisel3.util._
import utility._
import coupledL2.MetaData._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.tilelink.TLPermissions._
Expand Down Expand Up @@ -488,7 +488,7 @@ class MainPipe(implicit p: Parameters) extends L2Module {

customL1Hint.io.s1 := io.taskInfo_s1
customL1Hint.io.s2 := task_s2

customL1Hint.io.s3.task := task_s3
customL1Hint.io.s3.d := d_s3.valid
customL1Hint.io.s3.need_mshr := need_mshr_s3
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/ProbeQueue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chisel3._
import chisel3.util._
import coupledL2.utils._
import freechips.rocketchip.tilelink._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters

class ProbeQueue(implicit p: Parameters) extends L2Module {
val io = IO(new Bundle() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/RefillUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chisel3._
import chisel3.util._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils.XSPerfAccumulate

class grantAckQEntry(implicit p: Parameters) extends L2Bundle {
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/RequestArb.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import chisel3.util._
import utility._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils.XSPerfAccumulate

class RequestArb(implicit p: Parameters) extends L2Module {
Expand Down Expand Up @@ -201,7 +201,7 @@ class RequestArb(implicit p: Parameters) extends L2Module {
XSPerfAccumulate(cacheParams, "sinkA_req", io.sinkA.fire)
XSPerfAccumulate(cacheParams, "sinkB_req", io.sinkB.fire)
XSPerfAccumulate(cacheParams, "sinkC_req", io.sinkC.fire)

XSPerfAccumulate(cacheParams, "sinkA_stall", io.sinkA.valid && !io.sinkA.ready)
XSPerfAccumulate(cacheParams, "sinkB_stall", io.sinkB.valid && !io.sinkB.ready)
XSPerfAccumulate(cacheParams, "sinkC_stall", io.sinkC.valid && !io.sinkC.ready)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/RequestBuffer.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package coupledL2

import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink.TLMessages._
import chisel3._
import chisel3.util._
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/SinkA.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package coupledL2

import chisel3._
import chisel3.util._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.tilelink.TLHints._
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/SinkB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package coupledL2

import chisel3._
import chisel3.util._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.tilelink.TLPermissions._
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/coupledL2/SinkC.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import chisel3._
import chisel3.util._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils.XSPerfAccumulate
import utility.MemReqSource

Expand All @@ -48,7 +48,7 @@ class SinkC(implicit p: Parameters) extends L2Module {
val refillBufWrite = Flipped(new MSHRBufWrite)
val msInfo = Vec(mshrsAll, Flipped(ValidIO(new MSHRInfo)))
})

val (first, last, _, beat) = edgeIn.count(io.c)
val isRelease = io.c.bits.opcode(1)
val hasData = io.c.bits.opcode(0)
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/Slice.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import chisel3.util._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.util.leftOR
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils._
import coupledL2.debug._
import coupledL2.prefetch.PrefetchIO
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/SourceB.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import chisel3._
import chisel3.util._
import coupledL2.utils._
import freechips.rocketchip.tilelink._
import chipsalliance.rocketchip.config.Parameters
import org.chipsalliance.cde.config.Parameters
import utility._

class GrantStatus(implicit p: Parameters) extends L2Bundle {
Expand Down
Loading

0 comments on commit b2fcd16

Please sign in to comment.