Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 42 additions & 33 deletions src/components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> # for headers when building
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> # 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
$<BUILD_INTERFACE:${flatbuffers_INCLUDE_DIR}> # for headers when building
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR})
target_link_libraries(${PROJECT_NAME} PUBLIC flatbuffers::flatbuffers)
if(TARGET Boost::thread)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::thread Boost::chrono)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC
${Boost_THREAD_LIBRARY}
${Boost_CHRONO_LIBRARY}
)
endif()
if(CMAKE_CXX_STANDARD GREATER_EQUAL 17)
add_library(${PROJECT_NAME} scc/at_router/nb_router.cpp)
add_library(scc::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> # for headers when building
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> # 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
$<BUILD_INTERFACE:${flatbuffers_INCLUDE_DIR}> # for headers when building
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR})
target_link_libraries(${PROJECT_NAME} PUBLIC flatbuffers::flatbuffers)
if(TARGET Boost::thread)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::thread Boost::chrono)
else()
target_link_libraries(${PROJECT_NAME} PUBLIC
${Boost_THREAD_LIBRARY}
${Boost_CHRONO_LIBRARY}
)
endif()
endif()
else()
add_library(${PROJECT_NAME} INTERFACE)
add_library(scc::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> # for headers when building
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> # 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
Expand Down
4 changes: 1 addition & 3 deletions src/components/scc/at_router/nb_arbiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
#include <memory>
#include <sysc/kernel/sc_time.h>
#include <systemc>
#include <tlm_core/tlm_2/tlm_2_interfaces/tlm_fw_bw_ifs.h>
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_phase.h>
#include <unordered_map>
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
Expand Down Expand Up @@ -171,4 +169,4 @@ struct nb_arbiter : public tlm::tlm_bw_nonblocking_transport_if<typename TYPES::

} // namespace at_router
} // namespace scc
#endif
#endif
5 changes: 2 additions & 3 deletions src/components/scc/at_router/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
#ifndef _SYSC_NB_ROUTER_TYPES_H_
#define _SYSC_NB_ROUTER_TYPES_H_

#include <sysc/communication/sc_export.h>
#include <tlm_core/tlm_2/tlm_2_interfaces/tlm_fw_bw_ifs.h>
#include <tlm>

namespace scc {
namespace at_router {
Expand Down Expand Up @@ -91,4 +90,4 @@ template <typename TYPES> struct i_port_fw_adapter : public at_router::i_port<TY

} // namespace at_router
} // namespace scc
#endif
#endif
1 change: 0 additions & 1 deletion src/components/scc/dmi_mgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <scv-tr/scv_tr.h>
#include <sysc/communication/sc_port.h>
#include <tlm>
#include <tlm_core/tlm_2/tlm_2_interfaces/tlm_dmi.h>
#include <tlm_utils/tlm_quantumkeeper.h>
#include <util/range_lut.h>

Expand Down
3 changes: 1 addition & 2 deletions src/components/scc/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
// Needed for the simple_target_socket
#include <nonstd/span.h>
#include <tlm/scc/memory_map_collector.h>
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#include <util/ities.h>
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
Expand All @@ -34,8 +33,8 @@
#include <scc/report.h>
#include <scc/signal_opt_ports.h>
#include <scc/utilities.h>
#include <tlm.h>
#include <tlm/scc/target_mixin.h>
#include <tlm>
#include <util/range_lut.h>
#include <util/sparse_array.h>

Expand Down
2 changes: 0 additions & 2 deletions src/components/scc/router.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <tlm/scc/scv/tlm_rec_target_socket.h>
#include <tlm/scc/target_mixin.h>
#include <tlm>
#include <tlm_core/tlm_2/tlm_2_interfaces/tlm_fw_bw_ifs.h>
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_phase.h>
#include <unordered_map>

namespace scc {
Expand Down
1 change: 0 additions & 1 deletion src/components/scc/tlm_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <tlm/scc/memory_map_collector.h>
#include <tlm/scc/scv/tlm_rec_target_socket.h>
#include <tlm/scc/target_mixin.h>
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#include <util/range_lut.h>

namespace scc {
Expand Down
1 change: 0 additions & 1 deletion src/interfaces/tilelink/scv/tlc_recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#pragma once

#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#ifndef SC_INCLUDE_DYNAMIC_PROCESSES
#define SC_INCLUDE_DYNAMIC_PROCESSES
#endif
Expand Down
8 changes: 2 additions & 6 deletions src/sysc/tlm/nw/tlm_network_gp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@
#define _TLM_NW_TLM_NETWROK_GP_H_

#include "tlm_array.h"
#include <cstdint>
#include <deque>
#include <tlm>
#include <vector>
#ifdef CWR_SYSTEMC
#include <tlm_h/tlm_generic_payload/tlm_gp.h>
#else
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#endif
#include <cstdint>

/**
* @brief The SystemC Transaction Level Model (TLM) Network TLM utilities.
Expand Down
1 change: 0 additions & 1 deletion src/sysc/tlm/scc/lwtr/tlm2_lwtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <tlm/scc/lwtr/lwtr4tlm2_extension_registry.h>
#include <tlm/scc/tlm_gp_shared.h>
#include <tlm/scc/tlm_mm.h>
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_phase.h>
#include <unordered_map>

/**
Expand Down
6 changes: 1 addition & 5 deletions src/sysc/tlm/scc/tlm_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@
#ifndef SC_COMPONENTS_INCL_TLM_TLM_EXTENSIONS_H_
#define SC_COMPONENTS_INCL_TLM_TLM_EXTENSIONS_H_

#ifdef CWR_SYSTEMC
#include <tlm_h/tlm_generic_payload/tlm_gp.h>
#else
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#endif
#include "tlm_gp_shared.h"
#include <tlm>

//! @brief SystemC TLM
namespace tlm {
Expand Down
6 changes: 1 addition & 5 deletions src/sysc/tlm/scc/tlm_signal_gp.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
#define _TLM_TLM_SIGNAL_GP_H_

#include <deque>
#ifdef CWR_SYSTEMC
#include <tlm_h/tlm_generic_payload/tlm_gp.h>
#else
#include <tlm_core/tlm_2/tlm_generic_payload/tlm_gp.h>
#endif
#include <tlm>

//! @brief SystemC TLM
namespace tlm {
Expand Down
10 changes: 2 additions & 8 deletions src/sysc/tlm/scc/tlm_signal_sockets.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,10 @@
#ifndef _TLM_TLM_SIGNAL_SOCKETS_H_
#define _TLM_TLM_SIGNAL_SOCKETS_H_

#include "scc/report.h"
#include <scc/report.h>

#include <sysc/kernel/sc_object.h>
#ifdef CWR_SYSTEMC
#include <tlm_h/tlm_sockets/tlm_initiator_socket.h>
#include <tlm_h/tlm_sockets/tlm_target_socket.h>
#else
#include <tlm_core/tlm_2/tlm_sockets/tlm_initiator_socket.h>
#include <tlm_core/tlm_2/tlm_sockets/tlm_target_socket.h>
#endif
#include <tlm>

//! @brief SystemC TLM
namespace tlm {
Expand Down
13 changes: 7 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Loading