diff --git a/src/components/CMakeLists.txt b/src/components/CMakeLists.txt index 242282915..966d61a74 100644 --- a/src/components/CMakeLists.txt +++ b/src/components/CMakeLists.txt @@ -2,40 +2,49 @@ project(components VERSION ${scc_VERSION} LANGUAGES CXX) find_package(flatbuffers CONFIG QUIET) -add_library(${PROJECT_NAME} scc/at_router/nb_router.cpp) -add_library(scc::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) -target_include_directories(${PROJECT_NAME} PUBLIC - $ # for headers when building - $ # for client in install mode -) -target_link_libraries(${PROJECT_NAME} PUBLIC scc-sysc scc-util) - -if(TARGET flatbuffers::flatbuffers) - find_package(Boost REQUIRED COMPONENTS thread chrono) - # flatbuffers scheme to be compiled by flac binary - set(FB_SCHEMA "${CMAKE_CURRENT_LIST_DIR}/ipc.fbs") - # Location of the generated files. I like to use CMAKE_CURRENT_BINARY_DIR - # So it will not be in the source code tree. - set(FB_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/fbs/") - # This is an utilitary function that is available in flatbuffer cmake integration - # fbschemas is a new target that will be created with the generated file - build_flatbuffers("${FB_SCHEMA}" "" scc_fbschemas "" "${FB_OUTDIR}" "" "") - - target_sources(${PROJECT_NAME} PRIVATE scc/tcp4tlm_bridge.cpp scc/tcp4tlm_server.cpp scc/tcp4tlm_client.cpp) - target_include_directories(${PROJECT_NAME} PRIVATE - $ # for headers when building - $ # for headers when building + $ # for client in install mode + ) + target_link_libraries(${PROJECT_NAME} PUBLIC scc-sysc scc-util) + + if(TARGET flatbuffers::flatbuffers) + find_package(Boost REQUIRED COMPONENTS thread chrono) + # flatbuffers scheme to be compiled by flac binary + set(FB_SCHEMA "${CMAKE_CURRENT_LIST_DIR}/ipc.fbs") + # Location of the generated files. I like to use CMAKE_CURRENT_BINARY_DIR + # So it will not be in the source code tree. + set(FB_OUTDIR "${CMAKE_CURRENT_BINARY_DIR}/fbs/") + # This is an utilitary function that is available in flatbuffer cmake integration + # fbschemas is a new target that will be created with the generated file + build_flatbuffers("${FB_SCHEMA}" "" scc_fbschemas "" "${FB_OUTDIR}" "" "") + + target_sources(${PROJECT_NAME} PRIVATE scc/tcp4tlm_bridge.cpp scc/tcp4tlm_server.cpp scc/tcp4tlm_client.cpp) + target_include_directories(${PROJECT_NAME} PRIVATE + $ # for headers when building + $ # for headers when building + $ # for client in install mode + ) + target_link_libraries(${PROJECT_NAME} INTERFACE scc-sysc) endif() - set_target_properties(${PROJECT_NAME} PROPERTIES # VERSION ${PROJECT_VERSION} # FRAMEWORK FALSE diff --git a/src/components/scc/at_router/nb_arbiter.h b/src/components/scc/at_router/nb_arbiter.h index c7c218f8e..92fc63608 100644 --- a/src/components/scc/at_router/nb_arbiter.h +++ b/src/components/scc/at_router/nb_arbiter.h @@ -22,8 +22,6 @@ #include #include #include -#include -#include #include #ifndef SC_INCLUDE_DYNAMIC_PROCESSES #define SC_INCLUDE_DYNAMIC_PROCESSES @@ -171,4 +169,4 @@ struct nb_arbiter : public tlm::tlm_bw_nonblocking_transport_if -#include +#include namespace scc { namespace at_router { @@ -91,4 +90,4 @@ template struct i_port_fw_adapter : public at_router::i_port #include #include -#include #include #include diff --git a/src/components/scc/memory.h b/src/components/scc/memory.h index 001e34602..f328337d4 100644 --- a/src/components/scc/memory.h +++ b/src/components/scc/memory.h @@ -20,7 +20,6 @@ // Needed for the simple_target_socket #include #include -#include #include #ifndef SC_INCLUDE_DYNAMIC_PROCESSES #define SC_INCLUDE_DYNAMIC_PROCESSES @@ -34,8 +33,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/src/components/scc/router.h b/src/components/scc/router.h index 253e8a166..3f9594fb7 100644 --- a/src/components/scc/router.h +++ b/src/components/scc/router.h @@ -33,8 +33,6 @@ #include #include #include -#include -#include #include namespace scc { diff --git a/src/components/scc/tlm_target.h b/src/components/scc/tlm_target.h index 3b4955d8d..d13e04bde 100644 --- a/src/components/scc/tlm_target.h +++ b/src/components/scc/tlm_target.h @@ -22,7 +22,6 @@ #include #include #include -#include #include namespace scc { diff --git a/src/interfaces/tilelink/scv/tlc_recorder.h b/src/interfaces/tilelink/scv/tlc_recorder.h index cc608bf14..8062d1698 100644 --- a/src/interfaces/tilelink/scv/tlc_recorder.h +++ b/src/interfaces/tilelink/scv/tlc_recorder.h @@ -16,7 +16,6 @@ #pragma once -#include #ifndef SC_INCLUDE_DYNAMIC_PROCESSES #define SC_INCLUDE_DYNAMIC_PROCESSES #endif diff --git a/src/sysc/tlm/nw/tlm_network_gp.h b/src/sysc/tlm/nw/tlm_network_gp.h index 2c2c87be3..e56febcb8 100644 --- a/src/sysc/tlm/nw/tlm_network_gp.h +++ b/src/sysc/tlm/nw/tlm_network_gp.h @@ -18,14 +18,10 @@ #define _TLM_NW_TLM_NETWROK_GP_H_ #include "tlm_array.h" +#include #include +#include #include -#ifdef CWR_SYSTEMC -#include -#else -#include -#endif -#include /** * @brief The SystemC Transaction Level Model (TLM) Network TLM utilities. diff --git a/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h b/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h index cb14bbda0..af41066c0 100644 --- a/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h +++ b/src/sysc/tlm/scc/lwtr/tlm2_lwtr.h @@ -27,7 +27,6 @@ #include #include #include -#include #include /** diff --git a/src/sysc/tlm/scc/tlm_extensions.h b/src/sysc/tlm/scc/tlm_extensions.h index ccf6ee23e..5ce5291fa 100644 --- a/src/sysc/tlm/scc/tlm_extensions.h +++ b/src/sysc/tlm/scc/tlm_extensions.h @@ -17,12 +17,8 @@ #ifndef SC_COMPONENTS_INCL_TLM_TLM_EXTENSIONS_H_ #define SC_COMPONENTS_INCL_TLM_TLM_EXTENSIONS_H_ -#ifdef CWR_SYSTEMC -#include -#else -#include -#endif #include "tlm_gp_shared.h" +#include //! @brief SystemC TLM namespace tlm { diff --git a/src/sysc/tlm/scc/tlm_signal_gp.h b/src/sysc/tlm/scc/tlm_signal_gp.h index 2563914ce..6f9403264 100644 --- a/src/sysc/tlm/scc/tlm_signal_gp.h +++ b/src/sysc/tlm/scc/tlm_signal_gp.h @@ -18,11 +18,7 @@ #define _TLM_TLM_SIGNAL_GP_H_ #include -#ifdef CWR_SYSTEMC -#include -#else -#include -#endif +#include //! @brief SystemC TLM namespace tlm { diff --git a/src/sysc/tlm/scc/tlm_signal_sockets.h b/src/sysc/tlm/scc/tlm_signal_sockets.h index 40f89d659..51752989b 100644 --- a/src/sysc/tlm/scc/tlm_signal_sockets.h +++ b/src/sysc/tlm/scc/tlm_signal_sockets.h @@ -17,16 +17,10 @@ #ifndef _TLM_TLM_SIGNAL_SOCKETS_H_ #define _TLM_TLM_SIGNAL_SOCKETS_H_ -#include "scc/report.h" +#include #include -#ifdef CWR_SYSTEMC -#include -#include -#else -#include -#include -#endif +#include //! @brief SystemC TLM namespace tlm { diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b05b80add..622d31d0d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -12,16 +12,17 @@ add_subdirectory(sc_fixed_tracing) add_subdirectory(cxs_tlm) add_subdirectory(tlm_memory) add_subdirectory(memory_subsys) -add_subdirectory(at_router_crossbar) -add_subdirectory(at_router_hub) add_subdirectory(quantum_keeper_mt) add_subdirectory(sim_speed) add_subdirectory(streambuf) if(FULL_TEST_SUITE) add_subdirectory(sim_performance) endif() -find_package(flatbuffers CONFIG QUIET) -if(TARGET flatbuffers::flatbuffers) - add_subdirectory(tcp4tlm_bridge) +if(CMAKE_CXX_STANDARD GREATER_EQUAL 17) + add_subdirectory(at_router_crossbar) + add_subdirectory(at_router_hub) + find_package(flatbuffers CONFIG QUIET) + if(TARGET flatbuffers::flatbuffers) + add_subdirectory(tcp4tlm_bridge) + endif() endif() -