XSCore.scala 14.7 KB
Newer Older
L
LinJiawei 已提交
1 2 3 4
package xiangshan

import chisel3._
import chisel3.util._
L
LinJiawei 已提交
5
import top.Parameters
L
LinJiawei 已提交
6
import xiangshan.backend._
7
import xiangshan.backend.dispatch.DispatchParameters
L
LinJiawei 已提交
8
import xiangshan.backend.exu.ExuParameters
L
LinJiawei 已提交
9
import xiangshan.backend.exu.Exu._
G
GouLingrui 已提交
10
import xiangshan.frontend._
11
import xiangshan.mem._
Y
Yinan Xu 已提交
12
import xiangshan.backend.fu.HasExceptionNO
13
import xiangshan.cache.{ICache, DCache, L1plusCache, DCacheParameters, ICacheParameters, L1plusCacheParameters, PTW, Uncache}
L
linjiawei 已提交
14
import chipsalliance.rocketchip.config
A
Allen 已提交
15
import freechips.rocketchip.diplomacy.{LazyModule, LazyModuleImp, AddressSet}
16 17
import freechips.rocketchip.tilelink.{TLBundleParameters, TLCacheCork, TLBuffer, TLClientNode, TLIdentityNode, TLXbar, TLWidthWidget, TLFilter, TLToAXI4}
import freechips.rocketchip.devices.tilelink.{TLError, DevNullParams}
L
LinJiawei 已提交
18
import sifive.blocks.inclusivecache.{CacheParameters, InclusiveCache, InclusiveCacheMicroParameters}
19
import freechips.rocketchip.amba.axi4.{AXI4ToTL, AXI4IdentityNode, AXI4UserYanker, AXI4Fragmenter, AXI4IdIndexer, AXI4Deinterleaver}
L
LinJiawei 已提交
20
import utils._
L
LinJiawei 已提交
21

L
LinJiawei 已提交
22 23 24 25 26 27 28 29 30 31 32
case class XSCoreParameters
(
  XLEN: Int = 64,
  HasMExtension: Boolean = true,
  HasCExtension: Boolean = true,
  HasDiv: Boolean = true,
  HasICache: Boolean = true,
  HasDCache: Boolean = true,
  EnableStoreQueue: Boolean = true,
  AddrBits: Int = 64,
  VAddrBits: Int = 39,
33
  PAddrBits: Int = 40,
L
LinJiawei 已提交
34
  HasFPU: Boolean = true,
L
LinJiawei 已提交
35 36
  FectchWidth: Int = 8,
  EnableBPU: Boolean = true,
L
Lingrui98 已提交
37
  EnableBPD: Boolean = true,
G
GouLingrui 已提交
38
  EnableRAS: Boolean = true,
39
  EnableLB: Boolean = true,
L
Lingrui98 已提交
40
  EnableLoop: Boolean = true,
L
Lingrui98 已提交
41
  EnableSC: Boolean = false,
L
LinJiawei 已提交
42
  HistoryLength: Int = 64,
43
  BtbSize: Int = 2048,
L
LinJiawei 已提交
44 45 46 47 48 49 50 51 52 53
  JbtacSize: Int = 1024,
  JbtacBanks: Int = 8,
  RasSize: Int = 16,
  CacheLineSize: Int = 512,
  UBtbWays: Int = 16,
  BtbWays: Int = 2,
  IBufSize: Int = 64,
  DecodeWidth: Int = 6,
  RenameWidth: Int = 6,
  CommitWidth: Int = 6,
Y
Yinan Xu 已提交
54
  BrqSize: Int = 32,
Z
zoujr 已提交
55
  IssQueSize: Int = 8,
Y
Yinan Xu 已提交
56
  NRPhyRegs: Int = 180,
Z
zoujr 已提交
57
  NRIntReadPorts: Int = 14,
L
LinJiawei 已提交
58 59
  NRIntWritePorts: Int = 8,
  NRFpReadPorts: Int = 14,
Y
Yinan Xu 已提交
60
  NRFpWritePorts: Int = 8,
Y
Yinan Xu 已提交
61 62 63
  LoadQueueSize: Int = 64,
  StoreQueueSize: Int = 48,
  RoqSize: Int = 192,
L
LinJiawei 已提交
64 65
  dpParams: DispatchParameters = DispatchParameters(
    DqEnqWidth = 4,
Y
Yinan Xu 已提交
66 67 68
    IntDqSize = 128,
    FpDqSize = 128,
    LsDqSize = 96,
L
LinJiawei 已提交
69 70
    IntDqDeqWidth = 4,
    FpDqDeqWidth = 4,
Y
Yinan Xu 已提交
71 72
    LsDqDeqWidth = 4,
    IntDqReplayWidth = 4,
73 74
    FpDqReplayWidth = 4,
    LsDqReplayWidth = 4
L
LinJiawei 已提交
75 76
  ),
  exuParameters: ExuParameters = ExuParameters(
L
LinJiawei 已提交
77
    JmpCnt = 1,
78
    AluCnt = 4,
L
LinJiawei 已提交
79 80
    MulCnt = 0,
    MduCnt = 2,
81 82
    FmacCnt = 4,
    FmiscCnt = 2,
83
    FmiscDivSqrtCnt = 0,
L
LinJiawei 已提交
84 85 86 87 88 89
    LduCnt = 2,
    StuCnt = 2
  ),
  LoadPipelineWidth: Int = 2,
  StorePipelineWidth: Int = 2,
  StoreBufferSize: Int = 16,
90 91 92 93
  RefillSize: Int = 512,
  TlbEntrySize: Int = 32,
  TlbL2EntrySize: Int = 256, // or 512
  PtwL1EntrySize: Int = 16,
94 95
  PtwL2EntrySize: Int = 256,
  NumPerfCounters: Int = 16
L
LinJiawei 已提交
96
)
L
LinJiawei 已提交
97 98

trait HasXSParameter {
L
LinJiawei 已提交
99 100 101 102 103 104 105 106 107 108 109 110 111 112

  val core = Parameters.get.coreParameters
  val env = Parameters.get.envParameters

  val XLEN = core.XLEN
  val HasMExtension = core.HasMExtension
  val HasCExtension = core.HasCExtension
  val HasDiv = core.HasDiv
  val HasIcache = core.HasICache
  val HasDcache = core.HasDCache
  val EnableStoreQueue = core.EnableStoreQueue
  val AddrBits = core.AddrBits // AddrBits is used in some cases
  val VAddrBits = core.VAddrBits // VAddrBits is Virtual Memory addr bits
  val PAddrBits = core.PAddrBits // PAddrBits is Phyical Memory addr bits
L
LinJiawei 已提交
113 114 115
  val AddrBytes = AddrBits / 8 // unused
  val DataBits = XLEN
  val DataBytes = DataBits / 8
L
LinJiawei 已提交
116 117
  val HasFPU = core.HasFPU
  val FetchWidth = core.FectchWidth
G
GouLingrui 已提交
118
  val PredictWidth = FetchWidth * 2
L
LinJiawei 已提交
119 120 121 122
  val EnableBPU = core.EnableBPU
  val EnableBPD = core.EnableBPD // enable backing predictor(like Tage) in BPUStage3
  val EnableRAS = core.EnableRAS
  val EnableLB = core.EnableLB
123
  val EnableLoop = core.EnableLoop
124
  val EnableSC = core.EnableSC
L
LinJiawei 已提交
125 126
  val HistoryLength = core.HistoryLength
  val BtbSize = core.BtbSize
G
GouLingrui 已提交
127 128 129
  // val BtbWays = 4
  val BtbBanks = PredictWidth
  // val BtbSets = BtbSize / BtbWays
L
LinJiawei 已提交
130 131 132
  val JbtacSize = core.JbtacSize
  val JbtacBanks = core.JbtacBanks
  val RasSize = core.RasSize
L
LinJiawei 已提交
133 134
  val CacheLineSize = core.CacheLineSize
  val CacheLineHalfWord = CacheLineSize / 16
G
GouLingrui 已提交
135
  val ExtHistoryLength = HistoryLength + 64
L
LinJiawei 已提交
136 137
  val UBtbWays = core.UBtbWays
  val BtbWays = core.BtbWays
L
LinJiawei 已提交
138 139 140 141 142 143
  val IBufSize = core.IBufSize
  val DecodeWidth = core.DecodeWidth
  val RenameWidth = core.RenameWidth
  val CommitWidth = core.CommitWidth
  val BrqSize = core.BrqSize
  val IssQueSize = core.IssQueSize
144
  val BrTagWidth = log2Up(BrqSize)
L
LinJiawei 已提交
145
  val NRPhyRegs = core.NRPhyRegs
146
  val PhyRegIdxWidth = log2Up(NRPhyRegs)
L
LinJiawei 已提交
147
  val RoqSize = core.RoqSize
148 149
  val LoadQueueSize = core.LoadQueueSize
  val StoreQueueSize = core.StoreQueueSize
L
LinJiawei 已提交
150
  val dpParams = core.dpParams
Y
Yinan Xu 已提交
151
  val ReplayWidth = dpParams.IntDqReplayWidth + dpParams.FpDqReplayWidth + dpParams.LsDqReplayWidth
L
LinJiawei 已提交
152
  val exuParameters = core.exuParameters
L
LinJiawei 已提交
153 154 155 156 157 158 159 160 161
  val NRIntReadPorts = core.NRIntReadPorts
  val NRIntWritePorts = core.NRIntWritePorts
  val NRMemReadPorts = exuParameters.LduCnt + 2*exuParameters.StuCnt
  val NRFpReadPorts = core.NRFpReadPorts
  val NRFpWritePorts = core.NRFpWritePorts
  val LoadPipelineWidth = core.LoadPipelineWidth
  val StorePipelineWidth = core.StorePipelineWidth
  val StoreBufferSize = core.StoreBufferSize
  val RefillSize = core.RefillSize
162
  val DTLBWidth = core.LoadPipelineWidth + core.StorePipelineWidth
163 164 165 166
  val TlbEntrySize = core.TlbEntrySize
  val TlbL2EntrySize = core.TlbL2EntrySize
  val PtwL1EntrySize = core.PtwL1EntrySize
  val PtwL2EntrySize = core.PtwL2EntrySize
167
  val NumPerfCounters = core.NumPerfCounters
168 169

  val icacheParameters = ICacheParameters(
J
jinyue110 已提交
170
    nMissEntries = 2
171 172
  )

A
Allen 已提交
173 174 175 176
  val l1plusCacheParameters = L1plusCacheParameters(
    tagECC = Some("secded"),
    dataECC = Some("secded"),
    nMissEntries = 8
177 178 179
  )

  val dcacheParameters = DCacheParameters(
180
    tagECC = Some("secded"),
181 182 183 184
    dataECC = Some("secded"),
    nMissEntries = 16,
    nLoadMissEntries = 8,
    nStoreMissEntries = 8
185
  )
A
Allen 已提交
186 187

  val LRSCCycles = 100
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209


  // cache hierarchy configurations
  val l1BusDataWidth = 256

  // L2 configurations
  val L1BusWidth = 256
  val L2Size = 512 * 1024 // 512KB
  val L2BlockSize = 64
  val L2NWays = 8
  val L2NSets = L2Size / L2BlockSize / L2NWays

  // L3 configurations
  val L2BusWidth = 256
  val L3Size = 4 * 1024 * 1024 // 4MB
  val L3BlockSize = 64
  val L3NBanks = 4
  val L3NWays = 8
  val L3NSets = L3Size / L3BlockSize / L3NBanks / L3NWays

  // on chip network configurations
  val L3BusWidth = 256
L
LinJiawei 已提交
210 211
}

L
linjiawei 已提交
212
trait HasXSLog { this: RawModule =>
213
  implicit val moduleName: String = this.name
L
LinJiawei 已提交
214 215
}

L
LinJiawei 已提交
216
abstract class XSModule extends MultiIOModule
L
LinJiawei 已提交
217 218
  with HasXSParameter
  with HasExceptionNO
L
LinJiawei 已提交
219
  with HasXSLog
L
LinJiawei 已提交
220 221 222
{
  def io: Record
}
L
LinJiawei 已提交
223

224
//remove this trait after impl module logic
L
LinJiawei 已提交
225
trait NeedImpl { this: RawModule =>
226
  override protected def IO[T <: Data](iodef: T): T = {
L
LinJiawei 已提交
227
    println(s"[Warn]: (${this.name}) please reomve 'NeedImpl' after implement this module")
228 229 230 231 232 233
    val io = chisel3.experimental.IO(iodef)
    io <> DontCare
    io
  }
}

L
LinJiawei 已提交
234 235 236
abstract class XSBundle extends Bundle
  with HasXSParameter

L
LinJiawei 已提交
237
case class EnviromentParameters
L
LinJiawei 已提交
238 239
(
  FPGAPlatform: Boolean = true,
L
LinJiawei 已提交
240
  EnableDebug: Boolean = false
L
LinJiawei 已提交
241 242
)

L
LinJiawei 已提交
243 244 245 246
object AddressSpace extends HasXSParameter {
  // (start, size)
  // address out of MMIO will be considered as DRAM
  def mmio = List(
247 248
    (0x00000000L, 0x40000000L),  // internal devices, such as CLINT and PLIC
    (0x40000000L, 0x40000000L)   // external devices
L
LinJiawei 已提交
249 250 251 252 253 254 255 256 257 258
  )

  def isMMIO(addr: UInt): Bool = mmio.map(range => {
    require(isPow2(range._2))
    val bits = log2Up(range._2)
    (addr ^ range._1.U)(PAddrBits-1, bits) === 0.U
  }).reduce(_ || _)
}


259

260
class XSCore()(implicit p: config.Parameters) extends LazyModule with HasXSParameter {
261

262
  // inner nodes
L
linjiawei 已提交
263 264
  val dcache = LazyModule(new DCache())
  val uncache = LazyModule(new Uncache())
J
jinyue110 已提交
265
  val l1pluscache = LazyModule(new L1plusCache())
L
linjiawei 已提交
266
  val ptw = LazyModule(new PTW())
267

268
  // out facing nodes
L
LinJiawei 已提交
269
  val mem = TLIdentityNode()
L
linjiawei 已提交
270
  val mmio = uncache.clientNode
L
LinJiawei 已提交
271

A
Allen 已提交
272 273 274 275
  // L1 to L2 network
  // -------------------------------------------------
  private val l2_xbar = TLXbar()

L
LinJiawei 已提交
276 277 278
  private val l2 = LazyModule(new InclusiveCache(
    CacheParameters(
      level = 2,
A
Allen 已提交
279 280 281 282 283
      ways = L2NWays,
      sets = L2NSets,
      blockBytes = L2BlockSize,
      beatBytes = L1BusWidth / 8, // beatBytes = l1BusDataWidth / 8
      cacheName = s"L2"
L
LinJiawei 已提交
284 285 286 287 288 289
    ),
    InclusiveCacheMicroParameters(
      writeBytes = 8
    )
  ))

A
Allen 已提交
290
  l2_xbar := TLBuffer() := DebugIdentityNode() := dcache.clientNode
291
  l2_xbar := TLBuffer() := DebugIdentityNode() := l1pluscache.clientNode
A
Allen 已提交
292 293
  l2_xbar := TLBuffer() := DebugIdentityNode() := ptw.node
  l2.node := TLBuffer() := DebugIdentityNode() := l2_xbar
L
LinJiawei 已提交
294

Y
Yinan Xu 已提交
295
  mem := l2.node
J
jinyue110 已提交
296

L
linjiawei 已提交
297 298 299
  lazy val module = new XSCoreImp(this)
}

300 301 302 303
class XSCoreImp(outer: XSCore) extends LazyModuleImp(outer)
  with HasXSParameter
  with HasExeBlockHelper
{
Y
Yinan Xu 已提交
304 305 306
  val io = IO(new Bundle {
    val externalInterrupt = new ExternalInterruptIO
  })
307

Z
ZhangZifei 已提交
308 309
  println(s"FPGAPlatform:${env.FPGAPlatform} EnableDebug:${env.EnableDebug}")

L
LinJiawei 已提交
310
  // to fast wake up fp, mem rs
311 312 313 314
  val intBlockFastWakeUpFp = intExuConfigs.filter(fpFastFilter)
  val intBlockSlowWakeUpFp = intExuConfigs.filter(fpSlowFilter)
  val intBlockFastWakeUpInt = intExuConfigs.filter(intFastFilter)
  val intBlockSlowWakeUpInt = intExuConfigs.filter(intSlowFilter)
L
LinJiawei 已提交
315

316 317 318 319
  val fpBlockFastWakeUpFp = fpExuConfigs.filter(fpFastFilter)
  val fpBlockSlowWakeUpFp = fpExuConfigs.filter(fpSlowFilter)
  val fpBlockFastWakeUpInt = fpExuConfigs.filter(intFastFilter)
  val fpBlockSlowWakeUpInt = fpExuConfigs.filter(intSlowFilter)
L
LinJiawei 已提交
320

321 322
  val frontend = Module(new Frontend)
  val ctrlBlock = Module(new CtrlBlock)
L
LinJiawei 已提交
323
  val integerBlock = Module(new IntegerBlock(
324 325 326 327 328 329
    fastWakeUpIn = fpBlockFastWakeUpInt,
    slowWakeUpIn = fpBlockSlowWakeUpInt ++ loadExuConfigs,
    fastFpOut = intBlockFastWakeUpFp,
    slowFpOut = intBlockSlowWakeUpFp,
    fastIntOut = intBlockFastWakeUpInt,
    slowIntOut = intBlockSlowWakeUpInt
L
LinJiawei 已提交
330 331
  ))
  val floatBlock = Module(new FloatBlock(
332 333 334 335 336 337
    fastWakeUpIn = intBlockFastWakeUpFp,
    slowWakeUpIn = intBlockSlowWakeUpFp ++ loadExuConfigs,
    fastFpOut = fpBlockFastWakeUpFp,
    slowFpOut = fpBlockSlowWakeUpFp,
    fastIntOut = fpBlockFastWakeUpInt,
    slowIntOut = fpBlockSlowWakeUpInt
L
LinJiawei 已提交
338 339
  ))
  val memBlock = Module(new MemBlock(
340 341 342 343 344 345
    fastWakeUpIn = intBlockFastWakeUpInt ++ intBlockFastWakeUpFp ++ fpBlockFastWakeUpInt ++ fpBlockFastWakeUpFp,
    slowWakeUpIn = intBlockSlowWakeUpInt ++ intBlockSlowWakeUpFp ++ fpBlockSlowWakeUpInt ++ fpBlockSlowWakeUpFp,
    fastFpOut = Seq(),
    slowFpOut = loadExuConfigs,
    fastIntOut = Seq(),
    slowIntOut = loadExuConfigs
L
LinJiawei 已提交
346
  ))
L
linjiawei 已提交
347 348 349

  val dcache = outer.dcache.module
  val uncache = outer.uncache.module
J
jinyue110 已提交
350
  val l1pluscache = outer.l1pluscache.module
L
linjiawei 已提交
351
  val ptw = outer.ptw.module
J
jinyue110 已提交
352
  val icache = Module(new ICache)
L
linjiawei 已提交
353

354 355 356 357 358
  frontend.io.backend <> ctrlBlock.io.frontend
  frontend.io.icacheResp <> icache.io.resp
  frontend.io.icacheToTlb <> icache.io.tlb
  icache.io.req <> frontend.io.icacheReq
  icache.io.flush <> frontend.io.icacheFlush
Y
Yinan Xu 已提交
359 360
  frontend.io.sfence <> integerBlock.io.fenceio.sfence
  frontend.io.tlbCsr <> integerBlock.io.csrio.tlb
J
jinyue110 已提交
361 362 363

  icache.io.mem_acquire <> l1pluscache.io.req
  l1pluscache.io.resp <> icache.io.mem_grant
364
  l1pluscache.io.flush := icache.io.l1plusflush
Y
Yinan Xu 已提交
365
  icache.io.fencei := integerBlock.io.fenceio.fencei
366 367 368 369 370 371 372 373

  ctrlBlock.io.fromIntBlock <> integerBlock.io.toCtrlBlock
  ctrlBlock.io.fromFpBlock <> floatBlock.io.toCtrlBlock
  ctrlBlock.io.fromLsBlock <> memBlock.io.toCtrlBlock
  ctrlBlock.io.toIntBlock <> integerBlock.io.fromCtrlBlock
  ctrlBlock.io.toFpBlock <> floatBlock.io.fromCtrlBlock
  ctrlBlock.io.toLsBlock <> memBlock.io.fromCtrlBlock

L
LinJiawei 已提交
374
  integerBlock.io.wakeUpIn.fastUops <> floatBlock.io.wakeUpIntOut.fastUops
L
LinJiawei 已提交
375 376 377
  integerBlock.io.wakeUpIn.fast <> floatBlock.io.wakeUpIntOut.fast
  integerBlock.io.wakeUpIn.slow <> floatBlock.io.wakeUpIntOut.slow ++ memBlock.io.wakeUpIntOut.slow

L
LinJiawei 已提交
378
  floatBlock.io.wakeUpIn.fastUops <> integerBlock.io.wakeUpFpOut.fastUops
L
LinJiawei 已提交
379 380 381
  floatBlock.io.wakeUpIn.fast <> integerBlock.io.wakeUpFpOut.fast
  floatBlock.io.wakeUpIn.slow <> integerBlock.io.wakeUpFpOut.slow ++ memBlock.io.wakeUpFpOut.slow

L
LinJiawei 已提交
382

L
LinJiawei 已提交
383 384 385 386 387 388
  integerBlock.io.wakeUpIntOut.fast.map(_.ready := true.B)
  integerBlock.io.wakeUpIntOut.slow.map(_.ready := true.B)
  floatBlock.io.wakeUpFpOut.fast.map(_.ready := true.B)
  floatBlock.io.wakeUpFpOut.slow.map(_.ready := true.B)

  val wakeUpMem = Seq(
L
LinJiawei 已提交
389 390 391 392
    integerBlock.io.wakeUpIntOut,
    integerBlock.io.wakeUpFpOut,
    floatBlock.io.wakeUpIntOut,
    floatBlock.io.wakeUpFpOut
L
LinJiawei 已提交
393 394 395 396 397 398 399 400 401 402
  )
  memBlock.io.wakeUpIn.fastUops <> wakeUpMem.flatMap(_.fastUops)
  memBlock.io.wakeUpIn.fast <> wakeUpMem.flatMap(w => w.fast.map(f => {
	val raw = WireInit(f)
	raw
  }))
  memBlock.io.wakeUpIn.slow <> wakeUpMem.flatMap(w => w.slow.map(s => {
	val raw = WireInit(s)
	raw
  }))
L
LinJiawei 已提交
403

Y
Yinan Xu 已提交
404 405 406 407 408
  integerBlock.io.csrio.fflags <> ctrlBlock.io.roqio.toCSR.fflags
  integerBlock.io.csrio.dirty_fs <> ctrlBlock.io.roqio.toCSR.dirty_fs
  integerBlock.io.csrio.exception <> ctrlBlock.io.roqio.exception
  integerBlock.io.csrio.isInterrupt <> ctrlBlock.io.roqio.isInterrupt
  integerBlock.io.csrio.trapTarget <> ctrlBlock.io.roqio.toCSR.trapTarget
Y
Yinan Xu 已提交
409
  integerBlock.io.csrio.interrupt <> ctrlBlock.io.roqio.toCSR.intrBitSet
Y
Yinan Xu 已提交
410 411 412 413 414 415 416 417 418 419 420 421 422 423
  integerBlock.io.csrio.memExceptionVAddr <> memBlock.io.lsqio.exceptionAddr.vaddr
  integerBlock.io.csrio.externalInterrupt <> io.externalInterrupt
  integerBlock.io.csrio.tlb <> memBlock.io.tlbCsr
  integerBlock.io.fenceio.sfence <> memBlock.io.sfence
  integerBlock.io.fenceio.sbuffer <> memBlock.io.fenceToSbuffer

  floatBlock.io.frm <> integerBlock.io.csrio.frm

  memBlock.io.lsqio.commits <> ctrlBlock.io.roqio.commits
  memBlock.io.lsqio.roqDeqPtr <> ctrlBlock.io.roqio.roqDeqPtr
  memBlock.io.lsqio.oldestStore <> ctrlBlock.io.oldestStore
  memBlock.io.lsqio.exceptionAddr.lsIdx.lqIdx := ctrlBlock.io.roqio.exception.bits.lqIdx
  memBlock.io.lsqio.exceptionAddr.lsIdx.sqIdx := ctrlBlock.io.roqio.exception.bits.sqIdx
  memBlock.io.lsqio.exceptionAddr.isStore := CommitType.lsInstIsStore(ctrlBlock.io.roqio.exception.bits.ctrl.commitType)
424 425 426

  ptw.io.tlb(0) <> memBlock.io.ptw
  ptw.io.tlb(1) <> frontend.io.ptw
Y
Yinan Xu 已提交
427 428
  ptw.io.sfence <> integerBlock.io.fenceio.sfence
  ptw.io.csr <> integerBlock.io.csrio.tlb
429 430

  dcache.io.lsu.load    <> memBlock.io.dcache.loadUnitToDcacheVec
Y
Yinan Xu 已提交
431
  dcache.io.lsu.lsq   <> memBlock.io.dcache.loadMiss
432 433
  dcache.io.lsu.atomics <> memBlock.io.dcache.atomics
  dcache.io.lsu.store   <> memBlock.io.dcache.sbufferToDcache
Y
Yinan Xu 已提交
434
  uncache.io.lsq      <> memBlock.io.dcache.uncache
435

L
LinJiawei 已提交
436
  if (!env.FPGAPlatform) {
437 438 439 440
    val debugIntReg, debugFpReg = WireInit(VecInit(Seq.fill(32)(0.U(XLEN.W))))
    ExcitingUtils.addSink(debugIntReg, "DEBUG_INT_ARCH_REG", ExcitingUtils.Debug)
    ExcitingUtils.addSink(debugFpReg, "DEBUG_FP_ARCH_REG", ExcitingUtils.Debug)
    val debugArchReg = WireInit(VecInit(debugIntReg ++ debugFpReg))
L
LinJiawei 已提交
441 442 443
    ExcitingUtils.addSource(debugArchReg, "difftestRegs", ExcitingUtils.Debug)
  }

L
LinJiawei 已提交
444
}