Skip to content

Commit 2323d19

Browse files
committed
Update to newer rocket-chip
1 parent 4f97e92 commit 2323d19

File tree

10 files changed

+14
-34
lines changed

10 files changed

+14
-34
lines changed

common.mk

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ HELP_COMPILATION_VARIABLES += \
2323
" MFC_BASE_LOWERING_OPTIONS = override lowering options to pass to the MLIR FIRRTL compiler" \
2424
" ASPECTS = comma separated list of Chisel aspect flows to run (e.x. chipyard.upf.ChipTopUPFAspect)"
2525

26-
EXTRA_GENERATOR_REQS ?= $(BOOTROM_TARGETS)
26+
EXTRA_GENERATOR_REQS ?=
2727
EXTRA_SIM_CXXFLAGS ?=
2828
EXTRA_SIM_LDFLAGS ?=
2929
EXTRA_SIM_SOURCES ?=
@@ -104,15 +104,9 @@ TAPEOUT_VLOG_SOURCES = $(call lookup_srcs_by_multiple_type,$(TAPEOUT_SOURCE_DIRS
104104
SBT_SOURCE_DIRS = $(addprefix $(base_dir)/,generators tools)
105105
SBT_SOURCES = $(call lookup_srcs,$(SBT_SOURCE_DIRS),sbt) $(base_dir)/build.sbt $(base_dir)/project/plugins.sbt $(base_dir)/project/build.properties
106106

107-
#########################################################################################
108-
# copy over bootrom files
109-
#########################################################################################
110107
$(build_dir):
111108
mkdir -p $@
112109

113-
$(BOOTROM_TARGETS): $(build_dir)/bootrom.%.img: $(TESTCHIP_RSRCS_DIR)/testchipip/bootrom/bootrom.%.img | $(build_dir)
114-
cp -f $< $@
115-
116110
#########################################################################################
117111
# compile scala jars
118112
#########################################################################################

fpga/src/main/scala/vc707/Configs.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import freechips.rocketchip.devices.debug.{DebugModuleKey, ExportDebug, JTAG}
88
import freechips.rocketchip.devices.tilelink.{DevNullParams, BootROMLocated}
99
import freechips.rocketchip.diplomacy.{RegionType, AddressSet}
1010
import freechips.rocketchip.resources.{DTSModel, DTSTimebase}
11+
import freechips.rocketchip.util.{SystemFileName}
1112

1213
import sifive.blocks.devices.spi.{PeripherySPIKey, SPIParams}
1314
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
@@ -32,7 +33,7 @@ class WithSystemModifications extends Config((site, here, up) => {
3233
val freqMHz = (site(SystemBusKey).dtsFrequency.get / (1000 * 1000)).toLong
3334
val make = s"make -C fpga/src/main/resources/vc707/sdboot PBUS_CLK=${freqMHz} bin"
3435
require (make.! == 0, "Failed to build bootrom")
35-
p.copy(hang = 0x10000, contentFileName = s"./fpga/src/main/resources/vc707/sdboot/build/sdboot.bin")
36+
p.copy(hang = 0x10000, contentFileName = SystemFileName(s"./fpga/src/main/resources/vc707/sdboot/build/sdboot.bin"))
3637
}
3738
case ExtMem => up(ExtMem, site).map(x => x.copy(master = x.master.copy(size = site(VC7074GDDRSize)))) // set extmem to DDR size (note the size)
3839
case SerialTLKey => Nil // remove serialized tl port

fpga/src/main/scala/vcu118/Configs.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import freechips.rocketchip.devices.debug.{DebugModuleKey, ExportDebug, JTAG}
88
import freechips.rocketchip.devices.tilelink.{DevNullParams, BootROMLocated}
99
import freechips.rocketchip.diplomacy.{RegionType, AddressSet}
1010
import freechips.rocketchip.resources.{DTSModel, DTSTimebase}
11+
import freechips.rocketchip.util.{SystemFileName}
1112

1213
import sifive.blocks.devices.spi.{PeripherySPIKey, SPIParams}
1314
import sifive.blocks.devices.uart.{PeripheryUARTKey, UARTParams}
@@ -33,7 +34,7 @@ class WithSystemModifications extends Config((site, here, up) => {
3334
val freqMHz = (site(SystemBusKey).dtsFrequency.get / (1000 * 1000)).toLong
3435
val make = s"make -C fpga/src/main/resources/vcu118/sdboot PBUS_CLK=${freqMHz} bin"
3536
require (make.! == 0, "Failed to build bootrom")
36-
p.copy(hang = 0x10000, contentFileName = s"./fpga/src/main/resources/vcu118/sdboot/build/sdboot.bin")
37+
p.copy(hang = 0x10000, contentFileName = SystemFileName(s"./fpga/src/main/resources/vcu118/sdboot/build/sdboot.bin"))
3738
}
3839
case ExtMem => up(ExtMem, site).map(x => x.copy(master = x.master.copy(size = site(VCU118DDRSize)))) // set extmem to DDR size
3940
case SerialTLKey => Nil // remove serialized tl port

generators/chipyard/src/main/scala/DigitalTop.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class DigitalTop(implicit p: Parameters) extends ChipyardSystem
3333
with sifive.blocks.devices.spi.HasPeripherySPIFlash // Enables optionally adding the sifive SPI flash controller
3434
with sifive.blocks.devices.spi.HasPeripherySPI // Enables optionally adding the sifive SPI port
3535
with radiance.memory.CanHaveMemtraceCore // Enables memtrace core
36-
with radiance.memory.CanHaveRadianceROMs // Enables radiance argument ROMs
3736
with icenet.CanHavePeripheryIceNIC // Enables optionally adding the IceNIC for FireSim
3837
with chipyard.example.CanHavePeripheryInitZero // Enables optionally adding the initzero example widget
3938
with chipyard.example.CanHavePeripheryGCD // Enables optionally adding the GCD example widget

generators/chipyard/src/main/scala/config/fragments/PeripheralFragments.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import freechips.rocketchip.devices.debug.{Debug, ExportDebug, DebugModuleKey, D
1010
import freechips.rocketchip.prci.{AsynchronousCrossing}
1111
import chipyard.stage.phases.TargetDirKey
1212
import freechips.rocketchip.subsystem._
13+
import freechips.rocketchip.util.{ResourceFileName}
1314

1415
import sifive.blocks.devices.gpio._
1516
import sifive.blocks.devices.uart._
@@ -35,7 +36,7 @@ class WithBootROM(address: BigInt = 0x10000, size: Int = 0x10000, hang: BigInt =
3536
address = address,
3637
size = size,
3738
hang = hang,
38-
contentFileName = s"${site(TargetDirKey)}/bootrom.rv${site(MaxXLen)}.img"
39+
contentFileName = ResourceFileName(s"/testchipip/bootrom/bootrom.rv${site(MaxXLen)}.img")
3940
))
4041
})
4142

@@ -159,7 +160,7 @@ class WithNoCLINT extends Config((site, here, up) => {
159160
})
160161

161162
class WithNoBootROM extends Config((site, here, up) => {
162-
case BootROMLocated(_) => None
163+
case BootROMLocated(_) => Nil
163164
})
164165

165166
class WithRadBootROM(address: BigInt = 0x10000, size: Int = 0x10000, hang: BigInt = 0x10100) extends Config((site, here, up) => {
@@ -168,7 +169,8 @@ class WithRadBootROM(address: BigInt = 0x10000, size: Int = 0x10000, hang: BigIn
168169
address = address,
169170
size = size,
170171
hang = hang,
171-
contentFileName = s"${site(TargetDirKey)}/bootrom.radiance.rv32.img"
172+
driveResetVector = false,
173+
contentFileName = ResourceFileName(s"${site(TargetDirKey)}/bootrom.radiance.rv32.img")
172174
))
173175
})
174176

generators/chipyard/src/main/scala/iobinders/IOBinders.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class WithTraceIOPunchthrough extends OverrideLazyIOBinder({
506506
maxpglevels = tiles.headOption.map(_.tileParams.core.pgLevels).getOrElse(0),
507507
pmpregions = tiles.headOption.map(_.tileParams.core.nPMPs).getOrElse(0),
508508
nharts = tiles.size,
509-
bootrom = chipyardSystem.bootROM.map(_.module.contents.toArray.mkString(" ")).getOrElse(""),
509+
bootrom = chipyardSystem.bootROM.headOption.map(_.module.contents.toArray.mkString(" ")).getOrElse(""),
510510
has_dtm = useSimDTM,
511511
mems = mems,
512512
// Connect using the legacy API for firesim only

generators/cva6

generators/firechip/chip/src/main/scala/TargetConfigs.scala

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,6 @@ import icenet._
2020
import chipyard.clocking.{ChipyardPRCIControlKey}
2121
import chipyard.harness.{HarnessClockInstantiatorKey}
2222

23-
class WithBootROM extends Config((site, here, up) => {
24-
case BootROMLocated(x) => {
25-
val chipyardBootROM = new File(s"./generators/testchipip/bootrom/bootrom.rv${site(MaxXLen)}.img")
26-
val firesimBootROM = new File(s"./target-rtl/chipyard/generators/testchipip/bootrom/bootrom.rv${site(MaxXLen)}.img")
27-
28-
val bootROMPath = if (chipyardBootROM.exists()) {
29-
chipyardBootROM.getAbsolutePath()
30-
} else {
31-
firesimBootROM.getAbsolutePath()
32-
}
33-
up(BootROMLocated(x)).map(_.copy(contentFileName = bootROMPath))
34-
}
35-
})
36-
3723
// Disables clock-gating; doesn't play nice with our FAME-1 pass
3824
class WithoutClockGating extends Config((site, here, up) => {
3925
case DebugModuleKey => up(DebugModuleKey).map(_.copy(clockGate = false))
@@ -76,8 +62,6 @@ class WithMinimalFireSimDesignTweaks extends Config(
7662
new chipyard.harness.WithResetFromHarness ++
7763
new chipyard.config.WithNoClockTap ++
7864
new chipyard.clocking.WithPassthroughClockGenerator ++
79-
// Required*: When using FireSim-as-top to provide a correct path to the target bootrom source
80-
new WithBootROM ++
8165
// Required: Existing FAME-1 transform cannot handle black-box clock gates
8266
new WithoutClockGating ++
8367
// Optional: Do not support debug module w. JTAG until FIRRTL stops emitting @(posedge ~clock)
@@ -240,7 +224,6 @@ class FireSimQuadRocketConfig extends Config(
240224
// Flat to avoid having to reorganize the config class hierarchy to remove certain features
241225
class FireSimSmallSystemConfig extends Config(
242226
new WithDefaultFireSimBridges ++
243-
new WithBootROM ++
244227
new chipyard.config.WithPeripheryBusFrequency(3200.0) ++
245228
new chipyard.config.WithControlBusFrequency(3200.0) ++
246229
new chipyard.config.WithSystemBusFrequency(3200.0) ++

0 commit comments

Comments
 (0)