-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from nbosb/dev-restructure
Restructure
- Loading branch information
Showing
48 changed files
with
1,003 additions
and
1,563 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
deps/vcml/cmake/clang-format | ||
cmake/clang-format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
deps/vcml/cmake/clang-tidy | ||
cmake/clang-tidy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: cmake | ||
|
||
on: | ||
schedule: | ||
- cron: '0 1 * * *' | ||
|
||
env: | ||
TARGET_ARCH: linux64 | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
|
||
name: Build AVP64 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Download software | ||
working-directory: ./sw | ||
run: | | ||
wget https://github.com/aut0/avp64_sw/releases/download/v2024.07.30/buildroot_6_5_6.tar.gz | ||
tar -xvf buildroot_6_5_6.tar.gz | ||
rm buildroot_6_5_6.tar.gz | ||
- name: Setup Dependencies | ||
run: | | ||
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" | ||
sudo apt-get update -y -qq | ||
sudo apt-get install build-essential libelf-dev libsdl2-dev libvncserver-dev libslirp-dev | ||
- name: Configure | ||
run: | | ||
cmake \ | ||
-B ${{github.workspace}}/build \ | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} \ | ||
-DAVP64_BUILD_TESTS=ON \ | ||
-DAVP64_BUILD_RUNNER=ON | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j $(nproc) | ||
|
||
- name: Test | ||
env: | ||
LD_LIBRARY_PATH: ${{github.workspace}}/build/ocx-qemu-arm | ||
working-directory: ${{github.workspace}}/build | ||
run: | | ||
ctest -C ${{env.BUILD_TYPE}} --output-on-failure --output-junit testreport.xml | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: always() | ||
with: | ||
report_paths: ${{github.workspace}}/build/testreport.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ jobs: | |
submodules: 'recursive' | ||
|
||
- name: Check code style | ||
run: deps/vcml/utils/format -n | ||
run: ./utils/format -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ gdbscript* | |
.vscode | ||
.cache | ||
compile_commands.json | ||
linux-src/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
[submodule "deps/ocx-qemu-arm"] | ||
path = deps/ocx-qemu-arm | ||
url = https://github.com/snps-virtualprototyping/ocx-qemu-arm | ||
[submodule "deps/vcml"] | ||
path = deps/vcml | ||
url = https://github.com/machineware-gmbh/vcml | ||
[submodule "cmake"] | ||
path = cmake | ||
url = https://github.com/machineware-gmbh/cmake.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,91 @@ | ||
############################################################################## | ||
# # | ||
# Copyright 2020 Lukas Jünger # | ||
# Copyright 2024 Lukas Jünger, Nils Bosbach # | ||
# # | ||
# This software is licensed under the MIT license. # | ||
# A copy of the license can be found in the LICENSE file at the root # | ||
# of the source tree. # | ||
# # | ||
############################################################################# | ||
|
||
cmake_minimum_required(VERSION 3.6) | ||
project(avp64) | ||
option(AVP64_BUILD_TESTS "Build unit tests" OFF) | ||
############################################################################## | ||
|
||
include(ExternalProject) | ||
cmake_minimum_required(VERSION 3.12) | ||
project(avp64 VERSION 2024.07.30 LANGUAGES C CXX) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
option(AVP64_BUILD_TESTS "Build unit tests" OFF) | ||
option(AVP64_BUILD_RUNNER "Build avp64 runner" ON) | ||
set(AVP64_LINTER "" CACHE STRING "Code linter to use") | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS -rdynamic) | ||
|
||
set(OCX_QEMU_ARM_HOME $ENV{OCX_QEMU_HOME}) | ||
if(NOT EXISTS ${OCX_QEMU_ARM_HOME}) | ||
set(OCX_QEMU_ARM_HOME ${CMAKE_CURRENT_SOURCE_DIR}/deps/ocx-qemu-arm) | ||
endif() | ||
|
||
set(VCML_HOME $ENV{VCML_HOME}) | ||
if(NOT EXISTS ${VCML_HOME}) | ||
set(VCML_HOME ${CMAKE_CURRENT_SOURCE_DIR}/deps/vcml) | ||
endif() | ||
|
||
message(STATUS "Found OCX-QEMU-ARM at " ${OCX_QEMU_ARM_HOME}) | ||
message(STATUS "Found VCML at " ${VCML_HOME}) | ||
include(cmake/common.cmake) | ||
find_github_repo(vcml "machineware-gmbh/vcml") | ||
|
||
add_subdirectory(${OCX_QEMU_ARM_HOME} ocx-qemu-arm) | ||
add_subdirectory(${VCML_HOME} vcml) | ||
set(OCX_QEMU_ARM_BUILD_TESTS OFF CACHE BOOL "disable ocx tests") | ||
find_github_repo(ocx-qemu-arm "nbosb/ocx-qemu-arm" "fix-namespace") | ||
|
||
set(src "${CMAKE_CURRENT_SOURCE_DIR}/src") | ||
set(inc "${CMAKE_CURRENT_SOURCE_DIR}/include" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/deps/ocx-qemu-arm/ocx/include") | ||
set(inc "${CMAKE_CURRENT_SOURCE_DIR}/include") | ||
set(gen ${CMAKE_CURRENT_BINARY_DIR}/gen) | ||
|
||
configure_file(${src}/avp64/version.h.in | ||
${gen}/avp64/version.h @ONLY) | ||
|
||
set(sources | ||
${src}/arm64_cpu.cpp | ||
${src}/system.cpp | ||
${src}/main.cpp) | ||
${src}/avp64/core.cpp | ||
${src}/avp64/cpu.cpp | ||
) | ||
|
||
add_executable(avp64 ${sources}) | ||
add_library(avp64 STATIC ${sources}) | ||
|
||
set_target_properties(avp64 PROPERTIES CXX_CLANG_TIDY "${AVP64_LINTER}") | ||
target_compile_options(avp64 PRIVATE ${MWR_COMPILER_WARN_FLAGS}) | ||
target_include_directories(avp64 PUBLIC ${inc}) | ||
target_include_directories(avp64 PUBLIC ${gen}) | ||
target_include_directories(avp64 PUBLIC ${OCX_QEMU_ARM_HOME}/ocx/include) | ||
target_link_libraries(avp64 PUBLIC ${CMAKE_DL_LIBS}) | ||
target_link_libraries(avp64 PUBLIC vcml) | ||
set_target_properties(avp64 PROPERTIES CXX_STANDARD 17) | ||
set_target_properties(avp64 PROPERTIES CXX_CLANG_TIDY "${AVP64_LINTER}") | ||
set_target_properties(avp64 PROPERTIES VERSION "${AVP64_VERSION}") | ||
set_target_properties(avp64 PROPERTIES SOVERSION "${AVP64_VERSION_MAJOR}") | ||
|
||
target_include_directories(avp64 PRIVATE ${inc}) | ||
if(NOT ${AVP64_LINTER} STREQUAL "") | ||
# -std=c++17 is not passed to the compiler if it is the comiler's default | ||
# this caused problems with clang-tidy | ||
set_target_properties(avp64 PROPERTIES CXX_STANDARD_REQUIRED ON) | ||
endif() | ||
|
||
target_link_libraries(avp64 ${CMAKE_DL_LIBS}) | ||
target_link_whole_archives(avp64 vcml) | ||
set_target_properties(ocx-qemu-arm PROPERTIES EXCLUDE_FROM_ALL FALSE) | ||
|
||
install(TARGETS avp64 DESTINATION bin) | ||
install(DIRECTORY config/ DESTINATION config) | ||
install(TARGETS avp64) | ||
install(TARGETS ocx-qemu-arm DESTINATION lib) | ||
install(DIRECTORY sw/ DESTINATION sw) | ||
install(DIRECTORY ${inc}/ DESTINATION include) | ||
install(DIRECTORY ${gen}/ DESTINATION include) | ||
|
||
if(AVP64_BUILD_TESTS) | ||
message(STATUS "Building AVP64 tests") | ||
enable_testing() | ||
add_subdirectory(tests) | ||
endif() | ||
|
||
if(AVP64_BUILD_RUNNER) | ||
add_executable(avp64-runner | ||
${src}/avp64/system.cpp | ||
${src}/avp64/main.cpp | ||
) | ||
|
||
target_compile_options(avp64-runner PRIVATE ${MWR_COMPILER_WARN_FLAGS}) | ||
target_include_directories(avp64-runner PRIVATE ${src}) | ||
set_target_properties(avp64-runner PROPERTIES CXX_STANDARD 17) | ||
set_target_properties(avp64-runner PROPERTIES CXX_CLANG_TIDY "${AVP64_LINTER}") | ||
set_target_properties(avp64-runner PROPERTIES VERSION "${AVP64_VERSION}") | ||
set_target_properties(avp64-runner PROPERTIES SOVERSION "${AVP64_VERSION_MAJOR}") | ||
target_link_whole_archives(avp64-runner avp64) | ||
target_link_whole_archives(avp64-runner vcml) | ||
|
||
if(NOT ${AVP64_LINTER} STREQUAL "") | ||
# -std=c++17 is not passed to the compiler if it is the comiler's default | ||
# this caused problems with clang-tidy | ||
set_target_properties(avp64-runner PROPERTIES CXX_STANDARD_REQUIRED ON) | ||
endif() | ||
|
||
install(TARGETS avp64-runner) | ||
endif() |
Oops, something went wrong.