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

Integrated bare etiss processor #106

Merged
Merged
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
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ jobs:
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv/build64
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_cpp/build64
cmake -E make_directory ${{runner.workspace}}/install/examples/bare_etiss_processor/build
cmake -E make_directory ${{runner.workspace}}/install/examples/SW/riscv_dhry/build

- name: Setup tests
Expand All @@ -112,10 +111,7 @@ jobs:
cd SW/riscv_dhry/build
cmake .. -DRISCV_ELF_GCC_PREFIX=../../../../../riscv-tc -DRISCV_ELF_GCC_BASENAME=riscv64-unknown-elf ${{matrix.config.cmakegen}}
cmake --build . --config $BUILD_TYPE
cd -
cd bare_etiss_processor/build
cmake ..
cmake --build . --config $BUILD_TYPE


- name: Compress Compiled System
run: tar -C ${{runner.workspace}} -cvf ${{runner.workspace}}/etiss.tar install
Expand Down Expand Up @@ -150,18 +146,18 @@ jobs:
run: tar -xf etiss.tar

- name: Test (Linux/Mac)
working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor
working-directory: ${{runner.workspace}}/install/bin
if: matrix.config.name == 'Linux'
shell: bash
run: |
./run_helper.sh ../SW/riscv/build/riscv_example.elf
./run_helper.sh ../SW/riscv/build/riscv_example.elf gcc
./run_helper.sh ../SW/riscv/build/riscv_example.elf llvm
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf gcc
./run_helper.sh ../SW/riscv_cpp/build/riscv_example.elf llvm
./run_helper.sh ../SW/riscv/build64/riscv_example.elf
./run_helper.sh ../SW/riscv_cpp/build64/riscv_example.elf
./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf
./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf gcc
./run_helper.sh ../examples/SW/riscv/build/riscv_example.elf llvm
./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf
./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf gcc
./run_helper.sh ../examples/SW/riscv_cpp/build/riscv_example.elf llvm
./run_helper.sh ../examples/SW/riscv/build64/riscv_example.elf
./run_helper.sh ../examples/SW/riscv_cpp/build64/riscv_example.elf

# - name: Test (Windows)
# working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor/build
Expand All @@ -182,7 +178,7 @@ jobs:
matrix:
run-no: [1, 2, 3, 4, 5]
jit-engine: ["tcc", "gcc", "llvm"]

if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event_name == 'pull_request'
needs: build
runs-on: ubuntu-latest
Expand All @@ -203,9 +199,9 @@ jobs:
run: mkdir ${{runner.workspace}}/results

- name: Run Benchmarks
working-directory: ${{runner.workspace}}/install/examples/bare_etiss_processor
working-directory: ${{runner.workspace}}/install/bin
run: |
./run_helper.sh ../SW/riscv_dhry/build/riscv_example ${{matrix.jit-engine}} --vp.stats_file_path=${{runner.workspace}}/results/run.json
./run_helper.sh ../examples/SW/riscv_dhry/build/riscv_example ${{matrix.jit-engine}} --vp.stats_file_path=${{runner.workspace}}/results/run.json
mv ${{runner.workspace}}/results/run.json ${{runner.workspace}}/results/run_${{matrix.jit-engine}}_${{matrix.run-no}}.json

- name: Save Benchmark Results
Expand Down Expand Up @@ -411,7 +407,7 @@ jobs:

delete-artifact:
if: always()
needs: [display-wiki, display-pr]
needs: [display-wiki, display-pr, test]
runs-on: ubuntu-latest
continue-on-error: true

Expand Down
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
MESSAGE(FATAL_ERROR "In-source builds are not allowed because they pollute the source tree with temporary files that might have to be deleted later. Please create a separate folder in which you run CMake.")
ENDIF()

set(ETISS_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "ETISS build location")
# Declare ETISS version
set(ETISS_VERSION_MAJOR 0)
set(ETISS_VERSION_MINOR 8)
Expand Down Expand Up @@ -85,10 +86,11 @@ ELSE()
SET(CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fsanitize=address -fsanitize=undefined")
ENDIF()


# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\$ORIGIN")


ENDIF()

# Support colored output for ninja generator.
Expand Down Expand Up @@ -291,6 +293,16 @@ FILES_MATCHING
# copy cmake files
set(INSTALL_CMAKE_DIR lib/CMake/ETISS CACHE PATH "Installation directory for CMake files")

# to allow linking with ETISS lib in build-tree
# copying headers
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/ DESTINATION ${ETISS_BINARY_DIR}/include/)
#file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include_c/ DESTINATION ${ETISS_BINARY_DIR}/include/)
file(GLOB JIT_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/jitlibs/**/*.h)
file(COPY ${JIT_HEADERS} DESTINATION ${ETISS_BINARY_DIR}/include/jit/etiss/jit/)
# plugins/list.txt file
file(WRITE ${ETISS_BINARY_DIR}/lib/plugins/list.txt)
wysiwyng marked this conversation as resolved.
Show resolved Hide resolved



############# TARGETS ##############

Expand Down
2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#


ADD_SUBDIRECTORY(bare_etiss_processor)
#ADD_SUBDIRECTORY(bare_etiss_processor)
#ADD_SUBDIRECTORY(mixed_level_fault_injection)
ADD_SUBDIRECTORY(SW)
#ADD_SUBDIRECTORY(systemc)
Expand Down
48 changes: 0 additions & 48 deletions examples/bare_etiss_processor/CMakeLists.txt.in

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,47 +33,46 @@
# Version 0.1
#

project(bare_etiss_processor_example)
project(bare_etiss_processor)

# Set relative rpath to mimic runtime link behavior of windows (libs loadable from current dir)

SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")

add_executable(bare_etiss_processor main.cpp)
target_link_libraries(bare_etiss_processor ETISS)

set(ETISS_DIR ${CMAKE_INSTALL_PREFIX} )
configure_file(
CMakeLists.txt.in
"${PROJECT_BINARY_DIR}/tobeinstalled/CMakeLists.txt"
run_helper.sh.in
"${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh"
@ONLY
)

set(ETISS_DIR ${CMAKE_BINARY_DIR})
configure_file(
run.sh.in
"${PROJECT_BINARY_DIR}/tobeinstalled/run.sh"
run_helper.sh.in
"${CMAKE_BINARY_DIR}/bin/run_helper.sh"
@ONLY
)
configure_file(
run_helper.sh.in
"${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh"
@ONLY
base.ini
"${CMAKE_BINARY_DIR}/examples/base.ini"
COPYONLY
)
set_target_properties( bare_etiss_processor
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)

install(FILES
"${PROJECT_BINARY_DIR}/tobeinstalled/CMakeLists.txt"
"${PROJECT_BINARY_DIR}/tobeinstalled/run.sh"
"${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh"
"get_metrics.py"
DESTINATION examples/bare_etiss_processor
install(TARGETS bare_etiss_processor DESTINATION bin)
install(FILES "${PROJECT_BINARY_DIR}/tobeinstalled/run_helper.sh"
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)

install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/
DESTINATION examples/bare_etiss_processor
DESTINATION examples
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.cpp"
PATTERN "*.c"
PATTERN "*.S"
PATTERN "*.s"
PATTERN "*.ini"
PATTERN "README*"
PATTERN "code_or1k.bin"
PATTERN "code_ARMv6M.elf"
PATTERN ".svn" EXCLUDE
PATTERN "*.in" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE
)
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
set -e
# Config
ETISS_DIR=@CMAKE_INSTALL_PREFIX@/

ETISS_DIR=@ETISS_DIR@

# Clear tmp file
DYN_INI=$(mktemp /tmp/etiss_dynamic_XXXXXXXXXX.ini)
Expand Down Expand Up @@ -30,7 +30,8 @@ TARGETSW_PATH_ELF=$1
TARGET_ELFFILE=$(basename -- "$TARGETSW_PATH_ELF")
TARGET_ELFDIR=$(dirname -- "$TARGETSW_PATH_ELF")

VP_EXE="${ETISS_DIR}/examples/bare_etiss_processor/build/main"
VP_EXE="${ETISS_DIR}/bin/bare_etiss_processor"


CMD_OPTIONS=""

Expand Down Expand Up @@ -99,7 +100,8 @@ echo -e "simple_mem_system.memseg_origin_01=0x00080000" >> $DYN_INI
echo -e "simple_mem_system.memseg_length_01=0x00080000" >> $DYN_INI

# Call
ARGS="-i${ETISS_DIR}/examples/bare_etiss_processor/base.ini -i${DYN_INI} ${CMD_OPTIONS}"
ARGS="-i${ETISS_DIR}/examples/base.ini -i${DYN_INI} ${CMD_OPTIONS}"

if [ "${USE_TGDB}" -eq 1 ]; then
if [ "${DO_NOT_ATTACH}" -eq 0 ]; then
konsole --workdir $(pwd) -e "bash -c '/usr/local/research/projects/SystemDesign/tools/riscv/current/bin/riscv64-unknown-elf-gdb -ex \"tar rem :2222\" $TARGETSW_PATH_ELF'" &
Expand Down
8 changes: 5 additions & 3 deletions src/jitlibs/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED
resources.cpp
)

TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ETISS)

add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${PROJECT_NAME}>" ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${PROJECT_NAME}>" ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/
)


TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ETISS)

INSTALL(FILES
libresources.h
DESTINATION include/jit/etiss/jit
Expand Down
4 changes: 2 additions & 2 deletions src/jitlibs/softfloat/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${BPROJECT_NAME})

add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${PROJECT_NAME}>" ${CMAKE_BINARY_DIR}/etiss/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${PROJECT_NAME}>" ${CMAKE_BINARY_DIR}/include/jit/etiss/jit/
)

ENDIF()
Expand Down