Skip to content

Commit

Permalink
Remove duplicate Key/Field to avoid conflicts (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
poemonsense authored Oct 9, 2023
1 parent 28c47a6 commit ae0940c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/main/scala/coupledL2/AcquireUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import utility._
import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import org.chipsalliance.cde.config.Parameters
import huancun.{PreferCacheKey}
import huancun.{DirtyKey, PreferCacheKey}

class AcquireUnit(implicit p: Parameters) extends L2Module {
val io = IO(new Bundle() {
Expand Down
41 changes: 1 addition & 40 deletions src/main/scala/coupledL2/L2Param.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import freechips.rocketchip.diplomacy.BufferParams
import freechips.rocketchip.tilelink._
import freechips.rocketchip.util._
import org.chipsalliance.cde.config.Field
import huancun.CacheParameters
import huancun.{AliasKey, CacheParameters, IsHitKey, PrefetchKey}
import coupledL2.prefetch._
import utility.{MemReqSource, ReqSourceKey}

Expand All @@ -46,15 +46,6 @@ case class L1Param
val needResolveAlias = aliasBitsOpt.nonEmpty
}

// Indicate alias bit of upper level cache
case object AliasKey extends ControlKey[UInt]("alias")
case class AliasField(width: Int) extends BundleField(AliasKey) {
override def data: UInt = Output(UInt(width.W))
override def default(x: UInt): Unit = {
x := 0.U(width.W)
}
}

// Pass virtual address of upper level cache
case object VaddrKey extends ControlKey[UInt]("vaddr")
case class VaddrField(width: Int) extends BundleField(VaddrKey) {
Expand All @@ -64,36 +55,6 @@ case class VaddrField(width: Int) extends BundleField(VaddrKey) {
}
}

// Indicate whether Hint is needed by upper level cache
case object PrefetchKey extends ControlKey[Bool](name = "needHint")
case class PrefetchField() extends BundleField(PrefetchKey) {
override def data: Bool = Output(Bool())
override def default(x: Bool): Unit = {
x := false.B
}
}

case object IsHitKey extends ControlKey[Bool](name = "isHitInL3")

case class IsHitField() extends BundleField(IsHitKey) {
override def data: Bool = Output(Bool())

override def default(x: Bool): Unit = {
x := true.B
}
}

// Indicate whether this block is dirty or not (only used in handle Release/ReleaseData)
// Now it only works for non-inclusive cache (ignored in inclusive cache)
case object DirtyKey extends ControlKey[Bool](name = "blockisdirty")

case class DirtyField() extends BundleField(DirtyKey) {
override def data: Bool = Output(Bool())
override def default(x: Bool): Unit = {
x := true.B
}
}

case class L2Param
(
name: String = "L2",
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/coupledL2/RefillUnit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import freechips.rocketchip.tilelink._
import freechips.rocketchip.tilelink.TLMessages._
import org.chipsalliance.cde.config.Parameters
import coupledL2.utils.XSPerfAccumulate
import huancun.{DirtyKey, IsHitKey}

class grantAckQEntry(implicit p: Parameters) extends L2Bundle {
val source = UInt(sourceIdBits.W)
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/coupledL2/SinkA.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import freechips.rocketchip.tilelink.TLMessages._
import freechips.rocketchip.tilelink.TLHints._
import coupledL2.prefetch.PrefetchReq
import coupledL2.utils.XSPerfAccumulate
import huancun.{AliasKey, PrefetchKey}
import utility.MemReqSource

class SinkA(implicit p: Parameters) extends L2Module {
Expand Down
1 change: 1 addition & 0 deletions src/main/scala/coupledL2/SourceC.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import utility._
import org.chipsalliance.cde.config.Parameters
import freechips.rocketchip.tilelink._
import coupledL2.utils.XSPerfAccumulate
import huancun.DirtyKey

//class SourceC(implicit p: Parameters) extends L2Module {
// val io = IO(new Bundle() {
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/TestProbeQueue.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import chisel3.stage.{ChiselGeneratorAnnotation, ChiselStage}
import freechips.rocketchip.diplomacy._
import freechips.rocketchip.tilelink._
import scala.collection.mutable.ArrayBuffer

import huancun.DirtyField



Expand Down

0 comments on commit ae0940c

Please sign in to comment.