Merge remote-tracking branch 'origin/dev' into offchip-axi-setup
This commit is contained in:
@@ -14,6 +14,7 @@ import barstools.iocell.chisel._
|
|||||||
import testchipip.{TLTileResetCtrl}
|
import testchipip.{TLTileResetCtrl}
|
||||||
|
|
||||||
import chipyard.clocking._
|
import chipyard.clocking._
|
||||||
|
import chipyard.iobinders._
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple reset implementation that punches out reset ports
|
* A simple reset implementation that punches out reset ports
|
||||||
@@ -25,7 +26,7 @@ object GenerateReset {
|
|||||||
implicit val p = chiptop.p
|
implicit val p = chiptop.p
|
||||||
// this needs directionality so generateIOFromSignal works
|
// this needs directionality so generateIOFromSignal works
|
||||||
val async_reset_wire = Wire(Input(AsyncReset()))
|
val async_reset_wire = Wire(Input(AsyncReset()))
|
||||||
val (reset_io, resetIOCell) = IOCell.generateIOFromSignal(async_reset_wire, "reset",
|
val (reset_io, resetIOCell) = IOCell.generateIOFromSignal(async_reset_wire, "reset", p(IOCellKey),
|
||||||
abstractResetAsAsync = true)
|
abstractResetAsAsync = true)
|
||||||
|
|
||||||
chiptop.iocells ++= resetIOCell
|
chiptop.iocells ++= resetIOCell
|
||||||
@@ -70,9 +71,10 @@ object ClockingSchemeGenerators {
|
|||||||
|
|
||||||
// Add a control register for each tile's reset
|
// Add a control register for each tile's reset
|
||||||
val resetSetter = chiptop.lazySystem match {
|
val resetSetter = chiptop.lazySystem match {
|
||||||
case sys: BaseSubsystem with InstantiatesTiles => TLTileResetCtrl(sys)
|
case sys: BaseSubsystem with InstantiatesTiles => Some(TLTileResetCtrl(sys))
|
||||||
case _ => ClockGroupEphemeralNode()
|
case _ => None
|
||||||
}
|
}
|
||||||
|
val resetSetterResetProvider = resetSetter.map(_.tileResetProviderNode).getOrElse(ClockGroupEphemeralNode())
|
||||||
|
|
||||||
val aggregator = LazyModule(new ClockGroupAggregator("allClocks")).node
|
val aggregator = LazyModule(new ClockGroupAggregator("allClocks")).node
|
||||||
// provides the implicit clock to the system
|
// provides the implicit clock to the system
|
||||||
@@ -81,7 +83,6 @@ object ClockingSchemeGenerators {
|
|||||||
:= aggregator)
|
:= aggregator)
|
||||||
// provides the system clock (ex. the bus clocks)
|
// provides the system clock (ex. the bus clocks)
|
||||||
(systemAsyncClockGroup
|
(systemAsyncClockGroup
|
||||||
:*= resetSetter
|
|
||||||
:*= ClockGroupNamePrefixer()
|
:*= ClockGroupNamePrefixer()
|
||||||
:*= aggregator)
|
:*= aggregator)
|
||||||
|
|
||||||
@@ -91,13 +92,19 @@ object ClockingSchemeGenerators {
|
|||||||
(aggregator
|
(aggregator
|
||||||
:= ClockGroupFrequencySpecifier(p(ClockFrequencyAssignersKey), p(DefaultClockFrequencyKey))
|
:= ClockGroupFrequencySpecifier(p(ClockFrequencyAssignersKey), p(DefaultClockFrequencyKey))
|
||||||
:= ClockGroupResetSynchronizer()
|
:= ClockGroupResetSynchronizer()
|
||||||
|
:= resetSetterResetProvider
|
||||||
:= dividerOnlyClkGenerator.node
|
:= dividerOnlyClkGenerator.node
|
||||||
:= referenceClockSource)
|
:= referenceClockSource)
|
||||||
|
|
||||||
|
val asyncResetBroadcast = FixedClockBroadcast(None)
|
||||||
|
resetSetter.foreach(_.asyncResetSinkNode := asyncResetBroadcast)
|
||||||
|
val asyncResetSource = ClockSourceNode(Seq(ClockSourceParameters()))
|
||||||
|
asyncResetBroadcast := asyncResetSource
|
||||||
|
|
||||||
InModuleBody {
|
InModuleBody {
|
||||||
val clock_wire = Wire(Input(Clock()))
|
val clock_wire = Wire(Input(Clock()))
|
||||||
val reset_wire = GenerateReset(chiptop, clock_wire)
|
val reset_wire = GenerateReset(chiptop, clock_wire)
|
||||||
val (clock_io, clockIOCell) = IOCell.generateIOFromSignal(clock_wire, "clock")
|
val (clock_io, clockIOCell) = IOCell.generateIOFromSignal(clock_wire, "clock", p(IOCellKey))
|
||||||
chiptop.iocells ++= clockIOCell
|
chiptop.iocells ++= clockIOCell
|
||||||
|
|
||||||
referenceClockSource.out.unzip._1.map { o =>
|
referenceClockSource.out.unzip._1.map { o =>
|
||||||
@@ -105,6 +112,11 @@ object ClockingSchemeGenerators {
|
|||||||
o.reset := reset_wire
|
o.reset := reset_wire
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asyncResetSource.out.unzip._1.map { o =>
|
||||||
|
o.clock := false.B.asClock // async reset broadcast network does not provide a clock
|
||||||
|
o.reset := reset_wire
|
||||||
|
}
|
||||||
|
|
||||||
chiptop.harnessFunctions += ((th: HasHarnessSignalReferences) => {
|
chiptop.harnessFunctions += ((th: HasHarnessSignalReferences) => {
|
||||||
clock_io := th.harnessClock
|
clock_io := th.harnessClock
|
||||||
Nil })
|
Nil })
|
||||||
|
|||||||
@@ -151,6 +151,16 @@ class WithNPerfCounters(n: Int = 29) extends Config((site, here, up) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
class WithNPMPs(n: Int = 8) extends Config((site, here, up) => {
|
||||||
|
case TilesLocated(InSubsystem) => up(TilesLocated(InSubsystem), site) map {
|
||||||
|
case tp: RocketTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
|
||||||
|
core = tp.tileParams.core.copy(nPMPs = n)))
|
||||||
|
case tp: BoomTileAttachParams => tp.copy(tileParams = tp.tileParams.copy(
|
||||||
|
core = tp.tileParams.core.copy(nPMPs = n)))
|
||||||
|
case other => other
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
class WithRocketICacheScratchpad extends Config((site, here, up) => {
|
class WithRocketICacheScratchpad extends Config((site, here, up) => {
|
||||||
case RocketTilesKey => up(RocketTilesKey, site) map { r =>
|
case RocketTilesKey => up(RocketTilesKey, site) map { r =>
|
||||||
r.copy(icache = r.icache.map(_.copy(itimAddr = Some(0x300000 + r.hartId * 0x10000))))
|
r.copy(icache = r.icache.map(_.copy(itimAddr = Some(0x300000 + r.hartId * 0x10000))))
|
||||||
|
|||||||
Submodule generators/testchipip updated: 6b082f1edb...0c1b871ddd
@@ -21,6 +21,7 @@ usage() {
|
|||||||
echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install"
|
echo " --prefix PREFIX : Install destination. If unset, defaults to $(pwd)/riscv-tools-install"
|
||||||
echo " or $(pwd)/esp-tools-install"
|
echo " or $(pwd)/esp-tools-install"
|
||||||
echo " --ignore-qemu : Ignore installing QEMU"
|
echo " --ignore-qemu : Ignore installing QEMU"
|
||||||
|
echo " --arch -a : Architecture (e.g., rv64gc)"
|
||||||
echo " --help -h : Display this message"
|
echo " --help -h : Display this message"
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
@@ -37,6 +38,7 @@ TOOLCHAIN="riscv-tools"
|
|||||||
EC2FASTINSTALL="false"
|
EC2FASTINSTALL="false"
|
||||||
IGNOREQEMU=""
|
IGNOREQEMU=""
|
||||||
RISCV=""
|
RISCV=""
|
||||||
|
ARCH=""
|
||||||
|
|
||||||
# getopts does not support long options, and is inflexible
|
# getopts does not support long options, and is inflexible
|
||||||
while [ "$1" != "" ];
|
while [ "$1" != "" ];
|
||||||
@@ -49,6 +51,9 @@ do
|
|||||||
RISCV=$(realpath $1) ;;
|
RISCV=$(realpath $1) ;;
|
||||||
--ignore-qemu )
|
--ignore-qemu )
|
||||||
IGNOREQEMU="true" ;;
|
IGNOREQEMU="true" ;;
|
||||||
|
-a | --arch )
|
||||||
|
shift
|
||||||
|
ARCH=$1 ;;
|
||||||
riscv-tools | esp-tools)
|
riscv-tools | esp-tools)
|
||||||
TOOLCHAIN=$1 ;;
|
TOOLCHAIN=$1 ;;
|
||||||
ec2fast )
|
ec2fast )
|
||||||
@@ -65,6 +70,15 @@ if [ -z "$RISCV" ] ; then
|
|||||||
RISCV="$(pwd)/$INSTALL_DIR"
|
RISCV="$(pwd)/$INSTALL_DIR"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$ARCH" ] ; then
|
||||||
|
XLEN=64
|
||||||
|
elif [[ "$ARCH" =~ ^rv(32|64)((i?m?a?f?d?|g?)c?)$ ]]; then
|
||||||
|
XLEN=${BASH_REMATCH[1]}
|
||||||
|
else
|
||||||
|
error "invalid arch $ARCH"
|
||||||
|
usage 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Installing toolchain to $RISCV"
|
echo "Installing toolchain to $RISCV"
|
||||||
|
|
||||||
# install risc-v tools
|
# install risc-v tools
|
||||||
@@ -118,7 +132,7 @@ else
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
module_prepare riscv-gnu-toolchain qemu
|
module_prepare riscv-gnu-toolchain qemu
|
||||||
module_build riscv-gnu-toolchain --prefix="${RISCV}" --with-cmodel=medany
|
module_build riscv-gnu-toolchain --prefix="${RISCV}" --with-cmodel=medany ${ARCH:+--with-arch=${ARCH}}
|
||||||
echo '==> Building GNU/Linux toolchain'
|
echo '==> Building GNU/Linux toolchain'
|
||||||
module_make riscv-gnu-toolchain linux
|
module_make riscv-gnu-toolchain linux
|
||||||
fi
|
fi
|
||||||
@@ -129,15 +143,15 @@ echo '==> Installing libfesvr static library'
|
|||||||
module_make riscv-isa-sim libfesvr.a
|
module_make riscv-isa-sim libfesvr.a
|
||||||
cp -p "${SRCDIR}/riscv-isa-sim/build/libfesvr.a" "${RISCV}/lib/"
|
cp -p "${SRCDIR}/riscv-isa-sim/build/libfesvr.a" "${RISCV}/lib/"
|
||||||
|
|
||||||
CC= CXX= module_all riscv-pk --prefix="${RISCV}" --host=riscv64-unknown-elf
|
CC= CXX= module_all riscv-pk --prefix="${RISCV}" --host=riscv${XLEN}-unknown-elf
|
||||||
module_all riscv-tests --prefix="${RISCV}/riscv64-unknown-elf"
|
module_all riscv-tests --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --with-xlen=${XLEN}
|
||||||
|
|
||||||
# Common tools (not in any particular toolchain dir)
|
# Common tools (not in any particular toolchain dir)
|
||||||
|
|
||||||
CC= CXX= SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv64-unknown-elf" --host=riscv64-unknown-elf
|
CC= CXX= SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --host=riscv${XLEN}-unknown-elf
|
||||||
|
|
||||||
if [ -z "$IGNOREQEMU" ] ; then
|
if [ -z "$IGNOREQEMU" ] ; then
|
||||||
SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=riscv64-softmmu
|
SRCDIR="$(pwd)/toolchains" module_all qemu --prefix="${RISCV}" --target-list=riscv${XLEN}-softmmu
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# make Dromajo
|
# make Dromajo
|
||||||
|
|||||||
Reference in New Issue
Block a user