Merge branch 'main' into new-hammer

This commit is contained in:
Harrison Liew
2023-02-10 12:55:41 -08:00
11 changed files with 183 additions and 17 deletions

View File

@@ -279,15 +279,15 @@ SIM_DEBUG_PREREQ = $(sim_debug)
endif endif
# run normal binary with hardware-logged insn dissassembly # run normal binary with hardware-logged insn dissassembly
run-binary: $(output_dir) $(SIM_PREREQ) check-binary run-binary: $(SIM_PREREQ) check-binary | $(output_dir)
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) $(BINARY) </dev/null 2> >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log) (set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(PERMISSIVE_OFF) $(BINARY) </dev/null 2> >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log)
# run simulator as fast as possible (no insn disassembly) # run simulator as fast as possible (no insn disassembly)
run-binary-fast: $(output_dir) $(SIM_PREREQ) check-binary run-binary-fast: $(SIM_PREREQ) check-binary | $(output_dir)
(set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(PERMISSIVE_OFF) $(BINARY) </dev/null | tee $(sim_out_name).log) (set -o pipefail && $(NUMA_PREFIX) $(sim) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(PERMISSIVE_OFF) $(BINARY) </dev/null | tee $(sim_out_name).log)
# run simulator with as much debug info as possible # run simulator with as much debug info as possible
run-binary-debug: $(output_dir) $(SIM_DEBUG_PREREQ) check-binary run-binary-debug: $(SIM_DEBUG_PREREQ) check-binary | $(output_dir)
(set -o pipefail && $(NUMA_PREFIX) $(sim_debug) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(WAVEFORM_FLAG) $(PERMISSIVE_OFF) $(BINARY) </dev/null 2> >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log) (set -o pipefail && $(NUMA_PREFIX) $(sim_debug) $(PERMISSIVE_ON) $(SIM_FLAGS) $(EXTRA_SIM_FLAGS) $(SEED_FLAG) $(VERBOSE_FLAGS) $(WAVEFORM_FLAG) $(PERMISSIVE_OFF) $(BINARY) </dev/null 2> >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log)
run-fast: run-asm-tests-fast run-bmark-tests-fast run-fast: run-asm-tests-fast run-bmark-tests-fast
@@ -295,23 +295,23 @@ run-fast: run-asm-tests-fast run-bmark-tests-fast
######################################################################################### #########################################################################################
# helper rules to run simulator with fast loadmem via hex files # helper rules to run simulator with fast loadmem via hex files
######################################################################################### #########################################################################################
$(binary_hex): $(output_dir) $(BINARY) $(binary_hex): $(firstword $(BINARY)) | $(output_dir)
$(base_dir)/scripts/smartelf2hex.sh $(BINARY) > $(binary_hex) $(base_dir)/scripts/smartelf2hex.sh $(firstword $(BINARY)) > $(binary_hex)
run-binary-hex: check-binary run-binary-hex: check-binary
run-binary-hex: $(output_dir) $(SIM_PREREQ) $(binary_hex) run-binary-hex: $(SIM_PREREQ) $(binary_hex) | $(output_dir)
run-binary-hex: run-binary run-binary-hex: run-binary
run-binary-hex: override LOADMEM_ADDR = 80000000 run-binary-hex: override LOADMEM_ADDR = 80000000
run-binary-hex: override LOADMEM = $(binary_hex) run-binary-hex: override LOADMEM = $(binary_hex)
run-binary-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR) run-binary-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR)
run-binary-debug-hex: check-binary run-binary-debug-hex: check-binary
run-binary-debug-hex: $(output_dir) $(SIM_DEBUG_REREQ) $(binary_hex) run-binary-debug-hex: $(SIM_DEBUG_REREQ) $(binary_hex) | $(output_dir)
run-binary-debug-hex: run-binary-debug run-binary-debug-hex: run-binary-debug
run-binary-debug-hex: override LOADMEM_ADDR = 80000000 run-binary-debug-hex: override LOADMEM_ADDR = 80000000
run-binary-debug-hex: override LOADMEM = $(binary_hex) run-binary-debug-hex: override LOADMEM = $(binary_hex)
run-binary-debug-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR) run-binary-debug-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR)
run-binary-fast-hex: check-binary run-binary-fast-hex: check-binary
run-binary-fast-hex: $(output_dir) $(SIM_PREREQ) $(binary_hex) run-binary-fast-hex: $(SIM_PREREQ) $(binary_hex) | $(output_dir)
run-binary-fast-hex: run-binary-fast run-binary-fast-hex: run-binary-fast
run-binary-fast-hex: override LOADMEM_ADDR = 80000000 run-binary-fast-hex: override LOADMEM_ADDR = 80000000
run-binary-fast-hex: override LOADMEM = $(binary_hex) run-binary-fast-hex: override LOADMEM = $(binary_hex)
@@ -323,7 +323,7 @@ run-binary-fast-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(L
$(output_dir): $(output_dir):
mkdir -p $@ mkdir -p $@
$(output_dir)/%: $(RISCV)/riscv64-unknown-elf/share/riscv-tests/isa/% $(output_dir) $(output_dir)/%: $(RISCV)/riscv64-unknown-elf/share/riscv-tests/isa/% | $(output_dir)
ln -sf $< $@ ln -sf $< $@
$(output_dir)/%.run: $(output_dir)/% $(SIM_PREREQ) $(output_dir)/%.run: $(output_dir)/% $(SIM_PREREQ)

View File

@@ -14,4 +14,4 @@ dependencies:
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications # https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications
# documentation on package_spec syntax for constraining versions # documentation on package_spec syntax for constraining versions
- esp-tools # from ucb-bar channel - https://github.com/ucb-bar/esp-tools-feedstock - esp-tools=1.0.1 # from ucb-bar channel - https://github.com/ucb-bar/esp-tools-feedstock

View File

@@ -14,4 +14,4 @@ dependencies:
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications # https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications
# documentation on package_spec syntax for constraining versions # documentation on package_spec syntax for constraining versions
- riscv-tools # from ucb-bar channel - https://github.com/ucb-bar/riscv-tools-feedstock - riscv-tools=1.0.1 # from ucb-bar channel - https://github.com/ucb-bar/riscv-tools-feedstock

View File

@@ -0,0 +1,134 @@
channels:
- ucb-bar
- conda-forge
- nodefaults
dependencies:
# https://conda-forge.org/feedstock-outputs/
# filterable list of all conda-forge packages
# https://conda-forge.org/#contribute
# instructions on adding a recipe
# https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/pkg-specs.html#package-match-specifications
# documentation on package_spec syntax for constraining versions
# handy tool for introspecting package relationships and file ownership
# see https://github.com/rvalieris/conda-tree
- conda-tree
# bundle FireSim driver with deps into installer shell-script
- constructor
- gcc
- gxx
- sysroot_linux-64>=2.17 # needed to match pre-built CI XRT glibc version
- conda-gcc-specs
- binutils
- dromajo # from ucb-bar channel - https://github.com/riscv-boom/dromajo
- riscv-tools=1.0.1 # from ucb-bar channel - https://github.com/ucb-bar/riscv-tools-feedstock
- firtool # from ucb-bar channel - https://github.com/ucb-bar/firtool-feedstock
# firemarshal deps
- python>=3.8
- bc
- patch
- which
- diffutils
- bash
- gzip
- bzip2
- perl
- tar
- file
- findutils
- rsync
- psutil
- doit=0.35.0
- gitpython
- humanfriendly
- e2fsprogs
- ctags
- bison
- flex
- expat
- make
- pyyaml
- unzip
- readline
- coreutils
- lzop
- qemu # from ucb-bar channel - https://github.com/ucb-bar/qemu-feedstock
- jq
- bash-completion
- sbt
- ca-certificates
- mosh
- gmp
- mpfr
- mpc
- zlib
- vim
- git
- openjdk
- gengetopt
- libffi
- expat
- libusb1
- ncurses
- cmake
- graphviz
- expect
- dtc
- verilator==4.226
- screen
- elfutils
- libdwarf-dev==0.0.0.20190110_28_ga81397fc4 # from ucb-bar channel - using mainline libdwarf-feedstock
- conda-lock>=1
- wget
- sed
- autoconf
# clang-format for driver coding style enforcement.
- clang-format
- clang-tools
# python packages
# While it is possible to install using pip after creating the
# conda environment, pip's dependency resolution can conflict with
# conda and create broken environments. It's best to use the conda
# packages so that the environment is consistent
- boto3==1.20.21
- colorama==0.4.3
- argcomplete==1.12.3
- python-graphviz==0.19
- pyparsing==3.0.6
- numpy==1.19.5
- kiwisolver==1.3.1
- matplotlib-base==3.3.4
- pandas==1.1.5
- awscli==1.22.21
- pytest==6.2.5
- pytest-dependency==0.5.1
- pytest-mock==3.7.0
- moto==3.1.0
- pyyaml==5.4.1
- mypy==0.931
- types-pyyaml==6.0.4
- boto3-stubs==1.21.6
- botocore-stubs==1.24.7
- mypy-boto3-s3==1.21.0
- pip
- pip:
- fab-classic==1.19.1
- mypy-boto3-ec2==1.21.9
- sure==2.0.0
- pylddwrap==1.2.1
# doc requirements
- sphinx
- pygments
- sphinx-autobuild
- sphinx_rtd_theme
- docutils

View File

@@ -65,9 +65,11 @@ Start by checking out the proper Chipyard version. Run:
git checkout |version| git checkout |version|
Next run the following script to fully setup Chipyard with a specific toolchain. 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. 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. .. 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. Ensure that this script completes fully (no interruptions) before continuing on.

View File

@@ -260,11 +260,11 @@ extern "C" void spike_tile(int hartid, char* isa,
"vlen:128,elen:64", "vlen:128,elen:64",
false, false,
endianness_little, endianness_little,
false,
pmpregions, pmpregions,
std::vector<mem_cfg_t>(), std::vector<mem_cfg_t>(),
std::vector<int>(), std::vector<int>(),
false); false,
0);
processor_t* p = new processor_t(isa_parser, processor_t* p = new processor_t(isa_parser,
cfg, cfg,
simif, simif,

View File

@@ -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 # setup and install conda environment
if run_step "1"; then if run_step "1"; then
# note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154 # note: lock file must end in .conda-lock.yml - see https://github.com/conda-incubator/conda-lock/issues/154

View File

@@ -102,4 +102,13 @@ echo '==> Installing espresso logic minimizer'
echo '==> Installing libgloss' echo '==> Installing libgloss'
CC= CXX= SRCDIR="$(pwd)/toolchains" module_all libgloss --prefix="${RISCV}/riscv${XLEN}-unknown-elf" --host=riscv${XLEN}-unknown-elf 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!" echo "Extra Toolchain Utilities/Tests Build Complete!"