-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
xilinx_user
committed
Jan 27, 2019
1 parent
adb0eeb
commit 5c1953b
Showing
255 changed files
with
67,244 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,193 @@ | ||
# | ||
# Copyright 2011-16 ARM Limited and Contributors. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of ARM Limited nor the | ||
# names of its contributors may be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY | ||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
cmake_minimum_required(VERSION 2.6) | ||
|
||
project(NE10 C CXX ASM) | ||
|
||
option(NE10_BUILD_SHARED "Build NE10 shared libraries" OFF) | ||
option(NE10_BUILD_STATIC "Build NE10 static libraries" ON) | ||
option(NE10_BUILD_EXAMPLES "Build NE10 examples" ON) | ||
|
||
#hard float abi | ||
option(NE10_ARM_HARD_FLOAT "Build NE10 for hard float abi" ON) | ||
|
||
#unit test options | ||
option(NE10_BUILD_UNIT_TEST "Build NE10 unit test" OFF) | ||
if (NE10_BUILD_UNIT_TEST) | ||
#decide the test is smoke, regression or performance test, only one of | ||
#three options can be ON! And if you want to run performance test, you | ||
#should build the releave version, see the BUILD_DEBUG below. | ||
option(NE10_SMOKE_TEST "Run smoke test" OFF) | ||
option(NE10_REGRESSION_TEST "Run regression test" OFF) | ||
option(NE10_PERFORMANCE_TEST "Run performance test" OFF) | ||
|
||
option(NE10_DEBUG_TRACE "Print debug trace" OFF) | ||
endif() | ||
|
||
#check if proper platform is set. | ||
if((NOT ANDROID_PLATFORM) AND (NOT GNULINUX_PLATFORM) AND (NOT IOS_PLATFORM)) | ||
message(FATAL_ERROR "No platform is defined! see doc/building.md for build instructions.") | ||
endif() | ||
|
||
if(DEFINED NE10_ANDROID_TARGET_ARCH) | ||
if(${NE10_ANDROID_TARGET_ARCH} STREQUAL "armv7") | ||
set(NE10_TARGET_ARCH "armv7") | ||
else() | ||
set(NE10_TARGET_ARCH "aarch64") | ||
endif() | ||
endif() | ||
|
||
if(NOT DEFINED NE10_LINUX_TARGET_ARCH AND DEFINED ENV{NE10_LINUX_TARGET_ARCH}) | ||
set(NE10_LINUX_TARGET_ARCH $ENV{NE10_LINUX_TARGET_ARCH}) | ||
endif() | ||
if(DEFINED NE10_LINUX_TARGET_ARCH) | ||
if(${NE10_LINUX_TARGET_ARCH} STREQUAL "armv7") | ||
set(NE10_TARGET_ARCH "armv7") | ||
else() | ||
set(NE10_TARGET_ARCH "aarch64") | ||
endif() | ||
endif() | ||
|
||
if(DEFINED NE10_IOS_TARGET_ARCH) | ||
if(${NE10_IOS_TARGET_ARCH} STREQUAL "armv7") | ||
set(NE10_TARGET_ARCH "armv7") | ||
else() | ||
set(NE10_TARGET_ARCH "aarch64") | ||
endif() | ||
endif() | ||
|
||
message("-- Target architecture: ${NE10_TARGET_ARCH}") | ||
|
||
#select functionalities to be compiled | ||
if("${NE10_TARGET_ARCH}" STREQUAL "armv7") | ||
# Math module has not been optimized for aarch64. | ||
option(NE10_ENABLE_MATH "Build math functionalities to NE10" ON) | ||
# Physics module has not been optimized for aarch64. | ||
option(NE10_ENABLE_PHYSICS "Build physics functionalities to NE10" ON) | ||
endif() | ||
option(NE10_ENABLE_DSP "Build dsp functionalities to NE10" ON) | ||
option(NE10_ENABLE_IMGPROC "Build image processing functionalities to NE10" ON) | ||
|
||
set(NE10_VERSION 10) | ||
|
||
if(BUILD_DEBUG) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -O0 -DDEBUG -g -Wall -Wno-unused-but-set-variable -mfloat-abi=softfp -mfpu=neon") | ||
message("-- Building type: DEBUG") | ||
else(BUILD_DEBUG) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing -O2 -DNDEBUG") | ||
message("-- Building type: RELEASE") | ||
endif(BUILD_DEBUG) | ||
|
||
# By default, we compile c intrinsic. | ||
set(NE10_ASM_OPTIMIZATION off) | ||
|
||
if(ANDROID_PLATFORM) | ||
if(NE10_ARM_HARD_FLOAT) | ||
set(FLOAT_ABI "hard") | ||
else() | ||
set(FLOAT_ABI "softfp") | ||
endif() | ||
|
||
#TODO: Fine tune pic and pie flag for executable, share library and static library. | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${NDK_SYSROOT_PATH} -pie") | ||
|
||
# Adding cflags for armv7. Aarch64 does not need such flags. | ||
if(${NE10_TARGET_ARCH} STREQUAL "armv7") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=neon") | ||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=${FLOAT_ABI} -mfpu=vfp3 ") | ||
if(NE10_ARM_HARD_FLOAT) | ||
# "--no-warn-mismatch" is needed for linker to suppress linker error about not all functions use VFP register to pass argument, eg. | ||
# .../arm-linux-androideabi/bin/ld: error: ..../test-float.o | ||
# uses VFP register arguments, output does not | ||
# There is call convension mismatch between NDK's crt*.o and ne10's object files. | ||
# crt*.o still uses softfp while ne10's object files use hard floating point. | ||
# Refer $NDK/tests/device/hard-float/jni/Android.mk for more details. | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--no-warn-mismatch") | ||
endif() | ||
# Turn on asm optimization for Android on ARM v7. | ||
set(NE10_ASM_OPTIMIZATION on) | ||
endif() | ||
message("-- Loaded toolchain: | ||
${CMAKE_C_COMPILER} | ||
${CMAKE_CXX_COMPILER} | ||
${CMAKE_ASM_COMPILER}") | ||
message("-- CMAKE_C_FLAGS: | ||
${CMAKE_C_FLAGS}") | ||
elseif(GNULINUX_PLATFORM) | ||
if("${NE10_TARGET_ARCH}" STREQUAL "armv7") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon -funsafe-math-optimizations") | ||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon") | ||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=vfp3 -funsafe-math-optimizations") | ||
# set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mthumb-interwork -mthumb -march=armv7-a -mfpu=neon") | ||
# Turn on asm optimization for Linux on ARM v7. | ||
set(NE10_ASM_OPTIMIZATION on) | ||
endif() | ||
elseif(IOS_PLATFORM) | ||
#set minimal target ios version.If not provided this option, Xcode | ||
#5.0.2 would generate code for iOS 7.0, which would lead runtime | ||
#error when run on device with earlier iOS version. | ||
if(NOT MIN_IOS_VER) | ||
set(MIN_IOS_VER "5.0") | ||
endif() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=" ${MIN_IOS_VER}) | ||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -miphoneos-version-min=" ${MIN_IOS_VER}) | ||
|
||
if(${NE10_TARGET_ARCH} STREQUAL "armv7") | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfloat-abi=hard -mfpu=neon -arch armv7 -arch armv7s") | ||
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=vfp3 -arch armv7 -arch armv7s") | ||
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -arch armv7 -arch armv7s") | ||
else() | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64") | ||
endif() | ||
|
||
message("-- CFLAGS: ${CMAKE_C_FLAGS}") | ||
|
||
string(REPLACE ";" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) | ||
string(REPLACE ";" "" CMAKE_ASM_FLAGS ${CMAKE_ASM_FLAGS}) | ||
endif() | ||
|
||
set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99") | ||
|
||
# Add NE10 library sub-directory. | ||
add_subdirectory(modules) | ||
|
||
if(NE10_BUILD_EXAMPLES AND NE10_ENABLE_MATH) | ||
add_subdirectory(samples) | ||
endif() | ||
|
||
if(NE10_BUILD_UNIT_TEST) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
if(ANDROID_PLATFORM AND ANDROID_DEMO) | ||
add_subdirectory(android/NE10Demo/jni) | ||
endif() | ||
|
||
if(IOS_PLATFORM AND IOS_DEMO) | ||
add_subdirectory(ios) | ||
endif() |
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,93 @@ | ||
Contributing to Project Ne10 | ||
==================================== | ||
|
||
Getting Started | ||
--------------- | ||
|
||
* Make sure you have a [GitHub account]. | ||
* Create an [issue] for your work if one does not already exist. This gives | ||
everyone visibility of whether others are working on something similar. ARM | ||
licensees may contact ARM directly via their partner managers instead if | ||
they prefer. | ||
* If you intend to include Third Party IP in your contribution, please | ||
raise a separate [issue] for this and ensure that the changes that | ||
include Third Party IP are made on a separate topic branch. | ||
* [Fork][] [Ne10][] on GitHub. | ||
* Clone the fork to your own machine. | ||
* Create a local topic branch based on the [Ne10][] `master` | ||
branch. | ||
|
||
|
||
Making Changes | ||
-------------- | ||
|
||
* Make commits of logical units. See these general [Git guidelines] for | ||
contributing to a project. | ||
* Follow the [ProjectNe10 coding style]; this style is enforced for ProjectNe10. | ||
* Keep the commits on topic. If you need to fix another bug or make another | ||
enhancement, please create a separate [issue] and address it on a separate | ||
topic branch. | ||
* Avoid long commit series. If you do have a long series, consider whether | ||
some commits should be squashed together or addressed in a separate topic. | ||
* Make sure your commit messages are in the proper format. If a commit fixes | ||
a GitHub [issue], include a reference (e.g. | ||
"fixes projectNe10/Ne10/issues/54"); this ensures the [issue] is | ||
[automatically closed] when merged into the [Ne10] `master` | ||
branch. | ||
* Where appropriate, please update the documentation. | ||
* Consider whether the [Release Notes] or [Building] file in the | ||
[Documentation] folder need updating. | ||
* Changes that have a material impact on behavior or programming | ||
interfaces should have an entry at the end of the [Release Notes]. Minor | ||
changes (e.g. basic refactoring or typo fixes) do not need an entry. | ||
* If this is your first contribution, you may add your name or your | ||
company name to the [Acknowledgements] file. | ||
* For topics with multiple commits, you should make all documentation | ||
changes (and nothing else) in the last commit of the series. Otherwise, | ||
include the documentation changes within the single commit. | ||
* Please test your changes. As a minimum, ensure the test application builds and runs. | ||
Also, perform unit and conformance tests on new functions. | ||
|
||
|
||
Submitting Changes | ||
------------------ | ||
|
||
* Ensure that each commit in the series has at least one `Signed-off-by:`line, | ||
using your real name and email address. The names in the Signed-off-by:` and | ||
`Author:` lines must match. If anyone else contributes to the commit, they | ||
must also add their own `Signed-off-by:` line. By adding this line the | ||
contributor certifies the contribution is made under the terms of the | ||
[Developer Certificate of Origin (DCO)][DCO]. | ||
* Push your local changes to your fork of the repository. | ||
* Submit a [pull request] to Ne10. | ||
* The changes in the pull request will then undergo further review and | ||
testing. Any review comments will be made as comments on the [pull | ||
request]. This may require you to do some rework. | ||
* When the changes are accepted, ARM will integrate them. | ||
* To ensure a linear commit history, ARM will typically rebase the commits | ||
locally before merging to the [Ne10] `master` branch. In | ||
this case, the [pull request] will be closed rather than directly merged | ||
on GitHub. If the rebase is not trivial, you may be asked to rebase the | ||
commits yourself. | ||
|
||
|
||
- - - - - - - - - - - - - - - - - - - - - - - - - - | ||
|
||
_Copyright (c) 2013-2017, ARM Limited and Contributors. All rights reserved._ | ||
|
||
|
||
[Release Notes]: ./doc/ReleaseNote.txt | ||
[Building]: ./doc/building.md | ||
[Documentation]: http://projectne10.github.io/Ne10/doc/ | ||
[Acknowledgements]: ./doc/acknowledgements.md "Contributor acknowledgements" | ||
[DCO]: ./dco.txt | ||
|
||
[GitHub account]: https://github.com/signup/free | ||
[Fork]: https://help.github.com/articles/fork-a-repo | ||
[issue]: https://github.com/projectNe10/Ne10/issues | ||
[pull request]: https://help.github.com/articles/using-pull-requests | ||
[automatically closed]: https://help.github.com/articles/closing-issues-via-commit-messages | ||
[Git guidelines]: http://git-scm.com/book/ch5-2.html | ||
[ProjectNe10 coding style]: https://github.com/projectNe10/Ne10/wiki/Ne10-Coding-Style | ||
[Ne10]: https://github.com/projectNe10/Ne10 | ||
[contributing page]: http://www.arm.com/community/open-source-contributing.php |
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,55 @@ | ||
# | ||
# Copyright 2013-16 ARM Limited and Contributors. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of ARM Limited nor the | ||
# names of its contributors may be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY ARM LIMITED AND CONTRIBUTORS "AS IS" AND | ||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
# DISCLAIMED. IN NO EVENT SHALL ARM LIMITED AND CONTRIBUTORS BE LIABLE FOR ANY | ||
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
|
||
# Usage: | ||
# $ mkdir build && cd build | ||
# $ cmake -DCMAKE_TOOLCHAIN_FILE=path/of/GNUlinux_config.cmake .. | ||
# $ make | ||
# | ||
# Option: | ||
# - Choose target architecture | ||
# Target architecture can be specified by setting NE10_LINUX_TARGET_ARCH to | ||
# armv7 or aarch64 (Not done yet). Defaut is armv7. | ||
|
||
set(GNULINUX_PLATFORM ON) | ||
|
||
if(NOT DEFINED ENV{NE10_LINUX_TARGET_ARCH}) | ||
set(NE10_LINUX_TARGET_ARCH "armv7") | ||
else() | ||
set(NE10_LINUX_TARGET_ARCH $ENV{NE10_LINUX_TARGET_ARCH}) | ||
endif() | ||
|
||
if(NE10_LINUX_TARGET_ARCH STREQUAL "armv7") | ||
set(CMAKE_C_COMPILER /opt/gcc-arm-none-eabi/bin/arm-none-eabi-gcc --specs=nosys.specs) | ||
set(CMAKE_CXX_COMPILER /opt/gcc-arm-none-eabi/bin/arm-none-eabi-g++ --specs=nosys.specs) | ||
set(CMAKE_ASM_COMPILER /opt/gcc-arm-none-eabi/bin/arm-none-eabi-as ) | ||
find_program(CMAKE_AR NAMES "arm-none-eabi--ar") | ||
find_program(CMAKE_RANLIB NAMES "arm-none-eabi-ranlib") | ||
endif() | ||
|
||
mark_as_advanced(CMAKE_AR) | ||
mark_as_advanced(CMAKE_RANLIB) |
Oops, something went wrong.