-
Notifications
You must be signed in to change notification settings - Fork 651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NVDLA Integration + Cleanup Ariane Preprocessing #505
Conversation
Thanks to @farzadfch for the help! |
Thanks for sharing the PR. A few points:
|
Agreed, thanks for sharing this! I've also done work recently on integrating the NVDLA into Chipyard/FireSim, so I'd love to contribute some of my learnings and help move this along. For @farzadfch's third point, I generated the DTS compatibility string like this to integrate with the new kernel mode driver: val dtsdevice = new SimpleDevice("nvdla",Seq("nvidia,nv_" + params.config)) For integrating the NVDLA Linux driver into the current FireSim Linux kernel (version 5.3), the process was not so bad, but changes were necessary. Some functions were deprecated, but have drop-in replacements, and some new I have a concern with the test Furthermore, since the I'm also curious to read through Regarding the Related FireSim vs SoC question: I haven't thought about this too much yet, but it would be good to look into the issue of selecting the NVDLA-provided FPGA vs. synthesis RAM models for these two different use cases as well. |
Wow. Thanks for the quick feedback! Linux Testing: CI Tests/Other Tests: Insert Includes: Clock Requirements: FPGA vs SoC RAMs: Please let me know if you guys have any other questions or concerns! |
It is now legal to have blackboxes with multiple clocks in FireSim, but i have not tested that case. It should just trivially work though if the existing clock gating scheme works on the NVDLA with a single clock. |
Here's what I did with the Linux driver:
At this point, I moved all of this work into the current Linux kernel fork in the FireMarshal repo. If you try to compile the Linux kernel, you'll run into a number of compilation errors. Here are the diffs I had to make to solve those errors:
After making those changes, the driver compiled and functioned properly. I've only tested with the |
Thanks @tymcauley Ill take a look at the Linux driver work. I also added a switch to the config to choose between fpga/synth rams. Let me know if that works for you. |
That switch looks great to me, thanks! |
class WithNVDLALarge extends chipyard.config.WithNVDLA("large") | ||
class WithNVDLASmall extends chipyard.config.WithNVDLA("small") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think these might belong in this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC I think for you to make a build recipe like WithNVDLALarge_SomeFireSimConfig
as the TARGET_CONFIG
you need all of the components in the same scala package.
What is the error? Does it complain about |
No, although I did have to add diff --git a/software/firemarshal/wlutil/br/buildroot-config b/software/firemarshal/wlutil/br/buildroot-config
index 69df8c3..54f3af4 100644
--- a/software/firemarshal/wlutil/br/buildroot-config
+++ b/software/firemarshal/wlutil/br/buildroot-config
@@ -717,7 +717,7 @@ BR2_TOOLCHAIN_EXTERNAL_INET_RPC=y
BR2_TOOLCHAIN_EXTERNAL_PATH="$(RISCV)"
BR2_TOOLCHAIN_EXTERNAL_PREFIX="$(ARCH)-unknown-linux-gnu"
BR2_TOOLCHAIN_EXTERNAL_PREINSTALLED=y
-BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS=""
+BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS="libgomp.so.1"
BR2_TOOLCHAIN_HAS_FULL_GETTEXT=y
BR2_TOOLCHAIN_HAS_NATIVE_RPC=y
BR2_TOOLCHAIN_HAS_SSP=y Once I did that and ran
|
A few comments about some files in the
#!/bin/bash
set -ex
cd "$(dirname "$0")"
function build_nvdla_rtl() {
local NVDLA_TYPE="$1"
echo "Building NVDLA configuration: \"$NVDLA_TYPE\""
cp tree.make hw
sed -i -e "s/nv_small/$NVDLA_TYPE/" hw/tree.make
cd hw
./tools/bin/tmake -build vmod
cd ..
}
function install_nvdla_rtl() {
local NVDLA_TYPE="$1"
local SRC_DIR=hw/outdir/nv_$NVDLA_TYPE/vmod
local DST_DIR=vsrc/$NVDLA_TYPE
rm -rf "$DST_DIR/vmod"
rsync -av \
--exclude="*.vcp" \
--exclude="*.swl" \
--include="nv_assert_no_x.vlib" \
--exclude="*.vlib" \
"$SRC_DIR" "$DST_DIR"
}
function generate_vsrc_mk() {
# TODO: generate `vsrc.mk` from the files in `vsrc/*`
exit 1
}
NVDLA_TYPE=small
build_nvdla_rtl $NVDLA_TYPE
install_nvdla_rtl $NVDLA_TYPE
NVDLA_TYPE=large
build_nvdla_rtl $NVDLA_TYPE
install_nvdla_rtl $NVDLA_TYPE
generate_vsrc_mk Then we could adjust the |
The As mentioned earlier, after I used the |
2818e8f
to
c9d72ea
Compare
c9d72ea
to
bd748d1
Compare
@tymcauley @farzadfch I'm looking to push this through into @alonamid Any documentation / usability comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for driving this @abejgonzalez!
NVDLA Software with FireMarshal | ||
------------------------------- | ||
|
||
Located at ``software/nvdla-workload`` is a FireMarshal-based workload to boot Linux with the proper NVDLA drivers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How likely is this to get broken upon Linux kernel upgrades?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully not by much... but frankly I wouldn't know until one happened.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One is expected to happen this week? firesim/FireMarshal#151
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the SW to match the bumped kernel (added extra instructions in the SW workload section to address this).
Why does this include a firesim bump now that the firesim configs are inside the nvdla wrapper? |
LGTM overall, although other people tend to have stronger opinions than me about adding Verilator flags |
When I bump after the #544 PR, I will point to the correct FireSim repository. |
The Verilator flag matches RC and fixes the same issue they were seeing so I don't see others having a problem with it. |
// Enables tracing on all cores | ||
class WithTraceIO extends Config((site, here, up) => { | ||
case BoomTilesKey => up(BoomTilesKey) map (tile => tile.copy(trace = true)) | ||
case ArianeTilesKey => up(ArianeTilesKey) map (tile => tile.copy(trace = true)) | ||
case TracePortKey => Some(TracePortParams()) | ||
}) | ||
|
||
// Adds a small/large NVDLA to the system | ||
class WithNVDLALarge extends nvidia.blocks.dla.WithNVDLA("large") | ||
class WithNVDLASmall extends nvidia.blocks.dla.WithNVDLA("small") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC to do something like this WithNVDLASmall_DDR3FRFCFSLLC4MB_FireSimQuadRocketConfig
in the build recipe you need to have WithNVDLA...
here. (so that everything is in the same scala package). I assume that this would be the easiest way to add an NVDLA for external users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related issue:
Type of change: new feature
Impact: rtl change | software change
Release Notes
Chipyard
This integrates
master
of NVDLA into Chipyard based off work done in (https://github.com/CSL-KU/nvidia-dla-blocks) and (https://github.com/sifive/block-nvdla-sifive). This builds in both VCS and Verilator. Tested with the NVDLA test put intests/
. This also changes Ariane to use theinsert-includes.py
script that replaces includes (instead of using Verilator).FireSim
Added both
small
@75mhz andlarge
@50MHz NVDLA to Rocket configs. Bothsmall
andlarge
have completed AFI builds.Remaining Todos
nvdla-sw
regressions)WithNVDLALarge
WithNVDLASmall
) - Removedsmall
andlarge
(just addedsmall
unless FireSim devs want more)opendla_small.h
to something more reasonableHasPeripheryNVDLA
toCanHave
.gitmodules
fornvdla-workload
nvdla-sw
to behttps