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

moore: Update building script with LLVM #162

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
40 changes: 40 additions & 0 deletions sv-front/moore/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,46 @@
set -e
set -x

git submodule update --depth=1 --init --recursive

# Build LLVM and MLIR

mkdir -p circt/llvm/build
pushd circt/llvm/build
cmake ../llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../install \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_BINDINGS=OFF \
-DLLVM_ENABLE_OCAMLDOC=OFF \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_OPTIMIZED_TABLEGEN=ON \
-DLLVM_TARGETS_TO_BUILD=""
cmake --build . --target install
popd

# Build CIRCT

mkdir -p circt/build
pushd circt/build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../install \
-DMLIR_DIR=$PWD/../llvm/install/lib/cmake/mlir \
-DLLVM_DIR=$PWD/../llvm/install/lib/cmake/llvm \
-DLLVM_ENABLE_ASSERTIONS=ON
cmake --build . --target install
popd

# Build Moore

export CIRCT_SYS_CIRCT_DIR=$PWD/circt
export CIRCT_SYS_CIRCT_BUILD_DIR=$PWD/circt/install
export CIRCT_SYS_LLVM_DIR=$PWD/circt/llvm
export CIRCT_SYS_LLVM_BUILD_DIR=$PWD/circt/llvm/install

curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env

Expand Down
4 changes: 4 additions & 0 deletions sv-front/moore/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ build:
script_env:
- CI

requirements:
build:
- cmake

test:
commands:
- moore --version
Expand Down