Added SCV packaging

This commit is contained in:
Eyck Jentzsch 2017-10-28 17:07:33 +02:00
parent 7ea6b9da31
commit efc00d983f
11 changed files with 288 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.pyc

1
SystemC/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/systemc*

14
SystemC/build.py Normal file
View File

@ -0,0 +1,14 @@
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
cxxstds = ['98','11','14']
archs = ['x86', 'x86_64']
types = ['Debug','Release']
#configs = [[i,j,k] for i in cxxstds for j in archs for k in types]
#for triple in configs:
# builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={})
configs = [[i,k] for i in cxxstds for k in types]
for triple in configs:
builder.add(settings={"build_type":triple[1]}, options={"SystemC:stdcxx" : triple[0]}, env_vars={}, build_requires={})
builder.run()

View File

@ -22,7 +22,7 @@ class SeasocksConan(ConanFile):
# self.run("cd SystemCLanguage && git checkout master")
def build(self):
cmake = CMake(self)
cmake = CMake(self, parallel=True)
cmake.configure(source_dir="%s/systemc-2.3.2" % self.source_folder)
shared = "-DBUILD_SHARED_LIBS=ON" if self.options.shared else "-DBUILD_SHARED_LIBS=OFF"
self.run('cmake systemc-2.3.2 %s %s -DCMAKE_CXX_STANDARD=%s' % (cmake.command_line, shared, self.options.stdcxx))

1
SystemCVerification/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/scv*

View File

@ -0,0 +1,14 @@
from conan.packager import ConanMultiPackager
if __name__ == "__main__":
builder = ConanMultiPackager()
cxxstds = ['98','11','14']
archs = ['x86', 'x86_64']
types = ['Debug','Release']
#configs = [[i,j,k] for i in cxxstds for j in archs for k in types]
#for triple in configs:
# builder.add(settings={"arch": triple[1], "build_type":triple[2]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={})
configs = [[i,k] for i in cxxstds for k in types]
for triple in configs:
builder.add(settings={"build_type":triple[1]}, options={"SystemCVerification:stdcxx" : triple[0]}, env_vars={}, build_requires={})
builder.run()

View File

@ -0,0 +1,59 @@
from conans import ConanFile, tools, AutoToolsBuildEnvironment
class SystemcverificationConan(ConanFile):
name = "SystemCVerification"
version = "2.0.0a"
folder = "scv-2.0.0a-20161019"
license = "Apache License 2.0"
url = "<Package recipe repository url here, for issues about the package>"
description = "<Description of Systemcverification here>"
settings = "os", "compiler", "build_type", "arch"
options = {"stdcxx":[98,11,14]}
default_options = "stdcxx=98"
generators = "txt"
exports_sources = "scv-2.0.0a-20161019/*"
requires = "SystemC/2.3.2@minres/stable"
def configure(self):
self.options["SystemC"].stdcxx = self.options.stdcxx
# Maybe in windows we know that OpenSSL works better as shared (false)
#if self.settings.os == "Windows":
# self.options["OpenSSL"].shared = True
# Or adjust any other available option
# self.options["Poco"].other_option = "foo"
def build(self):
env_build = AutoToolsBuildEnvironment(self)
if self.options.stdcxx == "14":
env_build.cxx_flags = "-std=c++14"
elif self.options.stdcxx == "11":
env_build.cxx_flags = "-std=c++11"
elif self.options.stdcxx == "98":
env_build.cxx_flags = "-std=c++98"
#env_build.libs.append("pthread")
#env_build.defines.append("NEW_DEFINE=23")
self.output.info(env_build.vars)
with tools.environment_append(env_build.vars):
self.run("cd %s && mkdir _build" % self.folder)
configure_command = 'cd %s/_build && env && ../configure --prefix=%s/_install --with-systemc=%s --disable-debug --disable-opt'
self.output.info(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath))
self.run(configure_command % (self.folder, self.build_folder, self.deps_cpp_info["SystemC"].rootpath))
self.run("cd %s/_build && make -j && make install" % self.folder)
def package(self):
# Headers
self.copy(pattern="*.h", dst="include", src="_install/include", keep_path=True)
# Libs
self.copy(pattern="*", dst="lib", src="_install/lib-linux", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-linux64", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-macosx", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-macosx64", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-cygwin", keep_path=False)
self.copy(pattern="*", dst="lib", src="_install/lib-mingw", keep_path=False)
def package_info(self):
self.cpp_info.libs = ["scv"]

View File

@ -0,0 +1,130 @@
diff -rupN scv-2.0.0a-20161019/configure scv-2.0.0a-20161019-patched/configure
--- scv-2.0.0a-20161019/configure 2016-10-19 23:25:31.000000000 +0200
+++ scv-2.0.0a-20161019-patched/configure 2017-10-28 17:00:36.367027496 +0200
@@ -16136,7 +16136,7 @@ sparc)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$SPARC_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$SPARC_GNU_CFLAGS"
@@ -16152,8 +16152,8 @@ sparc)
echo 'setting library options for g++ on Solaris'
;;
'') echo 'setting compiler flags for NOT g++'
- AM_CXXFLAGS="$SPARC_CC_CXXFLAGS"
- CXXFLAGS="$SUN_CC_OPT $SUN_CC_DBG"
+ AM_CXXFLAGS="$SPARC_CC_CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $SUN_CC_OPT $SUN_CC_DBG"
CXXFLAGS_DEBUG="$DEF_SUN_CC_DBG"
CXXFLAGS_OPT="$DEF_SUN_CC_OPT"
AM_CFLAGS="$SPARC_CC_CFLAGS"
@@ -16173,7 +16173,7 @@ hppa*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$HPPA_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$HPPA_GNU_CFLAGS"
@@ -16192,7 +16192,7 @@ hppa*)
;;
'') echo 'setting compiler flags and defines for HP aCC'
AM_CXXFLAGS="$HPPA_ACC_CXXFLAGS"
- CXXFLAGS="$HP_ACC_OPT $HP_ACC_DBG"
+ CXXFLAGS="$CXXFLAGS $HP_ACC_OPT $HP_ACC_DBG"
CXXFLAGS_DEBUG="$DEF_HP_ACC_DBG"
CXXFLAGS_OPT="$DEF_HP_ACC_OPT"
AM_CFLAGS="$HPPA_ACC_XFLAGS"
@@ -16216,7 +16216,7 @@ powerpc*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16235,7 +16235,7 @@ powerpc*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16256,7 +16256,7 @@ i[3456]86*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16275,7 +16275,7 @@ i[3456]86*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16296,7 +16296,7 @@ x86_64*)
case "$GXX" in
yes) echo 'setting compiler flags for g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
@@ -16315,7 +16315,7 @@ x86_64*)
;;
'') echo 'setting compiler flags for NOT g++'
AM_CXXFLAGS="$LINUX_GNU_CXXFLAGS"
- CXXFLAGS="$GNU_OPT $GNU_DBG"
+ CXXFLAGS="$CXXFLAGS $GNU_OPT $GNU_DBG"
CXXFLAGS_DEBUG="$DEF_GNU_DBG"
CXXFLAGS_OPT="$DEF_GNU_OPT"
AM_CFLAGS="$LINUX_GNU_CFLAGS"
diff -rupN scv-2.0.0a-20161019/src/scv/_scv_introspection.h scv-2.0.0a-20161019-patched/src/scv/_scv_introspection.h
--- scv-2.0.0a-20161019/src/scv/_scv_introspection.h 2016-10-19 23:25:31.000000000 +0200
+++ scv-2.0.0a-20161019-patched/src/scv/_scv_introspection.h 2017-10-28 10:54:04.359018484 +0200
@@ -553,7 +553,7 @@ public: \
_SCV_MAP(int,length) \
_SCV_MAP(int,size) \
sc_logic_value_t get_bit(int i) const \
- { this->initialize(); return this->_get_instance()->get_bit(i); } \
+ { this->initialize(); return sc_logic_value_t(this->_get_instance()->get_bit(i)); } \
void set_bit(int i, sc_logic_value_t v) \
{ this->initialize(); this->_get_instance()->set_bit(i,v); this->trigger_value_change_cb(); } \
unsigned long get_word(int i) const \
diff -rupN scv-2.0.0a-20161019/src/scv/scv_random.cpp scv-2.0.0a-20161019-patched/src/scv/scv_random.cpp
--- scv-2.0.0a-20161019/src/scv/scv_random.cpp 2016-10-19 23:25:31.000000000 +0200
+++ scv-2.0.0a-20161019-patched/src/scv/scv_random.cpp 2017-10-28 10:56:49.880659476 +0200
@@ -49,6 +49,7 @@
#include <cstdio>
#include <cstdlib>
+#include <cstring>
#if ((defined _MSC_VER) || (defined _WIN32))
diff -rupN scv-2.0.0a-20161019/src/scv/scv_util.cpp scv-2.0.0a-20161019-patched/src/scv/scv_util.cpp
--- scv-2.0.0a-20161019/src/scv/scv_util.cpp 2016-10-19 23:25:31.000000000 +0200
+++ scv-2.0.0a-20161019-patched/src/scv/scv_util.cpp 2017-10-28 10:58:02.323613714 +0200
@@ -44,7 +44,7 @@
#include "scv/scv_util.h"
#include "scv/_scv_associative_array.h"
#include "scv/scv_report.h"
-
+#include <cstring>
/* ************************************************************************** */
// For cdsIdent:

View File

@ -0,0 +1,14 @@
project(PackageTest CXX)
cmake_minimum_required(VERSION 2.8.12)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
add_executable(example main.cpp)
target_link_libraries(example ${CONAN_LIBS})
# CTest is a testing tool that can be used to test your project.
# enable_testing()
# add_test(NAME example
# WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
# COMMAND example)

View File

@ -0,0 +1,24 @@
from conans import ConanFile, CMake
import os
class SystemcverificationTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cxxstd = self.options["SystemC"].stdcxx
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is in "test_package"
cmake.configure(source_dir=self.conanfile_directory, build_dir="./")
#cmake.build()
self.run('cmake %s %s -DCMAKE_CXX_STANDARD=%s' % (self.conanfile_directory, cmake.command_line, cxxstd))
self.run("cmake --build . %s" % cmake.build_config)
def imports(self):
self.copy("*.dll", dst="bin", src="bin")
self.copy("*.dylib*", dst="bin", src="lib")
self.copy('*.so*', dst='bin', src='lib')
def test(self):
os.chdir("bin")
self.run(".%sexample" % os.sep)

View File

@ -0,0 +1,29 @@
// -*- C++ -*- <this line is for emacs to recognize it as C++ code>
/*****************************************************************************
Licensed to Accellera Systems Initiative Inc. (Accellera)
under one or more contributor license agreements. See the
NOTICE file distributed with this work for additional
information regarding copyright ownership. Accellera licenses
this file to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*****************************************************************************/
#include "scv.h"
int sc_main(int argc, char** argv) {
scv_smart_ptr<int> addr("addr");
scv_random::set_global_seed(100);
cout << "Success!" << endl;
return 0;
}