Skip to content

Commit

Permalink
Update flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mczyz-antmicro committed Jan 24, 2024
1 parent c7bd105 commit a525f04
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 55 deletions.
60 changes: 29 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
pull_request:

jobs:
smoke-tests:
name: Smoke Test
install-chipyard:
name: Install Chipyard
runs-on: ubuntu-latest
container:
image: ghcr.io/antmicro/megaboom-cpu-benchmarking:latest
Expand All @@ -17,15 +17,24 @@ jobs:
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Smoke test
id: smoke_test
- name: install chipyard
id: install_chipyard
run: |
echo "Smoke test"
# pushd tests
# make -j`nproc`
# popd
git clone https://github.com/ucb-bar/chipyard.git
pushd chipyard
git checkout 1.11.0
./build-setup.sh riscv-tools -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9
popd
- name: upload artifact
id: upload_artifact
uses: actions/upload-artifact@v3
with:
name: chipyard
path: chipyard

binary-tests:
name: Binary test
needs: install-chipyard
runs-on: ubuntu-latest
container:
image: ghcr.io/antmicro/megaboom-cpu-benchmarking:latest
Expand All @@ -40,6 +49,11 @@ jobs:
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: chipyard
path: ./chipyard
- name: Binary test
id: binary_test
run: |
Expand All @@ -52,6 +66,7 @@ jobs:
# popd
coremark:
name: Coremark
needs: install-chipyard
runs-on: ubuntu-latest
container:
image: ghcr.io/antmicro/megaboom-cpu-benchmarking:latest
Expand All @@ -61,6 +76,11 @@ jobs:
env:
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: chipyard
path: ./chipyard
- name: Coremark
run: |
echo "Coremark"
Expand All @@ -71,26 +91,4 @@ jobs:
# cat riscv-coremark/build-coremark.sh
# ./build.sh
# popd
verilator_configs:
name: Verilator ChipConfig
runs-on: ubuntu-latest
container:
image: ghcr.io/antmicro/megaboom-cpu-benchmarking:latest
defaults:
run:
shell: bash
env:
DEBIAN_FRONTEND: "noninteractive"
strategy:
fail-fast: false
matrix:
CONFIG: ["RocketConfig", "MegaBoomConfig"]
steps:
- name: Verilator ${{ matrix.CONFIG }}
run: |
echo "Verilator config"
# cd chipyard
# source env.sh
# pushd sims/verilator
# make CONFIG=${{ matrix.CONFIG }} -j`nproc`
# popd
67 changes: 43 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,53 @@

FROM ubuntu:22.04

SHELL ["/bin/bash", "-c"]
SHELL [ "/bin/bash", "--login", "-c" ]

# Install dependencies for ubuntu-req.sh
RUN apt -qqy update && \
DEBIAN_FRONTEND=noninteractive apt install -qqy --no-install-recommends \
ca-certificates build-essential gcc g++ python3 git cmake autoconf bison flex help2man wget
autoconf \
bison \
build-essential \
ca-certificates \
cmake \
curl \
flex \
g++ \
gcc \
git \
help2man \
kmod \
pbzip2 \
python3 \
sudo \
wget
RUN update-ca-certificates

WORKDIR /root
RUN apt -qqy update && \
DEBIAN_FRONTEND=noninteractive apt install -qqy --no-install-recommends \
ca-certificates curl build-essential git sudo pbzip2 kmod
RUN update-ca-certificates
COPY scripts/install-conda.sh /install-conda.sh
COPY scripts/install-chipyard.sh /install-chipyard.sh
RUN chmod +x install-conda.sh install-chipyard.sh

RUN . ./install-conda.sh
RUN echo "source activate base" > ~/.bashrc
ENV PATH=/root/conda/bin:$PATH
RUN conda init bash
RUN conda activate base

ENTRYPOINT ["/bin/bash"]

# FIXME: There is problem with activating and using conda in dockerfiles.

# RUN conda activate base && git clone https://github.com/ucb-bar/chipyard.git && \
# cd chipyard && \
# git checkout 1.11.0 && \
# ./build-setup.sh riscv-tools -s 1 -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9 && \
# cd ..
# RUN ./install-chipyard.sh
# RUN ["/bin/bash", "--login", "-c", "conda init"]
# RUN source /root/.bashrc && conda activate base
# RUN ["/bin/bash", "--login", "-c", "conda activate base"]
# RUN ["/bin/bash", "-c", "cd chipyard && ./build-setup.sh riscv-tools -s 6 -s 7 -s 8 -s 9"]


# Install Chipyard and run ubuntu-req.sh to install necessary dependencies
# FIXME: Using a branch, because I updated the install-conda.sh script,
# which is no longer maintained. Fix this in the future.
RUN git clone https://github.com/antmicro/chipyard.git && \
cd chipyard && \
git checkout mczyz/deps

RUN ./chipyard/.github/scripts/install-conda.sh
# RUN source ~/.bashrc
# RUN bash
RUN echo "shell is "$0
RUN ["/bin/bash", "--login", "-c", "conda activate base"]
RUN ["/bin/bash", "--login", "-c", "cd chipyard && ./build-setup.sh riscv-tools -s 6 -s 7 -s 8 -s 9"]
RUN ["/bin/bash", "--login", "-c", "cd chipyard && source ./env.sh"]

ENTRYPOINT ["chipyard/scripts/entrypoint.sh"]
# ENTRYPOINT ["chipyard/scripts/entrypoint.sh"]

9 changes: 9 additions & 0 deletions scripts/install-chipyard.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# conda activate base

git clone https://github.com/ucb-bar/chipyard.git
cd chipyard
git checkout 1.11.0
./build-setup.sh riscv-tools -s 1 -s 2 -s 3 -s 4 -s 5 -s 6 -s 7 -s 8 -s 9
cd ..
13 changes: 13 additions & 0 deletions scripts/install-conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

set -ex
set -o pipefail

curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh"
bash Miniforge3-$(uname)-$(uname -m).sh -b -p "${HOME}/conda"

export PATH=/root/conda/bin/:$PATH

conda install -n base conda-libmamba-solver
conda config --set solver libmamba
conda install -n base conda-lock==1.4.0
# conda init bash

0 comments on commit a525f04

Please sign in to comment.