Add TutorialNoCConfig

This commit is contained in:
Jerry Zhao
2022-09-27 22:08:12 -07:00
parent f634fde083
commit 07cad27315
11 changed files with 69 additions and 19 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ env-riscv-tools.sh
env-esp-tools.sh
.bsp/
.conda-env/
.#*

View File

@@ -23,7 +23,7 @@ class TinyRocketConfig extends Config(
// DOC include start: FFTRocketConfig
class FFTRocketConfig extends Config(
new fftgenerator.WithFFTGenerator(baseAddr=0x2000, numPoints=8, width=16, decPt=8) ++ // add 8-point mmio fft at 0x2000 with 16bit fixed-point numbers.
new fftgenerator.WithFFTGenerator(numPoints=8, width=16, decPt=8) ++ // add 8-point mmio fft at 0x2000 with 16bit fixed-point numbers.
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
new chipyard.config.AbstractConfig)
// DOC include end: FFTRocketConfig

View File

@@ -1,6 +1,12 @@
package chipyard
import freechips.rocketchip.config.{Config}
import constellation.channel._
import constellation.routing._
import constellation.topology._
import constellation.noc._
import constellation.soc.{GlobalNoCParams}
import scala.collection.immutable.ListMap
// This file is designed to accompany a live tutorial, with slides.
// For each of 4 phases, participants will customize and build a
@@ -68,3 +74,45 @@ class TutorialSha3BlackBoxConfig extends Config(
new freechips.rocketchip.subsystem.WithNBigCores(1) ++
new chipyard.config.AbstractConfig
)
// Tutorial Phase 5: Map a multicore heterogeneous SoC with multiple cores and memory-mapped accelerators
class TutorialNoCConfig extends Config(
// Try changing the dimensions of the Mesh topology
new constellation.soc.WithGlobalNoC(constellation.soc.GlobalNoCParams(
NoCParams(
topology = TerminalRouter(Mesh2D(3, 4)),
channelParamGen = (a, b) => UserChannelParams(Seq.fill(12) { UserVirtualChannelParams(4) }),
routingRelation = NonblockingVirtualSubnetworksRouting(TerminalRouterRouting(
Mesh2DEscapeRouting()), 10, 1)
)
)) ++
// The inNodeMapping and outNodeMapping values are the physical identifiers of
// routers on the topology to map the agents to. Try changing these to any
// value within the range [0, topology.nNodes)
new constellation.soc.WithPbusNoC(constellation.protocol.TLNoCParams(
constellation.protocol.DiplomaticNetworkNodeMapping(
inNodeMapping = ListMap("Core" -> 7),
outNodeMapping = ListMap(
"pbus" -> 8, "uart" -> 9, "control" -> 10, "gcd" -> 11,
"writeQueue[0]" -> 0, "writeQueue[1]" -> 1, "tailChain[0]" -> 2))
), true) ++
new constellation.soc.WithSbusNoC(constellation.protocol.TLNoCParams(
constellation.protocol.DiplomaticNetworkNodeMapping(
inNodeMapping = ListMap(
"Core 0" -> 0, "Core 1" -> 1,
"serial-tl" -> 2),
outNodeMapping = ListMap(
"system[0]" -> 3, "system[1]" -> 4, "system[2]" -> 5, "system[3]" -> 6,
"pbus" -> 7))
), true) ++
new chipyard.example.WithGCD ++
new chipyard.harness.WithLoopbackNIC ++
new icenet.WithIceNIC ++
new fftgenerator.WithFFTGenerator(numPoints=8) ++
new chipyard.example.WithStreamingFIR ++
new chipyard.example.WithStreamingPassthrough ++
new freechips.rocketchip.subsystem.WithNBanks(4) ++
new freechips.rocketchip.subsystem.WithNBigCores(2) ++
new chipyard.config.AbstractConfig
)

View File

@@ -13,7 +13,7 @@ import freechips.rocketchip.util.UIntIsOneOf
// DOC include start: GCD params
case class GCDParams(
address: BigInt = 0x2000,
address: BigInt = 0x1000,
width: Int = 32,
useAXI4: Boolean = false,
useBlackBox: Boolean = true)
@@ -201,7 +201,7 @@ trait CanHavePeripheryGCDModuleImp extends LazyModuleImp {
// DOC include start: GCD config fragment
class WithGCD(useAXI4: Boolean, useBlackBox: Boolean) extends Config((site, here, up) => {
class WithGCD(useAXI4: Boolean = false, useBlackBox: Boolean = false) extends Config((site, here, up) => {
case GCDKey => Some(GCDParams(useAXI4 = useAXI4, useBlackBox = useBlackBox))
})
// DOC include end: GCD config fragment

View File

@@ -16,8 +16,8 @@ import freechips.rocketchip.subsystem._
// Simple passthrough to use as testbed sanity check
// StreamingPassthrough params
case class StreamingPassthroughParams(
writeAddress: BigInt = 0x2000,
readAddress: BigInt = 0x2100,
writeAddress: BigInt = 0x2200,
readAddress: BigInt = 0x2300,
depth: Int
)

View File

@@ -6,7 +6,7 @@ LDFLAGS= -static
include libgloss.mk
PROGRAMS = pwm blkdev accum charcount nic-loopback big-blkdev pingd \
streaming-passthrough streaming-fir nvdla spiflashread spiflashwrite fft
streaming-passthrough streaming-fir nvdla spiflashread spiflashwrite fft gcd
spiflash.img: spiflash.py
python3 $<

View File

@@ -4,8 +4,8 @@
#include <inttypes.h>
#include <math.h>
#define FFT_WRITE_LANE 0x2000
#define FFT_RD_LANE_BASE 0x2008
#define FFT_WRITE_LANE 0x2400
#define FFT_RD_LANE_BASE 0x2408
// addr of read lane i is FFT_RD_LANE_BASE + i * 8
// from generators/fft-generator/test_pts.py (in the fft-generator repo)
@@ -68,4 +68,4 @@ int main(void) {
printf("PASS: FFT Test Passed\n");
return 0;
}
}

View File

@@ -1,9 +1,9 @@
#include "mmio.h"
#define GCD_STATUS 0x2000
#define GCD_X 0x2004
#define GCD_Y 0x2008
#define GCD_GCD 0x200C
#define GCD_STATUS 0x1000
#define GCD_X 0x1004
#define GCD_Y 0x1008
#define GCD_GCD 0x100C
unsigned int gcd_ref(unsigned int x, unsigned int y) {
while (y != 0) {
@@ -37,6 +37,7 @@ int main(void)
printf("Hardware result %d does not match reference value %d\n", result, ref);
return 1;
}
printf("Hardware result %d is correct for GCD\n", result);
return 0;
}
// DOC include end: GCD test

View File

@@ -1,7 +1,7 @@
#define PASSTHROUGH_WRITE 0x2000
#define PASSTHROUGH_WRITE_COUNT 0x2008
#define PASSTHROUGH_READ 0x2100
#define PASSTHROUGH_READ_COUNT 0x2108
#define PASSTHROUGH_WRITE 0x2200
#define PASSTHROUGH_WRITE_COUNT 0x2208
#define PASSTHROUGH_READ 0x2300
#define PASSTHROUGH_READ_COUNT 0x2308
#include "mmio.h"