diff --git a/common.mk b/common.mk index 08801dff..ded40c5e 100644 --- a/common.mk +++ b/common.mk @@ -279,15 +279,15 @@ SIM_DEBUG_PREREQ = $(sim_debug) endif # 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) >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log) # 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) >(spike-dasm > $(sim_out_name).out) | tee $(sim_out_name).log) 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 ######################################################################################### -$(binary_hex): $(output_dir) $(BINARY) - $(base_dir)/scripts/smartelf2hex.sh $(BINARY) > $(binary_hex) +$(binary_hex): $(firstword $(BINARY)) | $(output_dir) + $(base_dir)/scripts/smartelf2hex.sh $(firstword $(BINARY)) > $(binary_hex) 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: override LOADMEM_ADDR = 80000000 run-binary-hex: override LOADMEM = $(binary_hex) run-binary-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR) 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: override LOADMEM_ADDR = 80000000 run-binary-debug-hex: override LOADMEM = $(binary_hex) run-binary-debug-hex: override SIM_FLAGS += +loadmem=$(LOADMEM) +loadmem_addr=$(LOADMEM_ADDR) 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: override LOADMEM_ADDR = 80000000 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): 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 $< $@ $(output_dir)/%.run: $(output_dir)/% $(SIM_PREREQ) diff --git a/conda-reqs/esp-tools.yaml b/conda-reqs/esp-tools.yaml index 4c4bc949..9603f747 100644 --- a/conda-reqs/esp-tools.yaml +++ b/conda-reqs/esp-tools.yaml @@ -14,4 +14,4 @@ dependencies: # 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 - - 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 diff --git a/conda-reqs/riscv-tools.yaml b/conda-reqs/riscv-tools.yaml index 9edd0d32..ab667b79 100644 --- a/conda-reqs/riscv-tools.yaml +++ b/conda-reqs/riscv-tools.yaml @@ -14,4 +14,4 @@ dependencies: # 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 - - 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 diff --git a/conda-requirements-riscv-tools.yaml b/conda-requirements-riscv-tools.yaml new file mode 100644 index 00000000..131c3ef5 --- /dev/null +++ b/conda-requirements-riscv-tools.yaml @@ -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 diff --git a/docs/Chipyard-Basics/Initial-Repo-Setup.rst b/docs/Chipyard-Basics/Initial-Repo-Setup.rst index 87639f87..45263a14 100644 --- a/docs/Chipyard-Basics/Initial-Repo-Setup.rst +++ b/docs/Chipyard-Basics/Initial-Repo-Setup.rst @@ -65,9 +65,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. diff --git a/generators/chipyard/src/main/resources/csrc/spiketile.cc b/generators/chipyard/src/main/resources/csrc/spiketile.cc index 06b57ab3..bedc41f3 100644 --- a/generators/chipyard/src/main/resources/csrc/spiketile.cc +++ b/generators/chipyard/src/main/resources/csrc/spiketile.cc @@ -260,11 +260,11 @@ extern "C" void spike_tile(int hartid, char* isa, "vlen:128,elen:64", false, endianness_little, - false, pmpregions, std::vector(), std::vector(), - false); + false, + 0); processor_t* p = new processor_t(isa_parser, cfg, simif, diff --git a/generators/gemmini b/generators/gemmini index 74251dc6..b6389f3e 160000 --- a/generators/gemmini +++ b/generators/gemmini @@ -1 +1 @@ -Subproject commit 74251dc61f971fd684bc37963f7db9d8a5bd206a +Subproject commit b6389f3ea7bbf070aa3dd40972daa5be7e2d4261 diff --git a/scripts/build-setup.sh b/scripts/build-setup.sh index 77a988c3..7f14a738 100755 --- a/scripts/build-setup.sh +++ b/scripts/build-setup.sh @@ -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 diff --git a/scripts/build-toolchain-extra.sh b/scripts/build-toolchain-extra.sh index 1bc54297..54afe983 100755 --- a/scripts/build-toolchain-extra.sh +++ b/scripts/build-toolchain-extra.sh @@ -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!" diff --git a/toolchains/libgloss b/toolchains/libgloss index 04b24976..0ecdf7fa 160000 --- a/toolchains/libgloss +++ b/toolchains/libgloss @@ -1 +1 @@ -Subproject commit 04b249764b1bc0b784b9f7ff422084f4b53a07ef +Subproject commit 0ecdf7fa08c9e40f9d60903b8189511beb8555ab diff --git a/toolchains/riscv-tools/riscv-isa-sim b/toolchains/riscv-tools/riscv-isa-sim index 0eec0c91..46176719 160000 --- a/toolchains/riscv-tools/riscv-isa-sim +++ b/toolchains/riscv-tools/riscv-isa-sim @@ -1 +1 @@ -Subproject commit 0eec0c911933ccc722d4b4479a6c4b8ac68f2f52 +Subproject commit 461767199aac9c15894513254ae4844de5ee78d0