Skip to content

Commit 7f35448

Browse files
committed
fix compilation errors
1 parent 6856c71 commit 7f35448

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ libraryDependencies ++=
6363
resolvers ++= Resolver.sonatypeOssRepos("snapshots")
6464
resolvers ++= Resolver.sonatypeOssRepos("releases")
6565
resolvers += Resolver.mavenLocal
66+
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/service/local/repositories/snapshots/content"
6667

6768
addCompilerPlugin("edu.berkeley.cs" % "chisel3-plugin" % chiselVersion cross CrossVersion.full)
6869

src/main/scala/tilelink/Configs.scala

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package edu.berkeley.cs.ucie.digital
22
package tilelink
33

4+
45
import chisel3._
56
import freechips.rocketchip.util._
67
import chisel3.util._
78
import freechips.rocketchip.diplomacy._
89
import freechips.rocketchip.tilelink._
910
import org.chipsalliance.cde.config.{Field, Config, Parameters}
1011
import freechips.rocketchip.subsystem._
11-
import testchipip.soc.{OBUS}
12-
//import freechips.rocketchip.subsystem.{BaseSubsystem, CacheBlockBytes}
1312
import freechips.rocketchip.regmapper.{HasRegMap, RegField}
1413
import interfaces._
1514
import protocol._
@@ -25,14 +24,36 @@ case class UCITLParams(
2524
val linkTrainingParams: LinkTrainingParams,
2625
val afeParams: AfeParams,
2726
val laneAsyncQueueParams: AsyncQueueParams,
27+
val onchipAddr: Option[BigInt] = None,
2828
)
2929

30+
case class InwardAddressTranslator(blockRange : AddressSet, replicationBase : Option[BigInt] = None)(implicit p: Parameters) extends LazyModule {
31+
val module_side = replicationBase.map { base =>
32+
val baseRegion = AddressSet(0, base-1)
33+
val replicator = LazyModule(new RegionReplicator(ReplicatedRegion(baseRegion, baseRegion.widen(base))))
34+
val prefixSource = BundleBridgeSource[UInt](() => UInt(1.W))
35+
replicator.prefix := prefixSource
36+
InModuleBody { prefixSource.bundle := 0.U(1.W) } // prefix is unused for TL uncached, so this is ok
37+
replicator.node
38+
}.getOrElse { TLTempNode() }
39+
40+
// val bus_side = TLFilter(TLFilter.mSelectIntersect(blockRange))(p)
41+
val bus_side = TLFilter(TLFilter.mSubtract(blockRange))(p)
42+
43+
// module_side := bus_side
44+
45+
def apply(node : TLNode) : TLNode = {
46+
node := module_side := bus_side
47+
}
48+
49+
lazy val module = new LazyModuleImp(this) {}
50+
}
51+
3052
case object UCITLKey extends Field[Option[UCITLParams]](None)
3153

3254
trait CanHaveTLUCIAdapter { this: BaseSubsystem =>
3355
val uciTL = p(UCITLKey) match {
3456
case Some(params) => {
35-
val obus = locateTLBusWrapper(OBUS) // TODO: make parameterizable?
3657
val sbus = locateTLBusWrapper(SBUS)
3758
val uciTL = LazyModule(
3859
new UCITLFront(
@@ -49,9 +70,15 @@ trait CanHaveTLUCIAdapter { this: BaseSubsystem =>
4970
)
5071

5172
uciTL.clockNode := sbus.fixedClockNode
52-
obus.coupleTo(s"ucie_tl_man_port") {
53-
uciTL.managerNode := TLWidthWidget(obus.beatBytes) := TLBuffer() := TLSourceShrinker(params.tlParams.sourceIDWidth) := TLFragmenter(obus.beatBytes, p(CacheBlockBytes)) := TLBuffer() := _
54-
} //manager node because SBUS is making request?
73+
val manager_addr = AddressSet(params.tlParams.ADDRESS, params.tlParams.ADDR_RANGE)
74+
75+
val translator = uciTL {
76+
LazyModule(InwardAddressTranslator(manager_addr, params.onchipAddr)(p))
77+
}
78+
79+
sbus.coupleTo(s"ucie_tl_man_port") {
80+
translator(uciTL.managerNode) := TLWidthWidget(sbus.beatBytes) := TLBuffer() := TLSourceShrinker(params.tlParams.sourceIDWidth) := TLFragmenter(sbus.beatBytes, p(CacheBlockBytes)) := TLBuffer() := _
81+
}
5582
sbus.coupleFrom(s"ucie_tl_cl_port") { _ := TLBuffer() := TLWidthWidget(sbus.beatBytes) := TLBuffer() := uciTL.clientNode }
5683
sbus.coupleTo(s"ucie_tl_ctrl_port") { uciTL.regNode.node := TLWidthWidget(sbus.beatBytes) := TLFragmenter(sbus.beatBytes, sbus.blockBytes) := TLBuffer() := _ }
5784
Some(uciTL)

0 commit comments

Comments
 (0)