Merge branch 'main' of https://github.com/ucb-bar/radiance into main

This commit is contained in:
Richard Yan
2024-09-10 18:30:54 -07:00
5 changed files with 17 additions and 10 deletions

View File

@@ -24,8 +24,7 @@ EXTRA_SIM_PREPROC_DEFINES += \
+define+ICACHE_DISABLE +define+DCACHE_DISABLE \ +define+ICACHE_DISABLE +define+DCACHE_DISABLE \
+define+GBAR_ENABLE \ +define+GBAR_ENABLE \
+define+GBAR_CLUSTER_ENABLE \ +define+GBAR_CLUSTER_ENABLE \
+define+FPU_FPNEW \ +define+FPU_FPNEW
+define+SMEM_LOG_SIZE=19
# +define+LSU_DUP_DISABLE \ # +define+LSU_DUP_DISABLE \
VCS_NONCC_OPTS += +vcs+initreg+random VCS_NONCC_OPTS += +vcs+initreg+random

View File

@@ -37,6 +37,7 @@ class WithRadianceCores(
n: Int, n: Int,
location: HierarchicalLocation, location: HierarchicalLocation,
crossing: RocketCrossingParams, crossing: RocketCrossingParams,
tensorCoreFP16: Boolean,
useVxCache: Boolean useVxCache: Boolean
) extends Config((site, _, up) => { ) extends Config((site, _, up) => {
case TilesLocated(`location`) => { case TilesLocated(`location`) => {
@@ -44,7 +45,7 @@ class WithRadianceCores(
val idOffset = up(NumTiles) val idOffset = up(NumTiles)
val coreIdOffset = up(NumRadianceCores) val coreIdOffset = up(NumRadianceCores)
val vortex = RadianceTileParams( val vortex = RadianceTileParams(
core = VortexCoreParams(fpu = None), core = VortexCoreParams(tensorCoreFP16 = tensorCoreFP16),
btb = None, btb = None,
useVxCache = useVxCache, useVxCache = useVxCache,
dcache = Some(DCacheParams( dcache = Some(DCacheParams(
@@ -77,14 +78,17 @@ class WithRadianceCores(
case NumTiles => up(NumTiles) + n case NumTiles => up(NumTiles) + n
case NumRadianceCores => up(NumRadianceCores) + n case NumRadianceCores => up(NumRadianceCores) + n
}) { }) {
def this(n: Int, location: HierarchicalLocation = InSubsystem, useVxCache: Boolean = false) = this(n, location, RocketCrossingParams( // constructor override that omits `crossing`
def this(n: Int, location: HierarchicalLocation = InSubsystem,
tensorCoreFP16: Boolean = false, useVxCache: Boolean = false)
= this(n, location, RocketCrossingParams(
master = HierarchicalElementMasterPortParams.locationDefault(location), master = HierarchicalElementMasterPortParams.locationDefault(location),
slave = HierarchicalElementSlavePortParams.locationDefault(location), slave = HierarchicalElementSlavePortParams.locationDefault(location),
mmioBaseAddressPrefixWhere = location match { mmioBaseAddressPrefixWhere = location match {
case InSubsystem => CBUS case InSubsystem => CBUS
case InCluster(clusterId) => CCBUS(clusterId) case InCluster(clusterId) => CCBUS(clusterId)
} }
), useVxCache) ), tensorCoreFP16, useVxCache)
} }
object RadianceGemminiDataType extends Enumeration { object RadianceGemminiDataType extends Enumeration {
@@ -221,7 +225,7 @@ class WithFuzzerCores(
val prev = up(TilesLocated(InSubsystem)) val prev = up(TilesLocated(InSubsystem))
val idOffset = up(NumTiles) val idOffset = up(NumTiles)
val fuzzer = FuzzerTileParams( val fuzzer = FuzzerTileParams(
core = VortexCoreParams(fpu = None), core = VortexCoreParams(),
useVxCache = useVxCache) useVxCache = useVxCache)
List.tabulate(n)(i => FuzzerTileAttachParams( List.tabulate(n)(i => FuzzerTileAttachParams(
fuzzer.copy(tileId = i + idOffset), fuzzer.copy(tileId = i + idOffset),

View File

@@ -97,6 +97,7 @@ case class VortexCoreParams(
mimpid: Int = 0x20181004, // release date in BCD mimpid: Int = 0x20181004, // release date in BCD
mulDiv: Option[MulDivParams] = None, mulDiv: Option[MulDivParams] = None,
fpu: Option[FPUParams] = None, fpu: Option[FPUParams] = None,
tensorCoreFP16: Boolean = false, // FP32 if true, FP16 if false
debugROB: Boolean = false, // if enabled, uses a C++ debug ROB to generate trace-with-wdata debugROB: Boolean = false, // if enabled, uses a C++ debug ROB to generate trace-with-wdata
haveCease: Boolean = true, // non-standard CEASE instruction haveCease: Boolean = true, // non-standard CEASE instruction
haveSimTimeout: Boolean = true // add plusarg for simulation timeout haveSimTimeout: Boolean = true // add plusarg for simulation timeout

View File

@@ -122,6 +122,7 @@ class Vortex(tile: RadianceTile)(implicit p: Parameters)
// across multiple clusters. // across multiple clusters.
Map( Map(
"CORE_ID" -> tile.radianceParams.coreId, "CORE_ID" -> tile.radianceParams.coreId,
"TENSOR_FP16" -> (if (tile.radianceParams.core.tensorCoreFP16) 1 else 0),
// TODO: can we get this as a parameter? // TODO: can we get this as a parameter?
"BOOTROM_HANG100" -> 0x10100, "BOOTROM_HANG100" -> 0x10100,
"NUM_THREADS" -> tile.numLsuLanes "NUM_THREADS" -> tile.numLsuLanes
@@ -146,7 +147,6 @@ class Vortex(tile: RadianceTile)(implicit p: Parameters)
// addResource("/vsrc/vortex/hw/syn/synopsys/models/memory/cln28hpc/rf2_32x128_wm1/vsim/rf2_32x128_wm1_tb.v") // addResource("/vsrc/vortex/hw/syn/synopsys/models/memory/cln28hpc/rf2_32x128_wm1/vsim/rf2_32x128_wm1_tb.v")
// addResource("/vsrc/vortex/hw/syn/modelsim/vortex_tb.v") // addResource("/vsrc/vortex/hw/syn/modelsim/vortex_tb.v")
addResource("/vsrc/vortex/hw/rtl/VX_gpu_pkg.sv") addResource("/vsrc/vortex/hw/rtl/VX_gpu_pkg.sv")
// addResource("/vsrc/vortex/hw/rtl/VX_cluster.sv") // addResource("/vsrc/vortex/hw/rtl/VX_cluster.sv")
@@ -333,8 +333,11 @@ class Vortex(tile: RadianceTile)(implicit p: Parameters)
// tensor core // tensor core
// this module is referenced from inside the Verilog RTL of the core // this module is referenced from inside the Verilog RTL of the core
// pipeline. // pipeline.
// addResource("/vsrc/TensorDotProductUnitFP32.sv") if (tile.radianceParams.core.tensorCoreFP16) {
addResource("/vsrc/TensorDotProductUnit.sv") addResource("/vsrc/TensorDotProductUnit.sv")
} else {
addResource("/vsrc/TensorDotProductUnitFP32.sv")
}
// fpnew // fpnew
// compile order matters; package definitions (ex. fpnew_pkg) should be // compile order matters; package definitions (ex. fpnew_pkg) should be