Skip to content
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

Use riscv-tools with gemmini - only install esp-tools for hwacha #1327

Merged
merged 8 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/Chipyard-Basics/Initial-Repo-Setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ Start by checking out the proper Chipyard version. Run:
git checkout |version|

Next run the following script to fully setup Chipyard with a specific toolchain.
There are two toolchains, one for normal RISC-V programs called ``riscv-tools`` which is the one needed for most Chipyard use-cases, and another for Hwacha/Gemmini called ``esp-tools``.
There are two toolchains, one for normal RISC-V programs called ``riscv-tools`` which is the one needed for most Chipyard use-cases, and another for Hwacha called ``esp-tools``.
Run the following script based off which compiler you would like to use.

.. Note:: Prior versions of Chipyard recommended ``esp-tools`` for Gemmini development. Gemmini should now be used with the standard ``riscv-tools``.

.. Warning:: The following script will complete a "full" installation of Chipyard which may take a long time depending on the system.
Ensure that this script completes fully (no interruptions) before continuing on.

Expand Down
4 changes: 2 additions & 2 deletions generators/chipyard/src/main/resources/csrc/spiketile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,11 @@ extern "C" void spike_tile(int hartid, char* isa,
"vlen:128,elen:64",
false,
endianness_little,
false,
pmpregions,
std::vector<mem_cfg_t>(),
std::vector<int>(),
false);
false,
0);
processor_t* p = new processor_t(isa_parser,
cfg,
simif,
Expand Down
2 changes: 1 addition & 1 deletion generators/gemmini
21 changes: 21 additions & 0 deletions scripts/build-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,27 @@ run_step() {

{

# esp-tools should ONLY be used for hwacha.
# Check for this, since many users will be attempting to use this with gemmini
if [ $TOOLCHAIN_TYPE == "esp-tools" ]; then
while true; do
read -p "WARNING: You are trying to install the esp-tools toolchain."$'n'"This should ONLY be used for Hwacha development."$'\n'"Gemmini should be used with riscv-tools."$'\n'"Type \"y\" to continue if this is intended, or \"n\" if not: " validate
case "$validate" in
y | Y)
echo "Installing esp-tools."
break
;;
n | N)
error "Rerun with riscv-tools"
exit 3
;;
*)
error "Invalid response. Please type \"y\" or \"n\""
;;
esac
done
fi

# setup and install conda environment
if run_step "1"; then
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154
Expand Down
9 changes: 9 additions & 0 deletions scripts/build-toolchain-extra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@ echo '==> Installing espresso logic minimizer'
echo '==> Installing libgloss'
CC= CXX= SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --host=riscv${XLEN}-unknown-elf

cd $RDIR
if [ $TOOLCHAIN == "riscv-tools" ]; then
echo '==> Installing gemmini spike extensions'
git submodule update --init generators/gemmini
cd generators/gemmini
git submodule update --init software/libgemmini
make -C $RDIR/generators/gemmini/software/libgemmini install
fi

echo "Extra Toolchain Utilities/Tests Build Complete!"