Skip to content

Commit 463c5ad

Browse files
committed
Merge branch 'ucb-bar-main' into graphics
2 parents b40330a + 74dc216 commit 463c5ad

File tree

12 files changed

+66
-17
lines changed

12 files changed

+66
-17
lines changed

.github/scripts/defaults.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ REMOTE_COURSIER_CACHE=$REMOTE_WORK_DIR/.coursier-cache
2525

2626
# key value store to get the build groups
2727
declare -A grouping
28-
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boomv3 chipyard-boomv4 chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone chipyard-prefetchers chipyard-shuttle chipyard-vexiiriscv"
28+
grouping["group-cores"]="chipyard-cva6 chipyard-ibex chipyard-rocket chipyard-hetero chipyard-boomv3 chipyard-boomv4 chipyard-sodor chipyard-digitaltop chipyard-multiclock-rocket chipyard-nomem-scratchpad chipyard-spike chipyard-clone chipyard-prefetchers chipyard-shuttle chipyard-shuttle3 chipyard-vexiiriscv"
2929
grouping["group-peripherals"]="chipyard-dmirocket chipyard-dmiboomv3 chipyard-dmiboomv4 chipyard-spiflashwrite chipyard-mmios chipyard-nocores chipyard-manyperipherals chipyard-chiplike chipyard-tethered chipyard-symmetric chipyard-llcchiplet"
3030
grouping["group-accels"]="chipyard-compressacc chipyard-mempress chipyard-gemmini chipyard-manymmioaccels chipyard-nvdla chipyard-aes256ecb chipyard-rerocc chipyard-rocketvector chipyard-shuttlevector chipyard-hlsacc" # chipyard-shuttleara - Add when Ara works again
3131
grouping["group-constellation"]="chipyard-constellation"
@@ -69,6 +69,7 @@ mapping["tracegen-boomv3"]=" CONFIG=BoomV3TraceGenConfig"
6969
mapping["tracegen-boomv4"]=" CONFIG=BoomV4TraceGenConfig"
7070
mapping["chipyard-sodor"]=" CONFIG=Sodor5StageConfig"
7171
mapping["chipyard-shuttle"]=" CONFIG=ShuttleConfig"
72+
mapping["chipyard-shuttle3"]=" CONFIG=Shuttle3WideConfig"
7273
mapping["chipyard-multiclock-rocket"]=" CONFIG=MulticlockRocketConfig"
7374
mapping["chipyard-nomem-scratchpad"]=" CONFIG=MMIOScratchpadOnlyRocketConfig"
7475
mapping["chipyard-constellation"]=" CONFIG=SharedNoCConfig"

.github/scripts/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ case $1 in
5050
# Test cospike without checkpoint-restore
5151
run_binary BINARY=$RISCV/riscv64-unknown-elf/share/riscv-tests/benchmarks/dhrystone.riscv LOADMEM=1
5252
;;
53-
chipyard-boomv3|chipyard-boomv4|chipyard-shuttle|chipyard-spike)
53+
chipyard-boomv3|chipyard-boomv4|chipyard-shuttle|chipyard-spike|chipyard-shuttle3)
5454
run_asm LOADMEM=1
5555
run_bmark LOADMEM=1
5656
;;

.github/workflows/chipyard-run-tests.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,29 @@ jobs:
512512
group-key: "group-cores"
513513
project-key: "chipyard-shuttle"
514514

515+
chipyard-shuttle3-run-tests:
516+
name: chipyard-shuttle3-run-tests
517+
needs: prepare-chipyard-cores
518+
runs-on: as4
519+
steps:
520+
- name: Delete old checkout
521+
run: |
522+
ls -alh .
523+
rm -rf ${{ github.workspace }}/* || true
524+
rm -rf ${{ github.workspace }}/.* || true
525+
ls -alh .
526+
- name: Checkout
527+
uses: actions/checkout@v4
528+
- name: Git workaround
529+
uses: ./.github/actions/git-workaround
530+
- name: Create conda env
531+
uses: ./.github/actions/create-conda-env
532+
- name: Run tests
533+
uses: ./.github/actions/run-tests
534+
with:
535+
group-key: "group-cores"
536+
project-key: "chipyard-shuttle3"
537+
515538
chipyard-cva6-run-tests:
516539
name: chipyard-cva6-run-tests
517540
needs: prepare-chipyard-cores
@@ -1209,6 +1232,7 @@ jobs:
12091232
chipyard-boomv3-run-tests,
12101233
chipyard-boomv4-run-tests,
12111234
chipyard-shuttle-run-tests,
1235+
chipyard-shuttle3-run-tests,
12121236
chipyard-cva6-run-tests,
12131237
chipyard-ibex-run-tests,
12141238
chipyard-vexiiriscv-run-tests,

fpga/src/main/scala/arty/HarnessBinders.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class WithArtyJTAGHarnessBinder extends HarnessBinder({
3434
port.io.TCK := jtag_wire.TCK
3535
port.io.TMS := jtag_wire.TMS
3636
port.io.TDI := jtag_wire.TDI
37+
port.io.reset.foreach(_ := th.referenceReset)
3738

3839
val io_jtag = Wire(new JTAGPins(() => new BasePin(), false)).suggestName("jtag")
3940

fpga/src/main/scala/arty100t/HarnessBinders.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ class WithArty100TPMODUART extends WithArty100TUART("G2", "F3")
126126
class WithArty100TJTAG extends HarnessBinder({
127127
case (th: HasHarnessInstantiators, port: JTAGPort, chipId: Int) => {
128128
val ath = th.asInstanceOf[LazyRawModuleImp].wrapper.asInstanceOf[Arty100THarness]
129-
val harnessIO = IO(chiselTypeOf(port.io)).suggestName("jtag")
130-
harnessIO <> port.io
129+
val harnessIO = IO(new JTAGChipIO(false)).suggestName("jtag")
130+
harnessIO.TDO := port.io.TDO
131+
port.io.TCK := harnessIO.TCK
132+
port.io.TDI := harnessIO.TDI
133+
port.io.TMS := harnessIO.TMS
134+
port.io.reset.foreach(_ := th.referenceReset)
131135

132136
ath.sdc.addClock("JTCK", IOPin(harnessIO.TCK), 10)
133137
ath.sdc.addGroup(clocks = Seq("JTCK"))
@@ -138,6 +142,7 @@ class WithArty100TJTAG extends HarnessBinder({
138142
("E2", IOPin(harnessIO.TDI)),
139143
("D4", IOPin(harnessIO.TDO))
140144
)
145+
141146
packagePinsWithPackageIOs foreach { case (pin, io) => {
142147
ath.xdc.addPackagePin(io, pin)
143148
ath.xdc.addIOStandard(io, "LVCMOS33")

fpga/src/main/scala/vcu118/HarnessBinders.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class WithJTAG extends HarnessBinder({
4343
port.io.TCK := jtag_io.TCK
4444
port.io.TMS := jtag_io.TMS
4545
port.io.TDI := jtag_io.TDI
46+
port.io.reset.foreach(_ := th.referenceReset)
4647
jtag_io.TDO.data := port.io.TDO
4748
jtag_io.TDO.driven := true.B
4849
// ignore srst_n

generators/chipyard/src/main/scala/config/ShuttleConfigs.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,25 @@ class ShuttleConfig extends Config(
1010
new shuttle.common.WithNShuttleCores ++ // 1x dual-issue shuttle core
1111
new chipyard.config.AbstractConfig)
1212

13+
class Shuttle3WideConfig extends Config(
14+
new shuttle.common.WithNShuttleCores(retireWidth=3) ++ // 1x three-issue shuttle core
15+
new chipyard.config.AbstractConfig)
16+
17+
1318
class ShuttleCosimConfig extends Config(
1419
new chipyard.harness.WithCospike ++ // attach spike-cosim
1520
new chipyard.config.WithTraceIO ++ // enable trace-io for cosim
1621
new shuttle.common.WithShuttleDebugROB ++ // enable shuttle debug ROB for cosim
1722
new shuttle.common.WithNShuttleCores ++
1823
new chipyard.config.AbstractConfig)
1924

25+
class Shuttle3WideCosimConfig extends Config(
26+
new chipyard.harness.WithCospike ++ // attach spike-cosim
27+
new chipyard.config.WithTraceIO ++ // enable trace-io for cosim
28+
new shuttle.common.WithShuttleDebugROB ++ // enable shuttle debug ROB for cosim
29+
new shuttle.common.WithNShuttleCores(retireWidth=3) ++
30+
new chipyard.config.AbstractConfig)
31+
2032
class dmiShuttleCosimConfig extends Config(
2133
new chipyard.harness.WithSerialTLTiedOff ++ // don't attach anything to serial-tl
2234
new chipyard.harness.WithCospike ++ // attach spike-cosim

generators/chipyard/src/main/scala/example/FlatChipTop.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class FlatChipTop(implicit p: Parameters) extends LazyModule with HasChipyardPor
131131
require(!debug.clockeddmi.isDefined)
132132
require(!debug.apb.isDefined)
133133
val (jtag_pad, jtagIOCells) = debug.systemjtag.map { j =>
134-
val jtag_wire = Wire(new JTAGChipIO)
134+
val jtag_wire = Wire(new JTAGChipIO(false))
135135
j.jtag.TCK := jtag_wire.TCK
136136
j.jtag.TMS := jtag_wire.TMS
137137
j.jtag.TDI := jtag_wire.TDI

generators/chipyard/src/main/scala/harness/HarnessBinders.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class WithSimJTAGDebug extends HarnessBinder({
187187
port.io.TCK := jtag_wire.TCK
188188
port.io.TMS := jtag_wire.TMS
189189
port.io.TDI := jtag_wire.TDI
190+
port.io.reset.foreach(_ := th.harnessBinderReset.asBool)
190191
val jtag = Module(new SimJTAG(tickDelay=3))
191192
jtag.connect(jtag_wire, th.harnessBinderClock, th.harnessBinderReset.asBool, ~(th.harnessBinderReset.asBool), dtm_success)
192193
}
@@ -205,6 +206,7 @@ class WithTiedOffJTAG extends HarnessBinder({
205206
port.io.TCK := true.B.asClock
206207
port.io.TMS := true.B
207208
port.io.TDI := true.B
209+
port.io.reset.foreach(_ := true.B)
208210
}
209211
})
210212

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,18 @@ class WithExtInterruptIOCells extends OverrideIOBinder({
288288
})
289289

290290
// Rocketchip's JTAGIO exposes the oe signal, which doesn't go off-chip
291-
class JTAGChipIO extends Bundle {
291+
class JTAGChipIO(hasReset: Boolean) extends Bundle {
292292
val TCK = Input(Clock())
293293
val TMS = Input(Bool())
294294
val TDI = Input(Bool())
295295
val TDO = Output(Bool())
296+
val reset = Option.when(hasReset)(Input(Bool()))
296297
}
297298

298299
// WARNING: Don't disable syncReset unless you are trying to
299300
// get around bugs in RTL simulators
300-
class WithDebugIOCells(syncReset: Boolean = true) extends OverrideLazyIOBinder({
301+
// If externalReset, exposes a reset in through JTAGChipIO, which is sync'd to TCK
302+
class WithDebugIOCells(syncReset: Boolean = true, externalReset: Boolean = true) extends OverrideLazyIOBinder({
301303
(system: HasPeripheryDebug) => {
302304
implicit val p = GetSystemParameters(system)
303305
val tlbus = system.asInstanceOf[BaseSubsystem].locateTLBusWrapper(p(ExportDebug).slaveWhere)
@@ -319,13 +321,6 @@ class WithDebugIOCells(syncReset: Boolean = true) extends OverrideLazyIOBinder({
319321
}
320322
// Tie off disableDebug
321323
d.disableDebug.foreach { d => d := false.B }
322-
// Drive JTAG on-chip IOs
323-
d.systemjtag.map { j =>
324-
j.reset := (if (syncReset) ResetCatchAndSync(j.jtag.TCK, clockBundle.reset.asBool) else clockBundle.reset.asBool)
325-
j.mfr_id := p(JtagDTMKey).idcodeManufId.U(11.W)
326-
j.part_number := p(JtagDTMKey).idcodePartNum.U(16.W)
327-
j.version := p(JtagDTMKey).idcodeVersion.U(4.W)
328-
}
329324
}
330325
Debug.connectDebugClockAndReset(Some(debug), clockBundle.clock)
331326

@@ -336,7 +331,15 @@ class WithDebugIOCells(syncReset: Boolean = true) extends OverrideLazyIOBinder({
336331
}
337332

338333
val jtagTuple = debug.systemjtag.map { j =>
339-
val jtag_wire = Wire(new JTAGChipIO)
334+
val jtag_wire = Wire(new JTAGChipIO(externalReset))
335+
336+
// Drive JTAG on-chip IOs
337+
val jReset = if (externalReset) jtag_wire.reset.get else clockBundle.reset.asBool
338+
j.reset := (if (syncReset) ResetCatchAndSync(j.jtag.TCK, jReset) else jReset)
339+
j.mfr_id := p(JtagDTMKey).idcodeManufId.U(11.W)
340+
j.part_number := p(JtagDTMKey).idcodePartNum.U(16.W)
341+
j.version := p(JtagDTMKey).idcodeVersion.U(4.W)
342+
340343
j.jtag.TCK := jtag_wire.TCK
341344
j.jtag.TMS := jtag_wire.TMS
342345
j.jtag.TDI := jtag_wire.TDI

0 commit comments

Comments
 (0)