Skip to content

Commit

Permalink
VexRiscvBmbGenerator now export IBusDBusCachedTightlyCoupledRam
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Jan 31, 2024
1 parent 0347173 commit 7723afc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
10 changes: 9 additions & 1 deletion src/main/scala/vexriscv/VexRiscvBmbGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package vexriscv

import spinal.core._
import spinal.lib.bus.bmb.{Bmb, BmbAccessCapabilities, BmbAccessParameter, BmbImplicitDebugDecoder, BmbInterconnectGenerator, BmbInvalidationParameter, BmbParameter}
import spinal.lib.bus.misc.AddressMapping
import spinal.lib.bus.misc.{AddressMapping, SizeMapping}
import spinal.lib.com.jtag.{Jtag, JtagTapInstructionCtrl}
import spinal.lib.generator._
import spinal.lib.{sexport, slave}
Expand Down Expand Up @@ -120,6 +120,10 @@ case class VexRiscvBmbGenerator()(implicit interconnectSmp: BmbInterconnectGener
case _ =>
}

config.plugins += new IBusDBusCachedTightlyCoupledRam(
mapping = SizeMapping(0x20000000, 0x1000)
)

val cpu = new VexRiscv(config)
def doExport(value : => Any, postfix : String) = {
sexport(Handle(value).setCompositeName(VexRiscvBmbGenerator.this, postfix))
Expand All @@ -142,6 +146,10 @@ case class VexRiscvBmbGenerator()(implicit interconnectSmp: BmbInterconnectGener
doExport(plugin.config.cacheSize, "dcacheSize")
doExport(plugin.config.bytePerLine, "bytesPerLine")
}
case plugin : IBusDBusCachedTightlyCoupledRam => {
doExport(plugin.mapping.base, "coupledRamBase")
doExport(plugin.mapping.size, "coupledRamSize")
}
case plugin: MmuPlugin => {
doExport(true, "mmu")
}
Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/vexriscv/plugin/DBusCachedPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -651,12 +651,12 @@ class DBusCachedPlugin(val config : DataCacheConfig,
}


class IBusDBusCachedTightlyCoupledRam(mapping : SizeMapping,
withIBus : Boolean = true,
withDBus : Boolean = true,
ramAsBlackbox : Boolean = true,
hexInit : String = null,
ramOffset : Long = -1) extends Plugin[VexRiscv]{
class IBusDBusCachedTightlyCoupledRam(var mapping : SizeMapping,
var withIBus : Boolean = true,
var withDBus : Boolean = true,
var ramAsBlackbox : Boolean = true,
var hexInit : String = null,
var ramOffset : Long = -1) extends Plugin[VexRiscv]{
var dbus : TightlyCoupledDataBus = null
var ibus : TightlyCoupledBus = null

Expand Down

0 comments on commit 7723afc

Please sign in to comment.