From 219c2e60cd7a4816e332c7c3edec4ac479faab8c Mon Sep 17 00:00:00 2001 From: Eyck Jentzsch Date: Fri, 30 Sep 2022 15:21:01 +0200 Subject: [PATCH] updates scc and applies needed changes --- .cproject | 11 ++++++++-- .gitignore | 1 + CMakeLists.txt | 39 +++++------------------------------- examples/ahb_bfm/sc_main.cpp | 8 ++++---- scc | 2 +- tests/io-redirector/main.cpp | 8 ++++---- 6 files changed, 24 insertions(+), 45 deletions(-) diff --git a/.cproject b/.cproject index d31d49e..ff869b6 100644 --- a/.cproject +++ b/.cproject @@ -23,7 +23,7 @@ - + @@ -59,6 +59,12 @@ + + + + + + @@ -239,6 +245,7 @@ + @@ -275,4 +282,4 @@ - + \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9ada3e4..6eccf7a 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ /simple_system.txlog /my_db* /.settings/ +/Debug/ diff --git a/CMakeLists.txt b/CMakeLists.txt index b39ea17..2213296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.12) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/scc/cmake) project(SCC_Test) @@ -8,19 +8,9 @@ set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV") set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries") set(ENABLE_CLANG_TIDY FALSE CACHE BOOL "Enable clang-tidy checks") -include(GitFunctions) -get_info_from_git() -### set the directory names of the submodules -set(GIT_SUBMODULES scc) -set(GIT_SUBMODULE_DIR_sc-components .) -### set each submodules's commit or tag that is to be checked out -### (leave empty if you want master) -#set(GIT_SUBMODULE_VERSION_sc-components 3af6b9836589b082c19d9131c5d0b7afa8ddd7cd) -set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH}) - -include(GNUInstallDirs) include(ConanInline) +include(GNUInstallDirs) include(BuildType) #enable_testing() @@ -70,7 +60,7 @@ else() endif() endif() -setup_conan(TARGETS) +conan_check() conan_configure(REQUIRES fmt/6.1.2 boost/1.75.0 gsl-lite/0.37.0 systemc/2.3.3 systemc-cci/1.0.0 GENERATORS cmake_find_package OPTIONS fmt:header_only=True @@ -81,30 +71,11 @@ find_package(ZLIB) # This line finds the boost lib and headers. set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install. find_package(Boost COMPONENTS program_options filesystem system thread REQUIRED) - -# set-up SystemC and SCV -include(FindSystemCPackage) -if(NOT SystemC_FOUND) - message( FATAL_ERROR "SystemC library not found." ) -endif() +find_package(fmt) +include(SystemCPackage) enable_testing() add_subdirectory(scc) add_subdirectory(examples) add_subdirectory(tests) - -# -# SYSTEM PACKAGING (RPM, TGZ, ...) -# _____________________________________________________________________________ - -#include(CPackConfig) - -# -# CMAKE PACKAGING (for other CMake projects to use this one easily) -# _____________________________________________________________________________ - -#include(PackageConfigurator) - -#include(FeatureSummary) -#feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES PACKAGES_FOUND) diff --git a/examples/ahb_bfm/sc_main.cpp b/examples/ahb_bfm/sc_main.cpp index 163c014..ca278c6 100644 --- a/examples/ahb_bfm/sc_main.cpp +++ b/examples/ahb_bfm/sc_main.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include #include #include @@ -17,7 +17,7 @@ class testbench: public sc_module, public scc::traceable { public: enum { WIDTH=64}; tlm::scc::initiator_mixin> isck{"isck"}; - ahb::bfm::initiator intor{"intor"}; + ahb::pin::initiator intor{"intor"}; sc_core::sc_clock HCLK{"HCLK", 10_ns}; sc_core::sc_signal HRESETn{"HRESETn"}; sc_core::sc_signal> HADDR{"HADDR"}; @@ -33,7 +33,7 @@ public: sc_core::sc_signal HRESP{"HRESP"}; sc_core::sc_signal HSEL{"HSEL"}; - ahb::bfm::target target{"target"}; + ahb::pin::target target{"target"}; tlm::scc::target_mixin> tsck{"tsck"}; testbench(sc_module_name nm):sc_module(nm){ diff --git a/scc b/scc index 64bb5dd..ebc5c4f 160000 --- a/scc +++ b/scc @@ -1 +1 @@ -Subproject commit 64bb5dd1e6c81d38ade0d53fd8c7b93d3110a5d8 +Subproject commit ebc5c4f9097e50f109549ffb6b6bd6693985f307 diff --git a/tests/io-redirector/main.cpp b/tests/io-redirector/main.cpp index e551e1f..84e1edd 100644 --- a/tests/io-redirector/main.cpp +++ b/tests/io-redirector/main.cpp @@ -11,12 +11,12 @@ #include int main(int arcg, char* argv[]){ - IoRedirector::get().start(); - auto result1 = IoRedirector::get().get_output(); + util::IoRedirector::get().start(); + auto result1 = util::IoRedirector::get().get_output(); assert(result1==""); printf("Some output"); std::cout<<"Some other output"<