Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Avimitin committed Apr 26, 2024
1 parent 9e7329e commit 0fab282
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions subsystem/src/LazyT1.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
package org.chipsalliance.t1.subsystem

import chisel3._
import chisel3.util.experimental.BoringUtils.bore
import chisel3.experimental.SerializableModuleGenerator
import chisel3.properties.{ClassType, Path, Property}
import freechips.rocketchip.diplomacy.AddressSet
import freechips.rocketchip.subsystem.{BaseSubsystem, InstantiatesHierarchicalElements}
import org.chipsalliance.cde.config._
import org.chipsalliance.t1.rockettile.{AbstractLazyT1, AbstractLazyT1ModuleImp, T1LSUParameter}
import org.chipsalliance.t1.rtl.{T1, T1Parameter}
import org.chipsalliance.t1.rtl.lsu.LSUProbe

case object T1Generator extends Field[SerializableModuleGenerator[T1, T1Parameter]]

Expand All @@ -32,6 +34,37 @@ class LazyT1Imp(outer: LazyT1)(implicit p: Parameters) extends AbstractLazyT1Mod
// We insist using the json config for Vector for uArch tuning.
val t1: T1 = Module(outer.generator.module())

// Since T1 doesn't split the interface and implementations into two packages.
// we should consider doing this in the future. But now we just instantiate Xizhimen here.
// this remind me that, for all Modules, being a FixedIOModule is really important.
// that makes us being able to split def/impl easily.
// In the future plan, we will pull Xizhimen up to RenMinGuangChang which will also include Monitor modules from Scalar.

// Monitor
val lsuProbe = probe.read(t1.lsuProbe).suggestName("lsuProbe")
val laneProbes = t1.laneProbes.zipWithIndex.map{case (p, idx) =>
val wire = Wire(p.cloneType)
wire := probe.read(p)
wire
}
val laneVrfProbes = t1.laneVrfProbes.zipWithIndex.map{case (p, idx) =>
val wire = Wire(p.cloneType).suggestName(s"lane${idx}VrfProbe")
wire := probe.read(p)
wire
}

// TODO: gather XiZhiMen into a module, making XiZhiMen into an interface package.
withClockAndReset(clock, reset)(Module(new Module {
// h/t: GrandCentral
override def desiredName: String = "XiZhiMen"
val lsuProbeMonitor: LSUProbe = bore(lsuProbe)
dontTouch(lsuProbeMonitor)
val laneProbesMonitor = laneProbes.map(bore(_))
laneProbesMonitor.foreach(dontTouch(_))
val laneVrfProbesMonitor = laneVrfProbes.map(bore(_))
laneVrfProbesMonitor.foreach(dontTouch(_))
}))

t1.request.valid := request.valid
t1.request.bits.instruction := request.bits.instruction
t1.request.bits.src1Data := request.bits.rs1Data
Expand Down

0 comments on commit 0fab282

Please sign in to comment.