diff --git a/.github/actions/build/entrypoint.sh b/.github/actions/build/entrypoint.sh index e87364a4..4416a9c7 100755 --- a/.github/actions/build/entrypoint.sh +++ b/.github/actions/build/entrypoint.sh @@ -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++} @@ -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!!!" @@ -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 diff --git a/.github/workflows/conda/environment.yml b/.github/workflows/conda/environment.yml deleted file mode 100644 index c4d77360..00000000 --- a/.github/workflows/conda/environment.yml +++ /dev/null @@ -1,83 +0,0 @@ -name: riscv_perf_model -channels: - - conda-forge -dependencies: - - _libgcc_mutex>=0.1=conda_forge - - _openmp_mutex>=4.5=2_gnu - - binutils_impl_linux-64>=2.39=he00db2b_1 - - binutils_linux-64>=2.39=h5fc0e48_11 - - bison>=3.8 - - boost>=1.76.0=py310h7c3ba0c_1 - - boost-cpp>=1.76.0=h312852a_1 - - bzip2>=1.0.8=h7f98852_4 - - c-ares>=1.18.1=h7f98852_0 - - ca-certificates>=2023.11.17=hbcca054_0 - - clang>=14.0.6=ha770c72_1 - - clang-14>=14.0.6=default_h7634d5b_1 - - clangxx>=14.0.6=default_h1e1816b_1 - - cmake>=3.25.2=h077f3f9_0 - - cppcheck>=2.7.5=py310h94ea96f_1 - - curl>=7.87.0=h6312ad2_0 - - doxygen>=1.8.20=had0d8f1_0 - - expat>=2.5.0=h27087fc_0 - - flex>=2.6 - - gcc>=10.4.0=hb92f740_13 - - gcc_impl_linux-64>=10.4.0=h5231bdf_19 - - gcc_linux-64>=10.4.0=h9215b83_11 - - gxx_impl_linux-64>=10.4.0=h5231bdf_19 - - gxx_linux-64>=10.4.0=h6e491c6_11 - - hdf5>=1.10.6=nompi_h6a2412b_1114 - - icu>=68.2=h9c3ff4c_0 - - kernel-headers_linux-64>=2.6.32=he073ed8_15 - - keyutils>=1.6.1=h166bdaf_0 - - krb5>=1.20.1=hf9c8cef_0 - - ld_impl_linux-64>=2.39=hcc3a1bd_1 - - libblas>=3.9.0=16_linux64_openblas - - libcblas>=3.9.0=16_linux64_openblas - - libclang-cpp14>=14.0.6=default_h7634d5b_1 - - libcurl>=7.87.0=h6312ad2_0 - - libedit>=3.1.20191231=he28a2e2_2 - - libev>=4.33=h516909a_1 - - libffi>=3.4.2=h7f98852_5 - - libgcc-devel_linux-64>=10.4.0=hd38fd1e_19 - - libgcc-ng>=12.2.0=h65d4601_19 - - libgfortran-ng>=12.2.0=h69a702a_19 - - libgfortran5>=12.2.0=h337968e_19 - - libgomp>=12.2.0=h65d4601_19 - - libiconv>=1.17=h166bdaf_0 - - liblapack>=3.9.0=16_linux64_openblas - - libllvm14>=14.0.6=hcd5def8_4 - - libnghttp2>=1.51.0=hdcd2b5c_0 - - libnsl>=2.0.0=h7f98852_0 - - libopenblas>=0.3.21=pthreads_h78a6416_3 - - libsanitizer>=10.4.0=h5246dfb_19 - - libsqlite>=3.40.0=h753d276_0 - - libssh2>=1.10.0=haa6b8db_3 - - libstdcxx-devel_linux-64>=10.4.0=hd38fd1e_19 - - libstdcxx-ng>=12.2.0=h46fd767_19 - - libuuid>=2.32.1=h7f98852_1000 - - libuv>=1.44.2=h166bdaf_0 - - libzlib>=1.2.13=h166bdaf_4 - - lld>=14.0.6=h07fd6de_1 - - llvm-tools>=14.0.6=hcd5def8_4 - - ncurses>=6.3=h27087fc_1 - - numpy>=1.24.1=py310h08bbf29_0 - - openssl>=1.1.1w=hd590300_0 - - pcre>=8.45=h9c3ff4c_0 - - pip>=23.3.1=pyhd8ed1ab_0 - - pygments>=2.11.2=pyhd8ed1ab_0 - - python>=3.10.8=h257c98d_0_cpython - - python_abi>=3.10=3_cp310 - - rapidjson>=1.1.0=he1b5a44_1002 - - readline>=8.1.2=h0f457ee_0 - - rhash>=1.4.3=h166bdaf_0 - - setuptools>=68.2.2=pyhd8ed1ab_0 - - sqlite>=3.36.0=h9cd32fc_2 - - sysroot_linux-64>=2.12=he073ed8_15 - - tk>=8.6.12=h27826a3_0 - - tzdata>=2022g=h191b570_0 - - wheel>=0.42.0=pyhd8ed1ab_0 - - xz>=5.2.6=h166bdaf_0 - - yaml-cpp>=0.7.0=h27087fc_2 - - zlib>=1.2.13=h166bdaf_4 - - zstd>=1.5.2=h6239696_4 diff --git a/.github/workflows/conda/macos_env.yml b/.github/workflows/conda/macos_env.yml deleted file mode 100644 index 63464615..00000000 --- a/.github/workflows/conda/macos_env.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: riscv_perf_model -channels: - - conda-forge -dependencies: - - zstd>=1.5.6 - - cmake>=3.25.2 - - boost>=1.76.0 - - boost-cpp>=1.76.0 - - yaml-cpp>=0.7.0 - - rapidjson>=1.1.0 - - libsqlite>=3.40.0 - - sqlite>=3.36.0 - - hdf5>=1.10.6 - - bison>=3.8.0 diff --git a/.github/workflows/ubuntu-build.yml b/.github/workflows/ubuntu-build.yml index af51b2f4..1303f0e0 100644 --- a/.github/workflows/ubuntu-build.yml +++ b/.github/workflows/ubuntu-build.yml @@ -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/ccache-action@v1.2 @@ -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 diff --git a/README.md b/README.md index bd9689c0..a6330353 100644 --- a/README.md +++ b/README.md @@ -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 git@github.com: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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/conda/README.md b/conda/README.md deleted file mode 100644 index 85b78f39..00000000 --- a/conda/README.md +++ /dev/null @@ -1,38 +0,0 @@ -# Conda enviornments - -The conda environment created using yml file specification in this -directory can be used to build and run olympia, the [Sparta Modeling -Framework](https://github.com/sparcians/map/tree/master/sparta), [STF -Library](https://github.com/sparcians/stf_lib) and [STF -Tools](https://github.com/sparcians/stf_tools). - -## Download and install miniconda - -If `conda` is not already set up or the preference is to have a local -`conda` environment, consider installing [miniconda](https://docs.conda.io/en/latest/miniconda.html) first. - -## Create a New Environment or Update Existing Conda Environment - -**If these steps do no work, follow the directions on - [Map/Sparta](https://github.com/sparcians/map/tree/master#building-map) - instead** - -A new environment can be created using `environment.yaml` file as follows: - -``` -conda env create -f .github/workflows/conda/environment.yml -``` - -This will create a conda environment named `riscv_perf_model` in the default conda path. - -If an environment named `riscv_perf_model` exists, it can be updated as follows: - -``` -conda env update --file environment.yml --prune -``` - -The file `environment_for_macos.yml` provides an alternative specification if encountering problems -while building the conda environement for macOS. - -The file `environment_from_history.yml` provides a minimal specification, in case, there is a need -to build the conda environment from scratch.