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

Toolchain update for IIS users #9

Merged
merged 2 commits into from
Mar 20, 2024
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
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# Author: Matheus Cavalcante, ETH Zurich
# Authors:
# Matheus Cavalcante, ETH Zurich
# Mattia Sinigaglia, University of Bologna

# Include Makefrag
include util/Makefrag
Expand All @@ -13,9 +15,13 @@ BENDER_VERSION = 0.27.1
# Do not include minifloat opcodes, since they conflict with the RVV opcodes!
OPCODES := "opcodes-rvv opcodes-rv32b_CUSTOM opcodes-ipu_CUSTOM opcodes-frep_CUSTOM opcodes-dma_CUSTOM opcodes-ssr_CUSTOM opcodes-smallfloat"


# Default target
all: bender toolchain update_opcodes

# Target for IIS users
init: bender update_opcodes

###############
# Toolchain #
###############
Expand Down Expand Up @@ -107,18 +113,18 @@ tc-riscv-isa-sim: sw/toolchain/riscv-isa-sim sw/toolchain/dtc

bender: check-bender
check-bender:
@if [ -x $(BENDER_INSTALL_DIR)/bin/bender ]; then \
@if [ -x $(BENDER_INSTALL_DIR)/bender ]; then \
req="bender $(BENDER_VERSION)"; \
current="$$($(BENDER_INSTALL_DIR)/bin/bender --version)"; \
current="$$($(BENDER_INSTALL_DIR)/bender --version)"; \
if [ "$$(printf '%s\n' "$${req}" "$${current}" | sort -V | head -n1)" != "$${req}" ]; then \
rm -rf $(BENDER_INSTALL_DIR); \
fi \
fi
@$(MAKE) -C $(ROOT_DIR) $(BENDER_INSTALL_DIR)/bin/bender
@$(MAKE) -C $(ROOT_DIR) $(BENDER_INSTALL_DIR)/bender

$(BENDER_INSTALL_DIR)/bin/bender:
$(BENDER_INSTALL_DIR)/bender:
mkdir -p $(BENDER_INSTALL_DIR) && cd $(BENDER_INSTALL_DIR) && \
cargo install bender --version $(BENDER_VERSION) --root $(BENDER_INSTALL_DIR) --locked
curl --proto '=https' --tlsv1.2 https://pulp-platform.github.io/bender/init -sSf | sh -s -- $(BENDER_VERSION)

###############
# Verilator #
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ make all

The Makefile target will automatically download and compile tested versions of LLVM, GCC, Spike, and Verilator. It might take a while. If you have issues cloning the GitHub modules, you might need to remove the folders in `sw/toolchain`.

ETH users can source the toolchains and initialize the environment by doing:

```bash

source util/iis-env.sh

make init
```

The Spatz cluster system (hw/system/spatz_cluster) is a fundamental system around a Snitch core and a Spatz coprocessor. The cluster can be configured using a config file. The configuration parameters are documented using JSON schema, and documentation is generated for the schema. The cluster testbench simulates an infinite memory. The RISC-V ELF file is preloaded using RISC-V's Front-end Server (`fesvr`).

### Simulating the system
Expand Down
6 changes: 4 additions & 2 deletions util/Makefrag
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# Author: Matheus Cavalcante, ETH Zurich
# Authors:
# Matheus Cavalcante, ETH Zurich
# Mattia Sinigaglia, University of Bologna

# Root
SHELL = /usr/bin/env bash
Expand All @@ -19,7 +21,7 @@ BENDER_INSTALL_DIR ?= ${INSTALL_DIR}/bender
VERILATOR_INSTALL_DIR ?= ${INSTALL_DIR}/verilator

# Support for local override
BENDER ?= ${BENDER_INSTALL_DIR}/bin/bender
BENDER ?= ${BENDER_INSTALL_DIR}/bender
DASM ?= ${SPIKE_INSTALL_DIR}/bin/spike-dasm
VLT ?= ${VERILATOR_INSTALL_DIR}/bin/verilator_bin
CMAKE ?= cmake-3.18.1
Expand Down
9 changes: 9 additions & 0 deletions util/iis-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright 2022 ETH Zurich and University of Bologna.
# Solderpad Hardware License, Version 0.51, see LICENSE for details.
# SPDX-License-Identifier: SHL-0.51
#
# Author: Mattia Sinigaglia, Universisty of Bologna

echo "export Spatz toolchains"
export LLVM_INSTALL_DIR=/usr/pack/riscv-1.0-kgf/spatz-llvm-2023.08.10
export GCC_INSTALL_DIR=/usr/pack/riscv-1.0-kgf/spatz-gcc-7.1.1
Loading