Skip to content
Open
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
10 changes: 3 additions & 7 deletions .github/actions/build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

set -x

source $CONDA/etc/profile.d/conda.sh
conda activate riscv_perf_model

echo "Starting Build Entry"
echo "HOME:" $HOME
echo "GITHUB_WORKSPACE:" $GITHUB_WORKSPACE
echo "GITHUB_EVENT_PATH:" $GITHUB_EVENT_PATH
echo "CONDA_PREFIX:" $CONDA_PREFIX
echo "PWD:" `pwd`

CXX_COMPILER=${COMPILER/clang/clang++}
Expand All @@ -28,12 +24,12 @@ echo "Building Sparta Infra"
cd ${GITHUB_WORKSPACE}/map/sparta
mkdir -p release
cd release
CC=$COMPILER CXX=$CXX_COMPILER cmake .. -DCMAKE_BUILD_TYPE=Release -DGEN_DEBUG_INFO=OFF -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}
CC=$COMPILER CXX=$CXX_COMPILER cmake .. -DCMAKE_BUILD_TYPE=Release -DGEN_DEBUG_INFO=OFF
if [ $? -ne 0 ]; then
echo "ERROR: Cmake for Sparta framework failed"
exit 1
fi
make -j$NUM_CORES install
sudo make -j$NUM_CORES install
BUILD_SPARTA=$?
if [ ${BUILD_SPARTA} -ne 0 ]; then
echo "ERROR: build sparta FAILED!!!"
Expand All @@ -43,7 +39,7 @@ fi
cd ${GITHUB_WORKSPACE}
mkdir $OLYMPIA_BUILD_TYPE
cd $OLYMPIA_BUILD_TYPE
CC=$COMPILER CXX=$CXX_COMPILER cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF
CC=$COMPILER CXX=$CXX_COMPILER cmake -DSPARTA_SEARCH_DIR=/usr/local .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF
if [ $? -ne 0 ]; then
echo "ERROR: Cmake for olympia failed"
exit 1
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/conda/environment.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .github/workflows/conda/macos_env.yml

This file was deleted.

18 changes: 5 additions & 13 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,12 @@ jobs:
path: map
ref: map_v2.0.21

# Setup Conda and build environment
# Setup build environment
- name: Grab Python v3.8
uses: actions/setup-python@v3
with:
python-version: 3.8

# Cache the conda dependencies to
- name: Cache conda deps
uses: actions/cache@v3
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-conda-${{ hashFiles('.github/workflows/conda/environment.yml') }}
path: /usr/share/miniconda/envs/riscv_perf_model # Default path for conda

# Setup CCache to cache builds
- name: ccache
uses: hendrikmuhs/[email protected]
Expand All @@ -62,12 +55,11 @@ jobs:
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache-master
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache

- name: Setup Conda Environment
# Install missing packages to make everything build
- name: Install packages needed for sparta/olympia
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda config --set channel_priority strict
$CONDA/bin/conda env update --file ${{ github.workspace }}/.github/workflows/conda/environment.yml
$CONDA/bin/conda init bash
sudo apt-get update --fix-missing
sudo apt-get install libboost-all-dev libyaml-cpp-dev rapidjson-dev libhdf5-dev llvm lld

# Build
- name: Build & Regress
Expand Down
44 changes: 27 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,40 @@ under development.

## Building

1. Set up a clean working `conda` environment by following the directions [here](https://github.com/riscv-software-src/riscv-perf-model/tree/master/conda)
1. Download and build Sparta and checkout branch [map_v2](https://github.com/sparcians/map/tree/map_v2). Follow the directions on the [Sparta README](https://github.com/sparcians/map/tree/map_v2#building-map) to build _and install_ Sparta
1. Make sure you have the [required libraries](https://github.com/sparcians/stf_lib#required-packages) for the STF toolsuite installed
1. Clone olympia
1. Clone olympia, making sure this is done recursively.
```
git clone --recursive [email protected]:riscv-software-src/riscv-perf-model.git
```
1. Build Olympia in the new `conda` environment created
1. Before building, make sure the following packages are installed:

* Sparta v2: https://github.com/sparcians/map?tab=readme-ov-file#simple
* (cmake) cmake v3.22
* (libboost-all-dev) boost 1.78.0
* (yaml-cpp-dev) YAML CPP 0.7.0
* (rapidjson-dev) RapidJSON CPP 1.1.0
* (libsqlite3-dev) SQLite3 3.37.2
* (libhdf5-dev) HDF5 1.10.7
* (clang++) Clang, Version: 14.0.0 OR (g++) v13.0.0 or greater

1. Build Olympia in one of three modes (see below):
* `release`: Highly optimized, no debug w/ LTO (if supported)
* `fastdebug`: Optimized, no LTO, with debug information
* `debug`: All optimizations are disabled

If sparta was NOT installed in the standand locations, the user can
specify the path to sparta by setting
`-DSPARTA_SEARCH_DIR=/path/to/sparta/install/` to `cmake`

```

################################################################################
# Enable conda environment (suggested)
conda activate sparta

################################################################################
# Optimized, no symbols

# A release build
mkdir release; cd release

# Assumes sparta was installed in the conda environment.
# Assumes sparta was installed on the local machine
# If not, use -DSPARTA_SEARCH_DIR=/path/to/sparta/install
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake .. -DCMAKE_BUILD_TYPE=release

# Just builds the simulator
make olympia
Expand All @@ -55,7 +65,7 @@ make olympia
# A FastDebug build
mkdir fastdebug; cd fastdebug

# Assumes sparta was installed in the conda environment.
# Assumes sparta was installed on the local machine
# If not, use -DSPARTA_SEARCH_DIR=/path/to/sparta/install
cmake .. -DCMAKE_BUILD_TYPE=fastdebug

Expand All @@ -68,7 +78,7 @@ make olympia
# A debug build
mkdir debug; cd debug

# Assumes sparta was installed in the conda environment.
# Assumes sparta was installed on the local machine
# If not, use -DSPARTA_SEARCH_DIR=/path/to/sparta/install
cmake .. -DCMAKE_BUILD_TYPE=Debug

Expand Down Expand Up @@ -284,11 +294,11 @@ top.cpu.core0.extension.core_extensions:
# ["0", "3"] means iq0 has exe0, exe1, exe2, and exe3, so it's inclusive
# if you want just one execution unit to issue queue you can do:
# ["0"] which would result in iq0 -> exe0
# *note if you change the number of issue queues,
# *note if you change the number of issue queues,
# you need to add it to latency matrix below

issue_queue_to_pipe_map:
[
[
["0", "1"], # iq0 -> exe0, exe1
["2", "3"], # iq1 -> exe2, exe3
["4", "5"], # iq2 -> exe4, exe5
Expand All @@ -302,7 +312,7 @@ The `pipelines` section defines for each execution unit, what are it's pipe targ
The `issue_queue_to_pipe_map` defines which execution units map to which issue queues, with the position being the issue queue number. So in the above `["0", "1"]` in the first row is the first issue queue that connects to `exe0` and `exe1`, so do note it's inclusive of the end value. If one wanted to have a one execution unit to issue queue mapping, the above would turn into:
```
issue_queue_to_pipe_map:
[
[
["0"], # iq0 -> exe0
["1"], # iq1 -> exe1
["2"], # iq2 -> exe2
Expand Down
38 changes: 0 additions & 38 deletions conda/README.md

This file was deleted.