Skip to content

Commit

Permalink
Resolve conflicts between branch 'master' and 'danbone/issue_143_icac…
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon540 committed Sep 26, 2024
1 parent b020c81 commit 9b46b07
Show file tree
Hide file tree
Showing 160 changed files with 10,040 additions and 6,972 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -x

source "/usr/share/miniconda/etc/profile.d/conda.sh"
source $CONDA/etc/profile.d/conda.sh
conda activate riscv_perf_model

echo "Starting Build Entry"
Expand All @@ -23,7 +23,7 @@ echo "Building Sparta Infra"
cd ${GITHUB_WORKSPACE}/map/sparta
mkdir -p release
cd release
CC=$COMPILER CXX=$CXX_COMPILER cmake .. -DCMAKE_BUILD_TYPE=$OLYMPIA_BUILD_TYPE -DGEN_DEBUG_INFO=OFF -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}
CC=$COMPILER CXX=$CXX_COMPILER cmake .. -DCMAKE_BUILD_TYPE=Release -DGEN_DEBUG_INFO=OFF -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}
if [ $? -ne 0 ]; then
echo "ERROR: Cmake for Sparta framework failed"
exit 1
Expand Down
183 changes: 183 additions & 0 deletions .github/workflows/conda/macos_env.yml

Large diffs are not rendered by default.

89 changes: 89 additions & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
on:
pull_request:
branches:
- master

env:
CACHE_VERSION: v1

name: Regress Olympia on MacOS
jobs:
build_test_job:
strategy:
# Strategy is a matrix of debug and release builds/regression
matrix:
os: [macos-12]
BUILD_TYPE: [Debug]
COMPILER: [clang]

name: MacOS-${{ matrix.BUILD_TYPE }}-${{matrix.COMPILER}}
runs-on: ${{ matrix.os }}

# Set up a global environment variable for build scripts
env:
OLYMPIA_BUILD_TYPE: ${{ matrix.BUILD_TYPE }}
COMPILER: ${{ matrix.COMPILER }}

steps:

# Get Olympia
- name: Checkout Olympia
uses: actions/checkout@v3
with:
submodules: recursive

# Get Sparta
- name: Checkout Sparta
uses: actions/checkout@v3
with:
repository: sparcians/map
path: map
ref: map_v2.0.13

# Setup Conda and 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/macos_env.yml') }}
path: /usr/share/miniconda/envs/riscv_perf_model # Default path for conda

# Setup CCache to cache builds
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache-${{ github.ref_name }}
restore-keys: |
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache-master
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-${{ matrix.COMPILER }}-ccache
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
channels: conda-forge,defaults
channel-priority: true
activate-environment: riscv_perf_model
environment-file: .github/workflows/conda/macos_env.yml

# Build
- name: Build & Regress
run: ./.github/actions/build/entrypoint.sh

# Save error logs, etc
- name: Save artifacts
if: failure()
uses: actions/upload-artifact@main
with:
name: ErrorLogs-${{matrix.BUILD_TYPE}}-${{matrix.COMPILER}}
path: ${{matrix.BUILD_TYPE}}/test/

#- name: CTest
# # Run CTests without Valgrind tests otherwise the runtime will be TOO long
# if: ${{ env.DABBLE_BUILD_TYPE == 'release' }} && ${{ env.VALGRIND == 'false' }}
# uses: ./.github/actions/ctest # Uses an action.yml in directory
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "stf_lib"]
path = stf_lib
url = https://github.com/sparcians/stf_lib.git
[submodule "fsl"]
path = fsl
url = https://github.com/Condor-Performance-Modeling/fsl
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/editor.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions .idea/riscv-perf-model.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ include_directories(${SPARTA_INCLUDE_DIRS})
# Set up STF library
set (STF_LIB_BASE ${PROJECT_SOURCE_DIR}/stf_lib)
set (DISABLE_STF_DOXYGEN ON)
set (DISABLE_STF_TESTS ON)

if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease")
set (FULL_LTO true)
include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
setup_stf_linker(false)
endif()
include(${STF_LIB_BASE}/cmake/stf_linker_setup.cmake)
setup_stf_linker(false)


# Use ccache if installed
find_program (CCACHE_PROGRAM ccache)
Expand All @@ -60,14 +62,20 @@ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")

# Include directories
include_directories (core mss sim)
include_directories (SYSTEM fsl)
include_directories (SYSTEM mavis)
include_directories (SYSTEM stf_lib)

# Mavis, the Core, MSS, and the simulator
# Mavis, the Core, MSS, the simulator and Fusion

add_subdirectory (mavis)
add_subdirectory (core)
add_subdirectory (mss)

# Tell FSL to use the top mavis submodule, instead of fsl's submodule
set(FSL_MAVIS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mavis")
add_subdirectory (fsl)

# Add STF library to the build
add_subdirectory (${STF_LIB_BASE})

Expand Down
48 changes: 31 additions & 17 deletions arches/big_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ top.cpu.core0:
rename.params.num_to_rename: 8
rename.params.num_integer_renames: 64
rename.params.num_float_renames: 64
rename.params.num_vector_renames: 64
dispatch.params.num_to_dispatch: 8
rob.params.num_to_retire: 8
dcache.params:
Expand All @@ -23,7 +24,7 @@ top.cpu.core0.extension.core_extensions:
# targets of: "int" and "div"
pipelines:
[
["int"], # exe0
["sys"], # exe0
["int", "div"], # exe1
["int", "mul"], # exe2
["int", "mul", "i2f", "cmov"], # exe3
Expand All @@ -32,7 +33,8 @@ top.cpu.core0.extension.core_extensions:
["float", "faddsub", "fmac"], # exe6
["float", "f2i"], # exe7
["br"], # exe8
["br"] # exe9
["br"], # exe9
["vint", "vset", "vdiv", "vmul"]
]
# this is used to set how many units per queue
# ["0", "3"] means iq0 has exe0, exe1, exe2, and exe3, so it's inclusive
Expand All @@ -47,25 +49,37 @@ top.cpu.core0.extension.core_extensions:
["2", "3"], # iq1 -> exe2, exe3
["4", "5"], # iq2 -> exe4, exe5
["6", "7"], # iq3 -> exe6, exe7
["8", "9"] # iq4 -> exe8, exe9
["8", "9"], # iq4 -> exe8, exe9
["10"] # iq5 -> exe10
]
top.cpu.core0.rename.scoreboards:
# From
# |
# V
integer.params.latency_matrix: |
[["", "lsu", "iq0", "iq1", "iq2", "iq3", "iq4"],
["lsu", 1, 1, 1, 1, 1, 1],
["iq0", 1, 1, 1, 1, 1, 1],
["iq1", 1, 1, 1, 1, 1, 1],
["iq2", 1, 1, 1, 1, 1, 1],
["iq3", 1, 1, 1, 1, 1, 1],
["iq4", 1, 1, 1, 1, 1, 1]]
[["", "lsu", "iq0", "iq1", "iq2", "iq3", "iq4", "iq5"],
["lsu", 1, 1, 1, 1, 1, 1, 1],
["iq0", 1, 1, 1, 1, 1, 1, 1],
["iq1", 1, 1, 1, 1, 1, 1, 1],
["iq2", 1, 1, 1, 1, 1, 1, 1],
["iq3", 1, 1, 1, 1, 1, 1, 1],
["iq4", 1, 1, 1, 1, 1, 1, 1],
["iq5", 1, 1, 1, 1, 1, 1, 1]]
float.params.latency_matrix: |
[["", "lsu", "iq0", "iq1", "iq2", "iq3", "iq4"],
["lsu", 1, 1, 1, 1, 1, 1],
["iq0", 1, 1, 1, 1, 1, 1],
["iq1", 1, 1, 1, 1, 1, 1],
["iq2", 1, 1, 1, 1, 1, 1],
["iq3", 1, 1, 1, 1, 1, 1],
["iq4", 1, 1, 1, 1, 1, 1]]
[["", "lsu", "iq0", "iq1", "iq2", "iq3", "iq4", "iq5"],
["lsu", 1, 1, 1, 1, 1, 1, 1],
["iq0", 1, 1, 1, 1, 1, 1, 1],
["iq1", 1, 1, 1, 1, 1, 1, 1],
["iq2", 1, 1, 1, 1, 1, 1, 1],
["iq3", 1, 1, 1, 1, 1, 1, 1],
["iq4", 1, 1, 1, 1, 1, 1, 1],
["iq5", 1, 1, 1, 1, 1, 1, 1]]
vector.params.latency_matrix: |
[["", "lsu", "iq0", "iq1", "iq2", "iq3", "iq4", "iq5"],
["lsu", 1, 1, 1, 1, 1, 1, 1],
["iq0", 1, 1, 1, 1, 1, 1, 1],
["iq1", 1, 1, 1, 1, 1, 1, 1],
["iq2", 1, 1, 1, 1, 1, 1, 1],
["iq3", 1, 1, 1, 1, 1, 1, 1],
["iq4", 1, 1, 1, 1, 1, 1, 1],
["iq5", 1, 1, 1, 1, 1, 1, 1]]
13 changes: 13 additions & 0 deletions arches/fusion.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
include: big_core.yaml
top.cpu.core0:
decode:
params:
num_to_decode: 8
fusion_enable: false
fusion_debug: false
fusion_enable_register: 0xFFFFFFFF
fusion_max_latency: 8
fusion_match_max_tries: 1023
fusion_max_group_size: 8
fusion_summary_report: fusion_summary.txt
fusion_group_definitions: [ arches/fusion/dhrystone.json ]
37 changes: 37 additions & 0 deletions arches/fusion/dhrystone.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"fusiongroups" : [
{ "name" : "uf039", "uids" : ["0xd","0xa"], "tx" : "dfltXform_" },
{ "name" : "uf038", "uids" : ["0x3","0xe"], "tx" : "dfltXform_" },
{ "name" : "uf037", "uids" : ["0x20","0x4"], "tx" : "dfltXform_" },
{ "name" : "uf036", "uids" : ["0x9","0x2d"], "tx" : "dfltXform_" },
{ "name" : "uf035", "uids" : ["0x18","0xe"], "tx" : "dfltXform_" },
{ "name" : "uf034", "uids" : ["0x20","0x18"], "tx" : "dfltXform_" },
{ "name" : "uf033", "uids" : ["0xe","0xd","0xa"], "tx" : "dfltXform_" },
{ "name" : "uf032", "uids" : ["0x10","0x10"], "tx" : "dfltXform_" },
{ "name" : "uf031", "uids" : ["0x18","0x20"], "tx" : "dfltXform_" },
{ "name" : "uf030", "uids" : ["0x22","0x26"], "tx" : "dfltXform_" },
{ "name" : "uf029", "uids" : ["0x26","0x34"], "tx" : "dfltXform_" },
{ "name" : "uf028", "uids" : ["0x21","0x20"], "tx" : "dfltXform_" },
{ "name" : "uf027", "uids" : ["0x34","0x35"], "tx" : "dfltXform_" },
{ "name" : "uf026", "uids" : ["0x2d","0x22"], "tx" : "dfltXform_" },
{ "name" : "uf025", "uids" : ["0x2e","0x2d"], "tx" : "dfltXform_" },
{ "name" : "uf024", "uids" : ["0x2e","0x21"], "tx" : "dfltXform_" },
{ "name" : "uf023", "uids" : ["0xd","0xa","0x22"], "tx" : "dfltXform_" },
{ "name" : "uf022", "uids" : ["0x26","0x34","0x9"], "tx" : "dfltXform_" },
{ "name" : "uf021", "uids" : ["0xa","0x22","0x26"], "tx" : "dfltXform_" },
{ "name" : "uf020", "uids" : ["0x18","0x20","0x4"], "tx" : "dfltXform_" },
{ "name" : "uf019", "uids" : ["0x22","0x26","0x34"], "tx" : "dfltXform_" },
{ "name" : "uf018", "uids" : ["0x2e","0x21","0x20"], "tx" : "dfltXform_" },
{ "name" : "uf017", "uids" : ["0x21","0x20","0x18"], "tx" : "dfltXform_" },
{ "name" : "uf016", "uids" : ["0x20","0x18","0x20"], "tx" : "dfltXform_" },
{ "name" : "uf008", "uids" : ["0xd","0x35"], "tx" : "dfltXform_" },
{ "name" : "uf007", "uids" : ["0xa","0x22"], "tx" : "dfltXform_" },
{ "name" : "uf005", "uids" : ["0xe","0xd"], "tx" : "dfltXform_" },
{ "name" : "uf004", "uids" : ["0xe","0x34"], "tx" : "dfltXform_" },
{ "name" : "uf003", "uids" : ["0x34","0x9"], "tx" : "dfltXform_" },
{ "name" : "uf002", "uids" : ["0x2e","0x35"], "tx" : "dfltXform_" },
{ "name" : "uf001", "uids" : ["0x35","0x35"], "tx" : "dfltXform_" },
{ "name" : "uf213", "uids" : ["0x2e","0x2e"], "tx" : "dfltXform_" },
{ "name" : "uf000", "uids" : ["0x35","0x2e"], "tx" : "dfltXform_" }
]
}
Loading

0 comments on commit 9b46b07

Please sign in to comment.