From dbd5f7c3f1c10661ce5115fb1a011263d5fdd2cd Mon Sep 17 00:00:00 2001 From: Adrien Cassagne Date: Wed, 18 Nov 2020 14:23:41 +0100 Subject: [PATCH] Remove the outdated SystemC/TLM compatibility. --- .gitlab-ci.yml | 31 -- CMakeLists.txt | 51 +-- .../installation/compilation/compilation.rst | 8 - doc/source/user/library/examples.rst | 106 +------ .../simulation/parameters/other/other.rst | 1 - include/Module/Module.hpp | 9 - include/Module/SC_Module.hpp | 133 -------- include/Module/SC_Module.hxx | 49 --- include/Tools/SystemC/SC_Debug.hpp | 49 --- include/Tools/SystemC/SC_Debug.hxx | 48 --- include/Tools/SystemC/SC_Dummy.hpp | 36 --- include/Tools/SystemC/SC_Duplicator.hpp | 41 --- include/Tools/SystemC/SC_Funnel.hpp | 39 --- include/Tools/SystemC/SC_Predicate.hpp | 41 --- include/Tools/SystemC/SC_Router.hpp | 44 --- include/aff3ct.hpp | 21 -- src/Factory/Simulation/BFER/BFER.cpp | 3 - src/Factory/Simulation/BFER/BFER_ite.cpp | 5 - src/Factory/Simulation/BFER/BFER_std.cpp | 5 - src/Factory/Simulation/EXIT/EXIT.cpp | 6 - src/Launcher/Simulation/EXIT.cpp | 4 - src/Module/Module.cpp | 29 -- src/Module/SC_Module.cpp | 295 ------------------ .../BFER/Iterative/SystemC/SC_BFER_ite.cpp | 271 ---------------- .../BFER/Iterative/SystemC/SC_BFER_ite.hpp | 50 --- .../BFER/Standard/SystemC/SC_BFER_std.cpp | 214 ------------- .../BFER/Standard/SystemC/SC_BFER_std.hpp | 41 --- src/Tools/SystemC/SC_Dummy.cpp | 20 -- src/Tools/SystemC/SC_Duplicator.cpp | 23 -- src/Tools/SystemC/SC_Funnel.cpp | 23 -- src/Tools/SystemC/SC_Predicate.cpp | 21 -- src/Tools/SystemC/SC_Router.cpp | 25 -- src/main.cpp | 14 - 33 files changed, 15 insertions(+), 1741 deletions(-) delete mode 100644 include/Module/SC_Module.hpp delete mode 100644 include/Module/SC_Module.hxx delete mode 100644 include/Tools/SystemC/SC_Debug.hpp delete mode 100644 include/Tools/SystemC/SC_Debug.hxx delete mode 100644 include/Tools/SystemC/SC_Dummy.hpp delete mode 100644 include/Tools/SystemC/SC_Duplicator.hpp delete mode 100644 include/Tools/SystemC/SC_Funnel.hpp delete mode 100644 include/Tools/SystemC/SC_Predicate.hpp delete mode 100644 include/Tools/SystemC/SC_Router.hpp delete mode 100644 src/Module/SC_Module.cpp delete mode 100644 src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.cpp delete mode 100644 src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp delete mode 100644 src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.cpp delete mode 100644 src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp delete mode 100644 src/Tools/SystemC/SC_Dummy.cpp delete mode 100644 src/Tools/SystemC/SC_Duplicator.cpp delete mode 100644 src/Tools/SystemC/SC_Funnel.cpp delete mode 100644 src/Tools/SystemC/SC_Predicate.cpp delete mode 100644 src/Tools/SystemC/SC_Router.cpp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2158f3ed6..a677d7719 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -255,37 +255,6 @@ build-linux-gcc-mpi: - source ./ci/tools/threads.sh - ./ci/build-linux-macos.sh -build-linux-gcc-systemc: - stage: build - variables: - GIT_SUBMODULE_STRATEGY: recursive - except: - - schedules - needs: - - job: analysis-cppcheck - artifacts: false - - job: analysis-headers - artifacts: false - tags: - - linux - - gcc - - systemc - - cmake - artifacts: - name: build-linux-gcc-systemc - paths: - - build_linux_gcc_systemc - script: - - cp $SYSTEMC_HOME/FindSystemC.cmake cmake/Modules/ - - cp $SYSTEMC_HOME/FindTLM.cmake cmake/Modules/ - - export CC="gcc" - - export CXX="g++" - - export CFLAGS="-Wall -funroll-loops -march=native -Wno-deprecated-declarations" - - export CMAKE_OPT="-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_SYSTEMC_SIMU=ON" - - export NAME="build_linux_gcc_systemc" - - source ./ci/tools/threads.sh - - ./ci/build-linux-macos.sh - build-linux-clang: stage: build variables: diff --git a/CMakeLists.txt b/CMakeLists.txt index 0da3c39ec..bf67efc24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,19 +15,17 @@ project(aff3ct) # ------------------------------------------------------------------------------------------------------- CMAKE OPTIONS # --------------------------------------------------------------------------------------------------------------------- -option(AFF3CT_COMPILE_EXE "Compile the executable" ON ) -option(AFF3CT_COMPILE_STATIC_LIB "Compile the static library" OFF) -option(AFF3CT_COMPILE_SHARED_LIB "Compile the shared library" OFF) -option(AFF3CT_LINK_GSL "Link with the GSL library (used in the channels)" OFF) -option(AFF3CT_LINK_MKL "Link with the MKL library (used in the channels)" OFF) -option(AFF3CT_LINK_HWLOC "Link with the hwloc library (used for threads pinning)" OFF) -option(AFF3CT_SYSTEMC_SIMU "Enable the SystemC simulation (incompatible with the library compilation)" OFF) -option(AFF3CT_SYSTEMC_MODULE "Enable the SystemC support (only for the modules)" OFF) -option(AFF3CT_MPI "Enable the MPI support" OFF) -option(AFF3CT_POLAR_BIT_PACKING "Enable the bit packing technique for Polar code SC decoding" ON ) -option(AFF3CT_POLAR_BOUNDS "Enable the use of the external Tal & Vardy Polar best channels generator" OFF) -option(AFF3CT_COLORS "Enable the colors in the terminal" ON ) -option(AFF3CT_OVERRIDE_VERSION "Compile without .git directory, provided a version and hash" OFF) +option(AFF3CT_COMPILE_EXE "Compile the executable" ON ) +option(AFF3CT_COMPILE_STATIC_LIB "Compile the static library" OFF) +option(AFF3CT_COMPILE_SHARED_LIB "Compile the shared library" OFF) +option(AFF3CT_LINK_GSL "Link with the GSL library (used in the channels)" OFF) +option(AFF3CT_LINK_MKL "Link with the MKL library (used in the channels)" OFF) +option(AFF3CT_LINK_HWLOC "Link with the hwloc library (used for threads pinning)" OFF) +option(AFF3CT_MPI "Enable the MPI support" OFF) +option(AFF3CT_POLAR_BIT_PACKING "Enable the bit packing technique for Polar code SC decoding" ON ) +option(AFF3CT_POLAR_BOUNDS "Enable the use of the external Tal & Vardy Polar best channels generator" OFF) +option(AFF3CT_COLORS "Enable the colors in the terminal" ON ) +option(AFF3CT_OVERRIDE_VERSION "Compile without .git directory, provided a version and hash" OFF) if (AFF3CT_COMPILE_EXE OR AFF3CT_COMPILE_STATIC_LIB OR AFF3CT_COMPILE_SHARED_LIB) set(AFF3CT_COMPILE_OBJ ON) @@ -55,10 +53,6 @@ endif() set(AFF3CT_PREC "MULTI" CACHE STRING "Select the precision in bits (can be '8', '16', '32', '64' or 'MULTI')") -if(AFF3CT_SYSTEMC_SIMU AND (AFF3CT_COMPILE_STATIC_LIB OR AFF3CT_COMPILE_SHARED_LIB)) - message(FATAL_ERROR "It is impossible to compile the AFF3CT library if AFF3CT_SYSTEMC_SIMU='ON'.") -endif() - if(AFF3CT_MPI AND (AFF3CT_COMPILE_STATIC_LIB OR AFF3CT_COMPILE_SHARED_LIB)) message(FATAL_ERROR "Building AFF3CT with the MPI support is incompatible with the library mode.") endif() @@ -423,29 +417,6 @@ macro(aff3ct_target_link_libraries privacy lib) endif(AFF3CT_COMPILE_STATIC_LIB) endmacro() -# SystemC (it is very important to have SystemC linked before the other libraries !!!) -if(AFF3CT_SYSTEMC_SIMU OR AFF3CT_SYSTEMC_MODULE) - if(AFF3CT_SYSTEMC_SIMU) - aff3ct_target_compile_definitions(PUBLIC "AFF3CT_SYSTEMC_SIMU") - aff3ct_target_compile_definitions(PUBLIC "AFF3CT_SYSTEMC_MODULE") - else() - aff3ct_target_compile_definitions(PUBLIC "AFF3CT_SYSTEMC_MODULE") - endif() - - find_package(SystemC REQUIRED QUIET) - if(SystemC_FOUND) - message(STATUS "AFF3CT - Library found: SystemC") - aff3ct_target_include_directories2(PUBLIC "${SystemC_INCLUDE_DIRS}") - aff3ct_target_link_libraries(PUBLIC "${SystemC_LIBRARIES}") - endif(SystemC_FOUND) - - find_package(TLM REQUIRED QUIET) - if(TLM_FOUND) - message(STATUS "AFF3CT - Library found: TLM") - aff3ct_target_include_directories2(PUBLIC "${TLM_INCLUDE_DIRS}") - endif(TLM_FOUND) -endif() - # GSL if(AFF3CT_LINK_GSL) aff3ct_target_compile_definitions(PUBLIC "AFF3CT_CHANNEL_GSL") diff --git a/doc/source/user/installation/compilation/compilation.rst b/doc/source/user/installation/compilation/compilation.rst index a631f9190..534671f9b 100644 --- a/doc/source/user/installation/compilation/compilation.rst +++ b/doc/source/user/installation/compilation/compilation.rst @@ -261,10 +261,6 @@ this feature and provides the following options: +-------------------------------+---------+---------+---------------------------------+ | ``AFF3CT_LINK_MKL`` | BOOLEAN | OFF | |cmake-opt-link_mkl| | +-------------------------------+---------+---------+---------------------------------+ -| ``AFF3CT_SYSTEMC_SIMU`` | BOOLEAN | OFF | |cmake-opt-systemc_simu| | -+-------------------------------+---------+---------+---------------------------------+ -| ``AFF3CT_SYSTEMC_MODULE`` | BOOLEAN | OFF | |cmake-opt-systemc_module| | -+-------------------------------+---------+---------+---------------------------------+ | ``AFF3CT_MPI`` | BOOLEAN | OFF | |cmake-opt-mpi| | +-------------------------------+---------+---------+---------------------------------+ | ``AFF3CT_POLAR_BIT_PACKING`` | BOOLEAN | ON | |cmake-opt-polar_bit_packing| | @@ -285,10 +281,6 @@ this feature and provides the following options: channels). .. |cmake-opt-link_mkl| replace:: Link with the MKL library (used in the channels). -.. |cmake-opt-systemc_simu| replace:: Enable the SystemC simulation - (incompatible with the library compilation). -.. |cmake-opt-systemc_module| replace:: Enable the SystemC support (only for the - modules). .. |cmake-opt-mpi| replace:: Enable the MPI support. .. |cmake-opt-polar_bit_packing| replace:: Enable the bit packing technique for Polar code SC decoding. diff --git a/doc/source/user/library/examples.rst b/doc/source/user/library/examples.rst index b3813efbf..a511f3981 100644 --- a/doc/source/user/library/examples.rst +++ b/doc/source/user/library/examples.rst @@ -420,113 +420,15 @@ possible to print debug information by toggling boolean to ``true`` at line .. note:: The full source code is available here: https://github.com/aff3ct/my_project_with_aff3ct/blob/master/examples/tasks/src/main.cpp. -.. _user_library_systemc: - -SystemC/TLM -=========== - -Alternatively, the AFF3CT modules support SystemC/TLM interfaces, -:numref:`lst_systemc_main` highlights the modifications in the ``main`` function -to use standard TLM interfaces. - -.. code-block:: cpp - :caption: SystemC/TLM: main function - :name: lst_systemc_main - :emphasize-lines: 13-18,33-54,59-61,70-72 - :linenos: - - #include - using namespace aff3ct; - - int sc_main(int argc, char** argv) - { - params1 p; init_params1 (p ); // create and initialize the parameters defined by the user - modules1 m; init_modules2(p, m); // create and initialize modules - utils1 u; init_utils1 (m, u); // create and initialize utils - - // display the legend in the terminal - u.terminal->legend(); - - // add a callback to the monitor to call the "sc_core::sc_stop()" function - m.monitor->add_handler_check([&m, &u]() -> void - { - if (m.monitor->fe_limit_achieved()) - sc_core::sc_stop(); - }); - - // loop over the SNRs range - for (auto ebn0 = p.ebn0_min; ebn0 < p.ebn0_max; ebn0 += p.ebn0_step) - { - // compute the current sigma for the channel noise - const auto esn0 = tools::ebn0_to_esn0 (ebn0, p.R); - const auto sigma = tools::esn0_to_sigma(esn0 ); - - u.noise->set_values(sigma, ebn0, esn0); - - // update the sigma of the modem and the channel - m.modem ->set_noise(*u.noise); - m.channel->set_noise(*u.noise); - - // create "sc_core::sc_module" instances for each task - using namespace module; - m.source ->sc.create_module(+src::tsk::generate ); - m.encoder->sc.create_module(+enc::tsk::encode ); - m.modem ->sc.create_module(+mdm::tsk::modulate ); - m.modem ->sc.create_module(+mdm::tsk::demodulate ); - m.channel->sc.create_module(+chn::tsk::add_noise ); - m.decoder->sc.create_module(+dec::tsk::decode_siho ); - m.monitor->sc.create_module(+mnt::tsk::check_errors); - - // declare a SystemC duplicator to duplicate the source 'generate' task output - tools::SC_Duplicator duplicator; - - // bind the sockets between the modules - m.source ->sc[+src::tsk::generate ].s_out[+src::sck::generate ::U_K ](duplicator .s_in ); - duplicator .s_out1 (m.monitor->sc[+mnt::tsk::check_errors].s_in[+mnt::sck::check_errors::U ]); - duplicator .s_out2 (m.encoder->sc[+enc::tsk::encode ].s_in[+enc::sck::encode ::U_K ]); - m.encoder->sc[+enc::tsk::encode ].s_out[+enc::sck::encode ::X_N ](m.modem ->sc[+mdm::tsk::modulate ].s_in[+mdm::sck::modulate ::X_N1]); - m.modem ->sc[+mdm::tsk::modulate ].s_out[+mdm::sck::modulate ::X_N2](m.channel->sc[+chn::tsk::add_noise ].s_in[+chn::sck::add_noise ::X_N ]); - m.channel->sc[+chn::tsk::add_noise ].s_out[+chn::sck::add_noise ::Y_N ](m.modem ->sc[+mdm::tsk::demodulate ].s_in[+mdm::sck::demodulate ::Y_N1]); - m.modem ->sc[+mdm::tsk::demodulate ].s_out[+mdm::sck::demodulate ::Y_N2](m.decoder->sc[+dec::tsk::decode_siho ].s_in[+dec::sck::decode_siho ::Y_N ]); - m.decoder->sc[+dec::tsk::decode_siho].s_out[+dec::sck::decode_siho::V_K ](m.monitor->sc[+mnt::tsk::check_errors].s_in[+mnt::sck::check_errors::V ]); - - // display the performance (BER and FER) in real time (in a separate thread) - u.terminal->start_temp_report(); - - // start the SystemC simulation - sc_core::sc_report_handler::set_actions(sc_core::SC_INFO, sc_core::SC_DO_NOTHING); - sc_core::sc_start(); - - // display the performance (BER and FER) in the terminal - u.terminal->final_report(); - - // reset the monitor and the terminal for the next SNR - m.monitor->reset(); - u.terminal->reset(); - - // dirty way to create a new SystemC simulation context - sc_core::sc_curr_simcontext = new sc_core::sc_simcontext(); - sc_core::sc_default_global_context = sc_core::sc_curr_simcontext; - } - - // display the statistics of the tasks (if enabled) - tools::Stats::show({ m.source.get(), m.encoder.get(), m.modem.get(), m.channel.get(), m.decoder.get(), m.monitor.get() }, true); - - return 0; - } - -.. note:: The full source code is available here: - https://github.com/aff3ct/my_project_with_aff3ct/blob/master/examples/systemc/src/main.cpp. - .. _user_library_factory: Factory ======= -In the previous :ref:`user_library_bootstrap`, :ref:`user_library_tasks` and -:ref:`user_library_systemc` examples, the AFF3CT ``Module`` classes were built -statically in the source code. In the *Factory* example, ``factory`` classes -are used instead, to build modules dynamically from command line arguments. +In the previous :ref:`user_library_bootstrap` and :ref:`user_library_tasks` +examples, the AFF3CT ``Module`` classes were built statically in the source +code. In the *Factory* example, ``factory`` classes are used instead, to build +modules dynamically from command line arguments. .. code-block:: cpp :caption: Factory: main function diff --git a/doc/source/user/simulation/parameters/other/other.rst b/doc/source/user/simulation/parameters/other/other.rst index 2eecf986a..b12f3c357 100644 --- a/doc/source/user/simulation/parameters/other/other.rst +++ b/doc/source/user/simulation/parameters/other/other.rst @@ -116,7 +116,6 @@ Other parameters * MPI: off * GSL: off * MKL: off - * SystemC: off Copyright (c) 2016-2018 - MIT license. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/include/Module/Module.hpp b/include/Module/Module.hpp index f1e798f02..015f909fb 100644 --- a/include/Module/Module.hpp +++ b/include/Module/Module.hpp @@ -15,9 +15,6 @@ #include "Tools/Interface/Interface_clone.hpp" #include "Module/Task.hpp" #include "Module/Socket.hpp" -#ifdef AFF3CT_SYSTEMC_MODULE -#include "Module/SC_Module.hpp" -#endif namespace aff3ct { @@ -43,12 +40,6 @@ class Module : public tools::Interface_clone public: std::vector> tasks; -#ifdef AFF3CT_SYSTEMC_MODULE -#ifndef DOXYGEN_SHOULD_SKIP_THIS - friend SC_Module_container; -#endif - SC_Module_container sc; -#endif /*! * \brief Constructor. diff --git a/include/Module/SC_Module.hpp b/include/Module/SC_Module.hpp deleted file mode 100644 index 05c4ec0bd..000000000 --- a/include/Module/SC_Module.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/*! - * \file - * \brief Classes module::SC_Module, module::SC_Socket_in, module::SC_Socket_out and module::SC_Module_container. - */ -#ifdef AFF3CT_SYSTEMC_MODULE - -#ifndef SC_MODULE_HPP_ -#define SC_MODULE_HPP_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "Module/Task.hpp" - -// convert strongly typed enum to integer -template -constexpr typename std::underlying_type::type operator+(E e) noexcept; - -namespace aff3ct -{ -namespace module -{ -class SC_Module; - -template -class SC_Socket_in -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - friend SC_Module; -#endif -protected: - std::vector>> &sockets; - const Task &task; - const std::vector &indirect_sockets; - - SC_Socket_in(std::vector>> &sockets, - const Task &task, const std::vector &indirect_sockets); -public: - virtual ~SC_Socket_in() = default; - inline tlm_utils::simple_target_socket& operator[](const int id); -}; - -template -class SC_Socket_out -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - friend SC_Module; -#endif -protected: - std::vector>> &sockets; - const Task &task; - const std::vector &indirect_sockets; - - SC_Socket_out(std::vector>> &sockets, - const Task &task, const std::vector &indirect_sockets); -public: - virtual ~SC_Socket_out() = default; - inline tlm_utils::simple_initiator_socket& operator[](const int id); -}; - -class SC_Module : public sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Module); // required because of the "SC_THREAD" call in the constructor - -protected: - Task &task; - - std::vector>> sockets_in; - std::vector>> sockets_out; - - std::vector> ptr_input_sockets; - - std::vector indirect_sockets_in; - std::vector indirect_sockets_out; - - std::vector indirect_sockets_in_rev; - std::vector indirect_sockets_out_rev; - -public: - SC_Socket_in s_in; - SC_Socket_out s_out; - - SC_Module(Task &task, sc_core::sc_module_name sc_name); - virtual ~SC_Module() = default; - -protected: - void b_transport (tlm::tlm_generic_payload& trans, sc_core::sc_time& t, Socket &socket); - void b_transport_and_exec(tlm::tlm_generic_payload& trans, sc_core::sc_time& t, Socket &socket); - void start_sc_thread(); - - void b_transport1(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport2(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport3(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport4(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport5(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport6(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport7(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); - void b_transport8(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; - -class SC_Module_container -{ -#ifndef DOXYGEN_SHOULD_SKIP_THIS - friend Module; -#endif -protected: - Module *module; - std::vector> sc_modules; - -public: - explicit SC_Module_container(Module &module); - virtual ~SC_Module_container() = default; - - void create_module(const int id); - void erase_module(const int id); - inline SC_Module& operator[](const int id); -}; -} -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#include "Module/SC_Module.hxx" -#endif - -#endif /* SC_MODULE_HPP_ */ - -#endif diff --git a/include/Module/SC_Module.hxx b/include/Module/SC_Module.hxx deleted file mode 100644 index 973375b99..000000000 --- a/include/Module/SC_Module.hxx +++ /dev/null @@ -1,49 +0,0 @@ -#include "Module/SC_Module.hpp" - -// convert strongly typed enum to integer -template -constexpr typename std::underlying_type::type operator+(E e) noexcept { - return static_cast::type>(e); -} - -namespace aff3ct -{ -namespace module -{ -template -SC_Socket_in -::SC_Socket_in(std::vector>> &sockets, const Task &task, - const std::vector &indirect_sockets) -: sockets(sockets), task(task), indirect_sockets(indirect_sockets) -{ -} - -template -tlm_utils::simple_target_socket& SC_Socket_in -::operator[](const int id) -{ - return *sockets[indirect_sockets[id]]; -} - -template -SC_Socket_out -::SC_Socket_out(std::vector>> &sockets, const Task &task, - const std::vector &indirect_sockets) -: sockets(sockets), task(task), indirect_sockets(indirect_sockets) -{ -} - -template -tlm_utils::simple_initiator_socket& SC_Socket_out -::operator[](const int id) -{ - return *sockets[indirect_sockets[id]]; -} - -SC_Module& SC_Module_container -::operator[](const int id) -{ - return *sc_modules[id]; -} -} -} diff --git a/include/Tools/SystemC/SC_Debug.hpp b/include/Tools/SystemC/SC_Debug.hpp deleted file mode 100644 index 86d5a27cf..000000000 --- a/include/Tools/SystemC/SC_Debug.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Debug. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_DEBUG_HPP_ -#define SC_DEBUG_HPP_ - -#include -#include -#include -#include -#include - -namespace aff3ct -{ -namespace tools -{ -template -class SC_Debug : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Debug); - -public: - tlm_utils::simple_target_socket s_in; - tlm_utils::simple_initiator_socket s_out; - -private: - std::string message; - const int debug_limit; - -public: - SC_Debug(const std::string &message = std::string("Debug:\n"), const int debug_limit = 0, - sc_core::sc_module_name name = "SC_Debug"); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -#include "Tools/SystemC/SC_Debug.hxx" -#endif - -#endif /* SC_DEBUG_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/Tools/SystemC/SC_Debug.hxx b/include/Tools/SystemC/SC_Debug.hxx deleted file mode 100644 index 2b858d660..000000000 --- a/include/Tools/SystemC/SC_Debug.hxx +++ /dev/null @@ -1,48 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include -#include -#include -#include - -#include "Tools/Display/Frame_trace/Frame_trace.hpp" -#include "Tools/SystemC/SC_Debug.hpp" - -namespace aff3ct -{ -namespace tools -{ -template -SC_Debug -::SC_Debug(const std::string &message, const int debug_limit, sc_core::sc_module_name name) -: sc_module(name), s_in("s_in"), s_out("s_out"), message(message), debug_limit(debug_limit) -{ - s_in.register_b_transport(this, &SC_Debug::b_transport); -} - -template -void SC_Debug -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - T* buffer = (T*)trans.get_data_ptr(); - int length = trans.get_data_length() / sizeof(T); - - std::vector data_in(length); - std::copy(buffer, buffer + length, data_in.begin()); - - // display input data - Frame_trace ft(debug_limit); - std::cout << message; - if (typeid(T) == typeid(float) || typeid(T) == typeid(double)) - ft.display_real_vector(data_in); - else - ft.display_bit_vector(data_in); - std::cout << std::endl; - - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - s_out->b_transport(trans, zero_time); -} -} -} - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/Tools/SystemC/SC_Dummy.hpp b/include/Tools/SystemC/SC_Dummy.hpp deleted file mode 100644 index 1c7bc06c4..000000000 --- a/include/Tools/SystemC/SC_Dummy.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Dummy. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_DUMMY_HPP_ -#define SC_DUMMY_HPP_ - -#include -#include -#include - -namespace aff3ct -{ -namespace tools -{ -class SC_Dummy : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Dummy); - -public: - tlm_utils::simple_target_socket s_in; - -public: - explicit SC_Dummy(sc_core::sc_module_name name); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#endif /* SC_DUMMY_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/Tools/SystemC/SC_Duplicator.hpp b/include/Tools/SystemC/SC_Duplicator.hpp deleted file mode 100644 index 56eacc5ea..000000000 --- a/include/Tools/SystemC/SC_Duplicator.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Duplicator. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_DUPLICATOR_HPP_ -#define SC_DUPLICATOR_HPP_ - -#include -#include -#include -#include - -namespace aff3ct -{ -namespace tools -{ -class SC_Duplicator : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Duplicator); - -public: - using SI_t = tlm_utils::simple_target_socket ; - using SO_t = tlm_utils::simple_initiator_socket; - - SI_t s_in; - SO_t s_out1; - SO_t s_out2; - - explicit SC_Duplicator(sc_core::sc_module_name name = "SC_Duplicator"); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#endif /* SC_DUPLICATOR_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/Tools/SystemC/SC_Funnel.hpp b/include/Tools/SystemC/SC_Funnel.hpp deleted file mode 100644 index bb27611ec..000000000 --- a/include/Tools/SystemC/SC_Funnel.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Funnel. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_FUNNEL_HPP_ -#define SC_FUNNEL_HPP_ - -#include -#include -#include -#include - -namespace aff3ct -{ -namespace tools -{ -class SC_Funnel : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Funnel); - -public: - tlm_utils::simple_target_socket s_in1; - tlm_utils::simple_target_socket s_in2; - tlm_utils::simple_initiator_socket s_out; - -public: - SC_Funnel(sc_core::sc_module_name name = "SC_Double_input"); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#endif /* SC_FUNNEL_HPP_ */ - -#endif /* AFF3CT_SYSTEMC */ diff --git a/include/Tools/SystemC/SC_Predicate.hpp b/include/Tools/SystemC/SC_Predicate.hpp deleted file mode 100644 index 6fec7deea..000000000 --- a/include/Tools/SystemC/SC_Predicate.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Predicate. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_PREDICATE_HPP_ -#define SC_PREDICATE_HPP_ - -#include -#include -#include - -#include "Tools/Algo/Predicate.hpp" - -namespace aff3ct -{ -namespace tools -{ -class SC_Predicate : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Predicate); - -public: - tlm_utils::simple_target_socket s_in; - -private: - Predicate &p; - -public: - SC_Predicate(Predicate &p, sc_core::sc_module_name name); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#endif /* SC_PREDICATE_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/Tools/SystemC/SC_Router.hpp b/include/Tools/SystemC/SC_Router.hpp deleted file mode 100644 index db1fee846..000000000 --- a/include/Tools/SystemC/SC_Router.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/*! - * \file - * \brief Class tools::SC_Router. - */ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#ifndef SC_ROUTER_HPP_ -#define SC_ROUTER_HPP_ - -#include -#include -#include -#include - -#include "Tools/Algo/Predicate.hpp" - -namespace aff3ct -{ -namespace tools -{ -class SC_Router : sc_core::sc_module -{ - SC_HAS_PROCESS(SC_Router); - -public: - tlm_utils::simple_target_socket s_in; - tlm_utils::simple_initiator_socket s_out1; - tlm_utils::simple_initiator_socket s_out2; - -private: - Predicate &p; - -public: - SC_Router(Predicate &p, sc_core::sc_module_name name = "SC_Router"); - -private: - void b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t); -}; -} -} - -#endif /* SC_ROUTER_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/include/aff3ct.hpp b/include/aff3ct.hpp index ba85587f3..c20a649fc 100644 --- a/include/aff3ct.hpp +++ b/include/aff3ct.hpp @@ -801,9 +801,6 @@ #ifndef ROUTER_HPP_ #include #endif -#ifndef SC_MODULE_HPP_ -#include -#endif #ifndef SINK_NO_HPP #include #endif @@ -1446,24 +1443,6 @@ #ifndef SEQUENCE_HPP_ #include #endif -#ifndef SC_DEBUG_HPP_ -#include -#endif -#ifndef SC_DUMMY_HPP_ -#include -#endif -#ifndef SC_DUPLICATOR_HPP_ -#include -#endif -#ifndef SC_FUNNEL_HPP_ -#include -#endif -#ifndef SC_PREDICATE_HPP_ -#include -#endif -#ifndef SC_ROUTER_HPP_ -#include -#endif #ifndef THREAD_PINNING_HPP #include #endif diff --git a/src/Factory/Simulation/BFER/BFER.cpp b/src/Factory/Simulation/BFER/BFER.cpp index f51718d2e..4d9a4da50 100644 --- a/src/Factory/Simulation/BFER/BFER.cpp +++ b/src/Factory/Simulation/BFER/BFER.cpp @@ -153,10 +153,7 @@ ::store(const cli::Argument_map_value &vals) { using namespace std::chrono; -#if !defined(AFF3CT_SYSTEMC_SIMU) this->n_threads = std::thread::hardware_concurrency() ? std::thread::hardware_concurrency() : 1; -#endif - Simulation::store(vals); auto p = this->get_prefix(); diff --git a/src/Factory/Simulation/BFER/BFER_ite.cpp b/src/Factory/Simulation/BFER/BFER_ite.cpp index 26d2a8001..33e879b7d 100644 --- a/src/Factory/Simulation/BFER/BFER_ite.cpp +++ b/src/Factory/Simulation/BFER/BFER_ite.cpp @@ -2,7 +2,6 @@ #include "Tools/Exception/exception.hpp" #include "Tools/Documentation/documentation.h" -#include "Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp" #include "Simulation/Legacy/BFER/Iterative/Threads/BFER_ite_threads.hpp" #include "Simulation/Sequence/BFER/Iterative/Simulation_sequence_BFER_ite.hpp" #include "Factory/Simulation/BFER/BFER_ite.hpp" @@ -152,14 +151,10 @@ template simulation::Simulation* BFER_ite ::build() const { -#if defined(AFF3CT_SYSTEMC_SIMU) - return new simulation::SC_BFER_ite(*this); -#else if (this->sequence_threads) return new simulation::Simulation_sequence_BFER_ite(*this); else return new simulation::BFER_ite_threads(*this); -#endif } // ==================================================================================== explicit template instantiation diff --git a/src/Factory/Simulation/BFER/BFER_std.cpp b/src/Factory/Simulation/BFER/BFER_std.cpp index bb9e7eff5..d30a7f16f 100644 --- a/src/Factory/Simulation/BFER/BFER_std.cpp +++ b/src/Factory/Simulation/BFER/BFER_std.cpp @@ -1,4 +1,3 @@ -#include "Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp" #include "Simulation/Legacy/BFER/Standard/Threads/BFER_std_threads.hpp" #include "Simulation/Sequence/BFER/Standard/Simulation_sequence_BFER_std.hpp" #include "Factory/Simulation/BFER/BFER_std.hpp" @@ -63,14 +62,10 @@ template simulation::Simulation* BFER_std ::build() const { -#if defined(AFF3CT_SYSTEMC_SIMU) - return new simulation::SC_BFER_std(*this); -#else if (this->sequence_threads) return new simulation::Simulation_sequence_BFER_std(*this); else return new simulation::BFER_std_threads(*this); -#endif } // ==================================================================================== explicit template instantiation diff --git a/src/Factory/Simulation/EXIT/EXIT.cpp b/src/Factory/Simulation/EXIT/EXIT.cpp index a0370a721..68703b124 100644 --- a/src/Factory/Simulation/EXIT/EXIT.cpp +++ b/src/Factory/Simulation/EXIT/EXIT.cpp @@ -198,13 +198,7 @@ template simulation::Simulation* EXIT ::build() const { -#if defined(AFF3CT_SYSTEMC_SIMU) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "SystemC/TLM simulation is not available."); -#else return new simulation::EXIT(*this); -#endif - - throw tools::cannot_allocate(__FILE__, __LINE__, __func__); } // ==================================================================================== explicit template instantiation diff --git a/src/Launcher/Simulation/EXIT.cpp b/src/Launcher/Simulation/EXIT.cpp index 302c3a017..1f4a44047 100644 --- a/src/Launcher/Simulation/EXIT.cpp +++ b/src/Launcher/Simulation/EXIT.cpp @@ -110,11 +110,7 @@ template simulation::Simulation* EXIT ::build_simu() { -#if !defined(AFF3CT_SYSTEMC_SIMU) return params.build(); -#else - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "SystemC/TLM simulation is not available."); -#endif } // ==================================================================================== explicit template instantiation diff --git a/src/Module/Module.cpp b/src/Module/Module.cpp index e50ab23dc..c00cc8602 100644 --- a/src/Module/Module.cpp +++ b/src/Module/Module.cpp @@ -16,9 +16,6 @@ ::Module() single_wave(false), name("Module"), short_name("Module") -#ifdef AFF3CT_SYSTEMC_MODULE -, sc(*this) -#endif { } @@ -40,14 +37,6 @@ ::deep_copy(const Module &m) this->tasks.push_back(std::move(t_new)); } } - -#ifdef AFF3CT_SYSTEMC_MODULE - this->sc.module = this; - this->sc.sc_modules.clear(); - for (size_t i = 0; i < m.sc.sc_modules.size(); i++) - if (m.sc.sc_modules[i] != nullptr) - this->sc.create_module(i); -#endif } Module* Module @@ -96,12 +85,6 @@ ::_set_n_frames_per_wave(const size_t n_frames_per_wave) void Module ::set_n_frames(const size_t n_frames) { -#ifdef AFF3CT_SYSTEMC_MODULE - std::stringstream message; - message << "'This feature is not supported with the SystemC/TLM interface."; - throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); -#endif - if (this->get_n_frames() != n_frames) this->_set_n_frames(n_frames); @@ -112,12 +95,6 @@ ::set_n_frames(const size_t n_frames) void Module ::set_n_frames_per_wave(const size_t n_frames_per_wave) { -#ifdef AFF3CT_SYSTEMC_MODULE - std::stringstream message; - message << "'This feature is not supported with the SystemC/TLM interface."; - throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); -#endif - if (this->get_n_frames_per_wave() != n_frames_per_wave) this->_set_n_frames_per_wave(n_frames_per_wave); @@ -128,12 +105,6 @@ ::set_n_frames_per_wave(const size_t n_frames_per_wave) void Module ::set_single_wave(const bool enable_single_wave) { -#ifdef AFF3CT_SYSTEMC_MODULE - std::stringstream message; - message << "'This feature is not supported with the SystemC/TLM interface."; - throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); -#endif - this->single_wave = enable_single_wave; this->set_n_frames (this->n_frames); this->set_n_frames_per_wave(this->n_frames); diff --git a/src/Module/SC_Module.cpp b/src/Module/SC_Module.cpp deleted file mode 100644 index 630a48e09..000000000 --- a/src/Module/SC_Module.cpp +++ /dev/null @@ -1,295 +0,0 @@ -#ifdef AFF3CT_SYSTEMC_MODULE - -#include - -#include "Tools/Exception/exception.hpp" -#include "Tools/general_utils.h" -#include "Module/Module.hpp" -#include "Module/SC_Module.hpp" - -using namespace aff3ct; -using namespace aff3ct::module; - -SC_Module -::SC_Module(Task &task, sc_core::sc_module_name sc_name) -: sc_module(sc_name), - task(task), - indirect_sockets_in (task.sockets.size()), - indirect_sockets_out(task.sockets.size()), - s_in (sockets_in, task, indirect_sockets_in), - s_out(sockets_out, task, indirect_sockets_out) -{ - task.set_autoalloc(true); - - auto is_inputs = false; - for (auto& s : task.sockets) - if (task.get_socket_type(*s) == socket_t::SIN || task.get_socket_type(*s) == socket_t::SIN_SOUT) - { - is_inputs = true; - break; - } - - for (size_t i = 0; i < task.sockets.size(); i++) - { - auto& s = task.sockets[i]; - auto name = s->get_name(); - - const auto id_in = (int)sockets_in.size(); - const auto id_out = (int)sockets_out.size(); - switch (task.get_socket_type(*s)) - { - case socket_t::SIN: - indirect_sockets_in[i] = id_in; - indirect_sockets_in_rev.push_back(i); - sockets_in.push_back(std::unique_ptr>( - new tlm_utils::simple_target_socket(name.c_str()))); - ptr_input_sockets.push_back(s); - switch (ptr_input_sockets.size()) - { - case 1: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport1); break; - case 2: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport2); break; - case 3: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport3); break; - case 4: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport4); break; - case 5: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport5); break; - case 6: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport6); break; - case 7: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport7); break; - case 8: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport8); break; - default: - throw tools::runtime_error(__FILE__, __LINE__, __func__, "This should never happen."); - break; - } - break; - - case socket_t::SOUT: - if (name != "status") - { - indirect_sockets_out[i] = id_out; - indirect_sockets_out_rev.push_back(i); - sockets_out.push_back(std::unique_ptr>( - new tlm_utils::simple_initiator_socket(name.c_str()))); - if (!is_inputs) - SC_THREAD(start_sc_thread); - } - break; - - case socket_t::SIN_SOUT: - indirect_sockets_in[i] = id_in; - indirect_sockets_in_rev.push_back(i); - sockets_in.push_back(std::unique_ptr>( - new tlm_utils::simple_target_socket(name.c_str()))); - ptr_input_sockets.push_back(s); - switch (ptr_input_sockets.size()) - { - case 1: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport1); break; - case 2: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport2); break; - case 3: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport3); break; - case 4: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport4); break; - case 5: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport5); break; - case 6: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport6); break; - case 7: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport7); break; - case 8: sockets_in[id_in]->register_b_transport(this, &SC_Module::b_transport8); break; - default: - throw tools::runtime_error(__FILE__, __LINE__, __func__, "This should never happen."); - break; - } - indirect_sockets_out[i] = id_out; - indirect_sockets_out_rev.push_back(i); - sockets_out.push_back(std::unique_ptr>( - new tlm_utils::simple_initiator_socket(name.c_str()))); - break; - - default: - throw tools::runtime_error(__FILE__, __LINE__, __func__, "This should never happen."); - break; - } - } -} - -void SC_Module -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t, Socket &socket) -{ - if (trans.get_data_length() != socket.get_databytes()) - { - std::stringstream message; - message << "'trans.get_data_length()' has to be equal to 'socket.->databytes' (" - << "'trans.get_data_length()' = " << trans.get_data_length() - << ", 'socket.->databytes' = " << socket.get_databytes() - << ", 'socket.->name' = " << socket.get_name() - << ", 'task.name' = " << task.get_name() - << ", 'task.module.name' = " << task.get_module().get_name() << ")."; - throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str()); - } - - if (trans.get_data_ptr() == nullptr) - { - std::stringstream message; - message << "'trans.get_data_ptr()' can't be NULL."; - throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str()); - } - - socket.bind((void*)trans.get_data_ptr()); -} - -void SC_Module -::b_transport_and_exec(tlm::tlm_generic_payload& trans, sc_core::sc_time& t, Socket &socket) -{ - b_transport(trans, t, socket); - - task.exec(); - - for (size_t i = 0; i < sockets_out.size(); i++) - { - auto &s = *sockets_out[i]; - auto &ts = task[indirect_sockets_out_rev[i]]; - - tlm::tlm_generic_payload payload; - payload.set_data_ptr((uint8_t*)ts.get_dataptr()); - payload.set_data_length(ts.get_databytes()); - - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - s->b_transport(payload, zero_time); - } -} - -void SC_Module -::b_transport1(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 1) b_transport_and_exec(trans, t, *ptr_input_sockets[0]); - else b_transport (trans, t, *ptr_input_sockets[0]); -} - -void SC_Module -::b_transport2(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 2) b_transport_and_exec(trans, t, *ptr_input_sockets[1]); - else b_transport (trans, t, *ptr_input_sockets[1]); -} - -void SC_Module -::b_transport3(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 3) b_transport_and_exec(trans, t, *ptr_input_sockets[2]); - else b_transport (trans, t, *ptr_input_sockets[2]); -} - -void SC_Module -::b_transport4(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 4) b_transport_and_exec(trans, t, *ptr_input_sockets[3]); - else b_transport (trans, t, *ptr_input_sockets[3]); -} - -void SC_Module -::b_transport5(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 5) b_transport_and_exec(trans, t, *ptr_input_sockets[4]); - else b_transport (trans, t, *ptr_input_sockets[4]); -} - -void SC_Module -::b_transport6(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 6) b_transport_and_exec(trans, t, *ptr_input_sockets[5]); - else b_transport (trans, t, *ptr_input_sockets[5]); -} - -void SC_Module -::b_transport7(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 7) b_transport_and_exec(trans, t, *ptr_input_sockets[6]); - else b_transport (trans, t, *ptr_input_sockets[6]); -} - -void SC_Module -::b_transport8(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - if (ptr_input_sockets.size() == 8) b_transport_and_exec(trans, t, *ptr_input_sockets[7]); - else b_transport (trans, t, *ptr_input_sockets[7]); -} - -void SC_Module -::start_sc_thread() -{ - // infinite loop, can be stopped by calling 'sc_core::sc_stop()' - while (true) - { - if (task.is_debug()) - { - if (!task.get_n_calls()) - std::cout << "#" << std::endl; - - std::cout << "# -------------------------------" << std::endl; - std::cout << "# New communication (n°" << task.get_n_calls() << ")" << std::endl; - std::cout << "# -------------------------------" << std::endl; - std::cout << "#" << std::endl; - } - - task.exec(); - - for (size_t i = 0; i < sockets_out.size(); i++) - { - auto &s = *sockets_out[i]; - auto &ts = task[indirect_sockets_out_rev[i]]; - - tlm::tlm_generic_payload payload; - payload.set_data_ptr((uint8_t*)ts.get_dataptr()); - payload.set_data_length(ts.get_databytes()); - - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - s->b_transport(payload, zero_time); - } - - // required to give the hand to the SystemC scheduler (yield) - sc_core::wait(0, sc_core::SC_MS); - } -} - - - -SC_Module_container -::SC_Module_container(Module &module) -: module(&module), sc_modules() -{ -} - -void SC_Module_container -::create_module(const int id) -{ - if (module->tasks_with_nullptr.size() != sc_modules.size()) - { - sc_modules.resize(module->tasks_with_nullptr.size()); - fill(sc_modules.begin(), sc_modules.end(), nullptr); - } - - if ((size_t)id < sc_modules.size()) - { - if (sc_modules[id] != nullptr) - erase_module(id); - - const std::string module_name = module->get_custom_name().empty() ? module->get_name() : module->get_custom_name(); - sc_modules[id] = std::shared_ptr(new SC_Module((*module)[id], (module_name + "::" + (*module)[id].get_name()).c_str())); - } - else - { - std::stringstream message; - message << "'id' does not exist ('id' = " << id << ", 'module.name' = " << module->get_name() << ")."; - throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); - } -} - -void SC_Module_container -::erase_module(const int id) -{ - if ((size_t)id < sc_modules.size() && sc_modules[id] != nullptr) - { - sc_modules[id] = nullptr; - } - else - { - std::stringstream message; - message << "'id' does not exist ('id' = " << id << ", 'module.name' = " << module->get_name() << ")."; - throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str()); - } -} - -#endif diff --git a/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.cpp b/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.cpp deleted file mode 100644 index 9c084fb05..000000000 --- a/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.cpp +++ /dev/null @@ -1,271 +0,0 @@ -#ifdef AFF3CT_SYSTEMC_SIMU - -#include - -#include "Factory/Module/Coset/Coset.hpp" -#include "Tools/Exception/exception.hpp" -#include "Tools/Algo/Predicate_ite.hpp" -#include "Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp" - -using namespace aff3ct; -using namespace aff3ct::simulation; - -template -SC_BFER_ite -::SC_BFER_ite(const factory::BFER_ite ¶ms_BFER_ite) -: BFER_ite(params_BFER_ite), - duplicator(7) -{ - if (this->params_BFER_ite.n_threads > 1) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "SystemC simulation does not support " - "multi-threading."); - - if (params_BFER_ite.coded_monitoring) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "SystemC simulation does not support the coded " - "monitoring."); -} - -template -void SC_BFER_ite -::__build_communication_chain(const int tid) -{ - BFER_ite::__build_communication_chain(tid); - - this->interleaver_bit [tid]->set_custom_name(this->interleaver_llr1[tid]->get_name() + "_bit"); - this->interleaver_llr1[tid]->set_custom_name(this->interleaver_llr1[tid]->get_name() + "_llr"); - - this->monitor_er[tid]->record_callback_check([&]() -> void - { - if (!this->keep_looping_noise_point()) // will make the MPI communication - sc_core::sc_stop(); - }); -} - -template -void SC_BFER_ite -::create_sc_modules() -{ - using namespace module; - const auto tid = 0; - - // create the sc_module inside the objects of the communication chain - this->source [tid] ->sc.create_module(+src::tsk::generate ); - this->crc [tid] ->sc.create_module(+crc::tsk::build ); - this->codec1 [tid]->get_encoder() .sc.create_module(+enc::tsk::encode ); - this->interleaver_bit[tid] ->sc.create_module(+itl::tsk::interleave); - this->modem1 [tid] ->sc.create_module(+mdm::tsk::modulate ); - this->modem1 [tid] ->sc.create_module(+mdm::tsk::filter ); - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) - { - this->channel[tid]->sc.create_module(+chn::tsk::add_noise_wg ); - this->modem1 [tid]->sc.create_module(+mdm::tsk::demodulate_wg ); - this->modem1 [tid]->sc.create_module(+mdm::tsk::tdemodulate_wg); - } - else - { - this->channel[tid]->sc.create_module(+chn::tsk::add_noise ); - this->modem1 [tid]->sc.create_module(+mdm::tsk::demodulate ); - this->modem1 [tid]->sc.create_module(+mdm::tsk::tdemodulate); - } - this->interleaver_llr1[tid] ->sc.create_module(+itl::tsk::interleave ); - this->quantizer [tid] ->sc.create_module(+qnt::tsk::process ); - this->interleaver_llr1[tid] ->sc.create_module(+itl::tsk::deinterleave); - this->codec1 [tid]->get_decoder_siho() .sc.create_module(+dec::tsk::decode_siho ); - this->codec1 [tid]->get_decoder_siso() .sc.create_module(+dec::tsk::decode_siso ); - this->monitor_er [tid] ->sc.create_module(+mnt::tsk::check_errors); - - if (this->params_BFER_ite.coset) - { - this->coset_real1[tid]->sc.create_module(+cst::tsk::apply); - this->coset_real2[tid]->sc.create_module(+cst::tsk::apply); - this->coset_bit [tid]->sc.create_module(+cst::tsk::apply); - } - this->crc[tid]->sc.create_module(+crc::tsk::extract); -} - -template -void SC_BFER_ite -::_launch() -{ - this->create_sc_modules(); - - tools::Predicate_ite p(this->params_BFER_ite.n_ite); - - this->duplicator[0].reset( new tools::SC_Duplicator("Duplicator0")); - this->duplicator[1].reset( new tools::SC_Duplicator("Duplicator1")); - this->duplicator[5].reset( new tools::SC_Duplicator("Duplicator5")); - if (this->params_BFER_ite.coset) - { - this->duplicator[2].reset( new tools::SC_Duplicator("Duplicator2")); - this->duplicator[3].reset( new tools::SC_Duplicator("Duplicator3")); - this->duplicator[4].reset( new tools::SC_Duplicator("Duplicator4")); - } - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) - { - this->duplicator[6].reset( new tools::SC_Duplicator("Duplicator6")); - } - - this->router .reset( new tools::SC_Router (p, "Router" )); - this->funnel .reset( new tools::SC_Funnel ( "Funnel" )); - this->predicate.reset( new tools::SC_Predicate(p, "Predicate")); - - this->bind_sockets(); - sc_core::sc_report_handler::set_actions(sc_core::SC_INFO, sc_core::SC_DO_NOTHING); - sc_core::sc_start(); // start simulation - - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // /!\ VERY DIRTY WAY TO CREATE A NEW SIMULATION CONTEXT IN SYSTEMC, BE CAREFUL THIS IS NOT IN THE STD! /!\ // - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - sc_core::sc_curr_simcontext = new sc_core::sc_simcontext(); - sc_core::sc_default_global_context = sc_core::sc_curr_simcontext; -} - -template -void SC_BFER_ite -::bind_sockets() -{ - auto &dp0 = *this->duplicator[0]; - auto &dp1 = *this->duplicator[1]; - auto &dp5 = *this->duplicator[5]; - - auto &rtr = *this->router; - auto &fnl = *this->funnel; - auto &prd = *this->predicate; - - auto &src = *this->source [0]; - auto &crc = *this->crc [0]; - auto &enc = this->codec1 [0]->get_encoder(); - auto &itb = *this->interleaver_bit [0]; - auto &itl = *this->interleaver_llr1[0]; - auto &mdm = *this->modem1 [0]; - auto &chn = *this->channel [0]; - auto &qnt = *this->quantizer [0]; - auto &csr = *this->coset_real1 [0]; - auto &csi = *this->coset_real2 [0]; - auto &dch = this->codec1 [0]->get_decoder_siho(); - auto &dcs = this->codec1 [0]->get_decoder_siso(); - auto &csb = *this->coset_bit [0]; - auto &mnt = *this->monitor_er [0]; - - using namespace module; - if (this->params_BFER_ite.coset) - { - auto &dp2 = *this->duplicator[2]; - auto &dp3 = *this->duplicator[3]; - auto &dp4 = *this->duplicator[4]; - - src.sc [+src::tsk::generate ].s_out [+src::sck::generate ::U_K ](dp0 .s_in ); - dp0 .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in [+mnt::sck::check_errors ::U ]); - dp0 .s_out2 (crc.sc[+crc::tsk::build ].s_in [+crc::sck::build ::U_K1]); - crc.sc [+crc::tsk::build ].s_out [+crc::sck::build ::U_K2](dp2 .s_in ); - dp2 .s_out1 (csb.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::ref ]); - dp2 .s_out2 (enc.sc[+enc::tsk::encode ].s_in [+enc::sck::encode ::U_K ]); - enc.sc [+enc::tsk::encode ].s_out [+enc::sck::encode ::X_N ](dp3 .s_in ); - dp3 .s_out1 (dp4 .s_in ); - dp4 .s_out1 (csr.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::ref ]); - dp4 .s_out2 (csi.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::ref ]); - dp3 .s_out2 (itb.sc[+itl::tsk::interleave ].s_in [+itl::sck::interleave ::nat ]); - itb.sc [+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::modulate ].s_in [+mdm::sck::modulate ::X_N1]); - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) { - auto &dp6 = *this->duplicator[6]; - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise_wg ].s_in [+chn::sck::add_noise_wg ::X_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::H_N ](dp6 .s_in ); - dp6 .s_out1 (mdm.sc[+mdm::tsk::demodulate_wg ].s_in [+mdm::sck::demodulate_wg ::H_N ]); - dp6 .s_out2 (mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in [+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in [+qnt::sck::process ::Y_N1]); - qnt.sc[+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](dp5 .s_in ); - dp5 .s_out1 (mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::Y_N1]); - dp5 .s_out2 (mdm.sc[+mdm::tsk::demodulate_wg ].s_in [+mdm::sck::demodulate_wg ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg ].s_out [+mdm::sck::demodulate_wg ::Y_N2](fnl .s_in1 ); - } else { - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_in [+chn::sck::add_noise ::X_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in [+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in [+qnt::sck::process ::Y_N1]); - qnt.sc[+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](dp5 .s_in ); - dp5 .s_out1 (mdm.sc[+mdm::tsk::tdemodulate ].s_in [+mdm::sck::tdemodulate ::Y_N1]); - dp5 .s_out2 (mdm.sc[+mdm::tsk::demodulate ].s_in [+mdm::sck::demodulate ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate ].s_out [+mdm::sck::demodulate ::Y_N2](fnl .s_in1 ); - } - fnl .s_out (itl.sc[+itl::tsk::deinterleave ].s_in [+itl::sck::deinterleave ::itl ]); - itl.sc [+itl::tsk::deinterleave ].s_out [+itl::sck::deinterleave ::nat ](csr.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::in ]); - csr.sc [+cst::tsk::apply ].s_out [+cst::sck::apply ::out ](rtr .s_in ); - rtr .s_out1 (dcs.sc[+dec::tsk::decode_siso ].s_in [+dec::sck::decode_siso ::Y_N1]); - rtr .s_out2 (dch.sc[+dec::tsk::decode_siho ].s_in [+dec::sck::decode_siho ::Y_N ]); - dcs.sc [+dec::tsk::decode_siso ].s_out [+dec::sck::decode_siso ::Y_N2](csi.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::in ]); - csi.sc [+cst::tsk::apply ].s_out [+cst::sck::apply ::out ](itl.sc[+itl::tsk::interleave ].s_in [+itl::sck::interleave ::nat ]); - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) { - itl.sc[+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::Y_N2]); - mdm.sc[+mdm::tsk::tdemodulate_wg].s_out [+mdm::sck::tdemodulate_wg::Y_N3](fnl .s_in2 ); - } else { - itl.sc[+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::tdemodulate ].s_in [+mdm::sck::tdemodulate ::Y_N2]); - mdm.sc[+mdm::tsk::tdemodulate ].s_out [+mdm::sck::tdemodulate ::Y_N3](fnl .s_in2 ); - } - dch.sc [+dec::tsk::decode_siho ].s_out [+dec::sck::decode_siho ::V_K ](csb.sc[+cst::tsk::apply ].s_in [+cst::sck::apply ::in ]); - csb.sc [+cst::tsk::apply ].s_out [+cst::sck::apply ::out ](crc.sc[+crc::tsk::extract ].s_in [+crc::sck::extract ::V_K1]); - crc.sc [+crc::tsk::extract ].s_out [+crc::sck::extract ::V_K2](dp1 .s_in ); - dp1 .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in [+mnt::sck::check_errors ::V ]); - dp1 .s_out2 (prd .s_in ); - } - else // standard simulation - { - src.sc [+src::tsk::generate ].s_out [+src::sck::generate ::U_K ](dp0 .s_in ); - dp0 .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in [+mnt::sck::check_errors ::U ]); - dp0 .s_out2 (crc.sc[+crc::tsk::build ].s_in [+crc::sck::build ::U_K1]); - crc.sc [+crc::tsk::build ].s_out [+crc::sck::build ::U_K2](enc.sc[+enc::tsk::encode ].s_in [+enc::sck::encode ::U_K ]); - enc.sc [+enc::tsk::encode ].s_out [+enc::sck::encode ::X_N ](itb.sc[+itl::tsk::interleave ].s_in [+itl::sck::interleave ::nat ]); - itb.sc [+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::modulate ].s_in [+mdm::sck::modulate ::X_N1]); - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) { - auto &dp6 = *this->duplicator[6]; - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise_wg ].s_in [+chn::sck::add_noise_wg ::X_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::H_N ](dp6 .s_in ); - dp6 .s_out1 (mdm.sc[+mdm::tsk::demodulate_wg ].s_in [+mdm::sck::demodulate_wg ::H_N ]); - dp6 .s_out2 (mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in [+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in [+qnt::sck::process ::Y_N1]); - qnt.sc[+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](dp5 .s_in ); - dp5 .s_out1 (mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::Y_N1]); - dp5 .s_out2 (mdm.sc[+mdm::tsk::demodulate_wg ].s_in [+mdm::sck::demodulate_wg ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg ].s_out [+mdm::sck::demodulate_wg ::Y_N2](fnl .s_in1 ); - } else { - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_in [+chn::sck::add_noise ::X_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in [+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in [+qnt::sck::process ::Y_N1]); - qnt.sc[+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](dp5 .s_in ); - dp5 .s_out1 (mdm.sc[+mdm::tsk::tdemodulate ].s_in [+mdm::sck::tdemodulate ::Y_N1]); - dp5 .s_out2 (mdm.sc[+mdm::tsk::demodulate ].s_in [+mdm::sck::demodulate ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate ].s_out [+mdm::sck::demodulate ::Y_N2](fnl .s_in1 ); - } - fnl .s_out (itl.sc[+itl::tsk::deinterleave ].s_in [+itl::sck::deinterleave ::itl ]); - itl.sc [+itl::tsk::deinterleave ].s_out [+itl::sck::deinterleave ::nat ](rtr .s_in ); - rtr .s_out1 (dcs.sc[+dec::tsk::decode_siso ].s_in [+dec::sck::decode_siso ::Y_N1]); - rtr .s_out2 (dch.sc[+dec::tsk::decode_siho ].s_in [+dec::sck::decode_siho ::Y_N ]); - dcs.sc [+dec::tsk::decode_siso ].s_out [+dec::sck::decode_siso ::Y_N2](itl.sc[+itl::tsk::interleave ].s_in [+itl::sck::interleave ::nat ]); - if (this->params_BFER_ite.chn->type.find("RAYLEIGH") != std::string::npos) { - itl.sc[+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::tdemodulate_wg].s_in [+mdm::sck::tdemodulate_wg::Y_N2]); - mdm.sc[+mdm::tsk::tdemodulate_wg].s_out [+mdm::sck::tdemodulate_wg::Y_N3](fnl .s_in2 ); - } else { - itl.sc[+itl::tsk::interleave ].s_out [+itl::sck::interleave ::itl ](mdm.sc[+mdm::tsk::tdemodulate ].s_in [+mdm::sck::tdemodulate ::Y_N2]); - mdm.sc[+mdm::tsk::tdemodulate ].s_out [+mdm::sck::tdemodulate ::Y_N3](fnl .s_in2 ); - } - dch.sc [+dec::tsk::decode_siho ].s_out [+dec::sck::decode_siho ::V_K ](crc.sc[+crc::tsk::extract ].s_in [+crc::sck::extract ::V_K1]); - crc.sc [+crc::tsk::extract ].s_out [+crc::sck::extract ::V_K2](dp1 .s_in ); - dp1 .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in [+mnt::sck::check_errors ::V ]); - dp1 .s_out2 (prd .s_in ); - } -} - -// ==================================================================================== explicit template instantiation -#include "Tools/types.h" -#ifdef AFF3CT_MULTI_PREC -template class aff3ct::simulation::SC_BFER_ite; -template class aff3ct::simulation::SC_BFER_ite; -template class aff3ct::simulation::SC_BFER_ite; -template class aff3ct::simulation::SC_BFER_ite; -#else -template class aff3ct::simulation::SC_BFER_ite; -#endif -// ==================================================================================== explicit template instantiation - -#endif diff --git a/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp b/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp deleted file mode 100644 index 99fde4e26..000000000 --- a/src/Simulation/Legacy/BFER/Iterative/SystemC/SC_BFER_ite.hpp +++ /dev/null @@ -1,50 +0,0 @@ -#ifdef AFF3CT_SYSTEMC_SIMU - -#ifndef SC_SIMULATION_BFER_ITE_HPP_ -#define SC_SIMULATION_BFER_ITE_HPP_ - -#include -#include - -#include "Tools/SystemC/SC_Router.hpp" -#include "Tools/SystemC/SC_Funnel.hpp" -#include "Tools/SystemC/SC_Predicate.hpp" -#include "Tools/SystemC/SC_Duplicator.hpp" -#include "Tools/Display/Terminal/Terminal.hpp" -#include "Factory/Simulation/BFER/BFER_ite.hpp" -#include "Module/Coset/Coset.hpp" -#include "Simulation/Legacy/BFER/Iterative/BFER_ite.hpp" - -namespace aff3ct -{ -namespace simulation -{ -template -class SC_BFER_ite : public BFER_ite -{ -protected: - std::vector> duplicator; - std::unique_ptr router; - std::unique_ptr funnel; - std::unique_ptr predicate; - -public: - explicit SC_BFER_ite(const factory::BFER_ite ¶ms_BFER_ite); - virtual ~SC_BFER_ite() = default; - -protected: - void create_sc_modules(); - - virtual void __build_communication_chain(const int tid = 0); - virtual void _launch(); - -private: - void bind_sockets (); - void bind_sockets_debug(); -}; -} -} - -#endif /* SC_SIMULATION_BFER_ITE_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.cpp b/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.cpp deleted file mode 100644 index b799022c7..000000000 --- a/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.cpp +++ /dev/null @@ -1,214 +0,0 @@ -#ifdef AFF3CT_SYSTEMC_SIMU - -#include - -#include "Tools/Exception/exception.hpp" -#include "Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp" - -using namespace aff3ct; -using namespace aff3ct::simulation; - -template -SC_BFER_std -::SC_BFER_std(const factory::BFER_std ¶ms_BFER_std) -: BFER_std(params_BFER_std), - duplicator(3) -{ - if (this->params_BFER_std.n_threads > 1) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "BFER SystemC simulation does not support " - "multi-threading."); - - if (params_BFER_std.coded_monitoring) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "BFER SystemC simulation does not support the " - "coded monitoring."); - - if (params_BFER_std.mnt_mutinfo) - throw tools::invalid_argument(__FILE__, __LINE__, __func__, "BFER SystemC simulation does not support the " - "mututal information computation."); -} - -template -void SC_BFER_std -::__build_communication_chain(const int tid) -{ - BFER_std::__build_communication_chain(tid); - - this->monitor_er[tid]->record_callback_check([&]() -> void - { - if (!this->keep_looping_noise_point()) // will make the MPI communication - sc_core::sc_stop(); - }); -} - -template -void SC_BFER_std -::create_sc_modules() -{ - using namespace module; - - const auto tid = 0; - - // create the sc_module inside the objects of the communication chain - this->source [tid] ->sc.create_module(+src::tsk::generate ); - this->crc [tid] ->sc.create_module(+crc::tsk::build ); - this->codec [tid]->get_encoder() .sc.create_module(+enc::tsk::encode ); - this->codec [tid]->get_puncturer() .sc.create_module(+pct::tsk::puncture ); - this->codec [tid]->get_puncturer() .sc.create_module(+pct::tsk::depuncture); - this->modem [tid] ->sc.create_module(+mdm::tsk::modulate ); - this->modem [tid] ->sc.create_module(+mdm::tsk::filter ); - if (this->params_BFER_std.chn->type.find("RAYLEIGH") != std::string::npos) - { - this->channel[tid]->sc.create_module(+chn::tsk::add_noise_wg ); - this->modem [tid]->sc.create_module(+mdm::tsk::demodulate_wg); - } - else if (this->params_BFER_std.chn->type == "OPTICAL" && this->params_BFER_std.mdm->rop_est_bits > 0) - { - this->channel[tid]->sc.create_module(+chn::tsk::add_noise ); - this->modem [tid]->sc.create_module(+mdm::tsk::demodulate_wg); - } - else - { - this->channel[tid]->sc.create_module(+chn::tsk::add_noise ); - this->modem [tid]->sc.create_module(+mdm::tsk::demodulate); - } - this->quantizer [tid] ->sc.create_module(+qnt::tsk::process ); - this->codec [tid]->get_decoder_siho() .sc.create_module(+dec::tsk::decode_siho ); - this->monitor_er[tid] ->sc.create_module(+mnt::tsk::check_errors ); - if (this->params_BFER_std.mnt_mutinfo) // this->monitor_mi[tid] != nullptr - this->monitor_mi[tid] ->sc.create_module(+mnt::tsk::get_mutual_info); - if (this->params_BFER_std.coset) - { - this->coset_real[tid]->sc.create_module(+cst::tsk::apply); - this->coset_bit [tid]->sc.create_module(+cst::tsk::apply); - } - this->crc[tid]->sc.create_module(+crc::tsk::extract); - - this->duplicator[0].reset(new tools::SC_Duplicator("Duplicator_src")); - if (this->params_BFER_std.coset) - { - this->duplicator[1].reset(new tools::SC_Duplicator("Duplicator1")); - this->duplicator[2].reset(new tools::SC_Duplicator("Duplicator2")); - } -} - -template -void SC_BFER_std -::_launch() -{ - this->create_sc_modules(); - - this->bind_sockets(); - sc_core::sc_report_handler::set_actions(sc_core::SC_INFO, sc_core::SC_DO_NOTHING); - sc_core::sc_start(); // start simulation - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // /!\ VERY DIRTY WAY TO CREATE A NEW SIMULATION CONTEXT IN SYSTEMC, BE CAREFUL THIS IS NOT IN THE STD! /!\ // - ////////////////////////////////////////////////////////////////////////////////////////////////////////////// - sc_core::sc_curr_simcontext = new sc_core::sc_simcontext(); - sc_core::sc_default_global_context = sc_core::sc_curr_simcontext; -} - -template -void SC_BFER_std -::bind_sockets() -{ - using namespace module; - - auto &dp_src = *this->duplicator[0]; - - auto &src = *this->source [0]; - auto &crc = *this->crc [0]; - auto &enc = this->codec [0]->get_encoder(); - auto &pct = this->codec [0]->get_puncturer(); - auto &mdm = *this->modem [0]; - auto &chn = *this->channel [0]; - auto &qnt = *this->quantizer [0]; - auto &csr = *this->coset_real[0]; - auto &dec = this->codec [0]->get_decoder_siho(); - auto &csb = *this->coset_bit [0]; - auto &mnt = *this->monitor_er[0]; - - if (this->params_BFER_std.coset) - { - auto &dp1 = *this->duplicator[1]; - auto &dp2 = *this->duplicator[2]; - - src.sc [+src::tsk::generate ].s_out [+src::sck::generate ::U_K ](dp_src .s_in ); - dp_src .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in[+mnt::sck::check_errors ::U ]); - dp_src .s_out2 (crc.sc[+crc::tsk::build ].s_in[+crc::sck::build ::U_K1]); - crc.sc [+crc::tsk::build ].s_out [+crc::sck::build ::U_K2](dp1 .s_in ); - dp1 .s_out1 (csb.sc[+cst::tsk::apply ].s_in[+cst::sck::apply ::ref ]); - dp1 .s_out2 (enc.sc[+enc::tsk::encode ].s_in[+enc::sck::encode ::U_K ]); - enc.sc [+enc::tsk::encode ].s_out [+enc::sck::encode ::X_N ](dp2 .s_in ); - dp2 .s_out1 (csr.sc[+cst::tsk::apply ].s_in[+cst::sck::apply ::ref ]); - dp2 .s_out2 (pct.sc[+pct::tsk::puncture ].s_in[+pct::sck::puncture ::X_N1]); - pct.sc [+pct::tsk::puncture ].s_out [+pct::sck::puncture ::X_N2](mdm.sc[+mdm::tsk::modulate ].s_in[+mdm::sck::modulate ::X_N1]); - if (this->params_BFER_std.chn->type.find("RAYLEIGH") != std::string::npos) { // Rayleigh chn - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise_wg ].s_in[+chn::sck::add_noise_wg ::X_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::H_N ](mdm.sc[+mdm::tsk::demodulate_wg].s_in[+mdm::sck::demodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in[+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](mdm.sc[+mdm::tsk::demodulate_wg].s_in[+mdm::sck::demodulate_wg::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg].s_out [+mdm::sck::demodulate_wg::Y_N2](qnt.sc[+qnt::tsk::process ].s_in[+qnt::sck::process ::Y_N1]); - } else if (this->params_BFER_std.chn->type == "OPTICAL" && this->params_BFER_std.mdm->rop_est_bits > 0){ // optical channel with ROP estimation - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_out[+chn::sck::add_noise ::X_N ]); - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](mdm.sc[+mdm::tsk::demodulate_wg].s_out[+mdm::sck::demodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::demodulate_wg].s_out[+mdm::sck::demodulate_wg::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg].s_out [+mdm::sck::demodulate_wg::Y_N2](qnt.sc[+qnt::tsk::process ].s_out[+qnt::sck::process ::Y_N1]); - } else { // additive channel (AWGN, USER, NO) - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_in[+chn::sck::add_noise ::X_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in[+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](mdm.sc[+mdm::tsk::demodulate ].s_in[+mdm::sck::demodulate ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate ].s_out [+mdm::sck::demodulate ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in[+qnt::sck::process ::Y_N1]); - } - qnt.sc [+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](pct.sc[+pct::tsk::depuncture ].s_in[+pct::sck::depuncture ::Y_N1]); - pct.sc [+pct::tsk::depuncture ].s_out [+pct::sck::depuncture ::Y_N2](csr.sc[+cst::tsk::apply ].s_in[+cst::sck::apply ::in ]); - csr.sc [+cst::tsk::apply ].s_out [+cst::sck::apply ::out ](dec.sc[+dec::tsk::decode_siho ].s_in[+dec::sck::decode_siho ::Y_N ]); - dec.sc [+dec::tsk::decode_siho ].s_out [+dec::sck::decode_siho ::V_K ](csb.sc[+cst::tsk::apply ].s_in[+cst::sck::apply ::in ]); - csb.sc [+cst::tsk::apply ].s_out [+cst::sck::apply ::out ](crc.sc[+crc::tsk::extract ].s_in[+crc::sck::extract ::V_K1]); - crc.sc [+crc::tsk::extract ].s_out [+crc::sck::extract ::V_K2](mnt.sc[+mnt::tsk::check_errors ].s_in[+mnt::sck::check_errors ::V ]); - } - else // standard simulation - { - src.sc [+src::tsk::generate ].s_out [+src::sck::generate ::U_K ](dp_src .s_in ); - dp_src .s_out1 (mnt.sc[+mnt::tsk::check_errors ].s_in[+mnt::sck::check_errors ::U ]); - dp_src .s_out2 (crc.sc[+crc::tsk::build ].s_in[+crc::sck::build ::U_K1]); - crc.sc [+crc::tsk::build ].s_out [+crc::sck::build ::U_K2](enc.sc[+enc::tsk::encode ].s_in[+enc::sck::encode ::U_K ]); - enc.sc [+enc::tsk::encode ].s_out [+enc::sck::encode ::X_N ](pct.sc[+pct::tsk::puncture ].s_in[+pct::sck::puncture ::X_N1]); - pct.sc [+pct::tsk::puncture ].s_out [+pct::sck::puncture ::X_N2](mdm.sc[+mdm::tsk::modulate ].s_in[+mdm::sck::modulate ::X_N1]); - if (this->params_BFER_std.chn->type.find("RAYLEIGH") != std::string::npos) { // Rayleigh chn - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise_wg ].s_in[+chn::sck::add_noise_wg ::X_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::H_N ](mdm.sc[+mdm::tsk::demodulate_wg].s_in[+mdm::sck::demodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise_wg ].s_out [+chn::sck::add_noise_wg ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in[+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](mdm.sc[+mdm::tsk::demodulate_wg].s_in[+mdm::sck::demodulate_wg::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg].s_out [+mdm::sck::demodulate_wg::Y_N2](qnt.sc[+qnt::tsk::process ].s_in[+qnt::sck::process ::Y_N1]); - } else if (this->params_BFER_std.chn->type == "OPTICAL" && this->params_BFER_std.mdm->rop_est_bits > 0){ // optical channel with ROP estimation - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_out[+chn::sck::add_noise ::X_N ]); - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](mdm.sc[+mdm::tsk::demodulate_wg].s_out[+mdm::sck::demodulate_wg::H_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::demodulate_wg].s_out[+mdm::sck::demodulate_wg::Y_N1]); - mdm.sc[+mdm::tsk::demodulate_wg].s_out [+mdm::sck::demodulate_wg::Y_N2](qnt.sc[+qnt::tsk::process ].s_out[+qnt::sck::process ::Y_N1]); - } else { // additive channel (AWGN, USER, NO) - mdm.sc[+mdm::tsk::modulate ].s_out [+mdm::sck::modulate ::X_N2](chn.sc[+chn::tsk::add_noise ].s_in[+chn::sck::add_noise ::X_N ]); - chn.sc[+chn::tsk::add_noise ].s_out [+chn::sck::add_noise ::Y_N ](mdm.sc[+mdm::tsk::filter ].s_in[+mdm::sck::filter ::Y_N1]); - mdm.sc[+mdm::tsk::filter ].s_out [+mdm::sck::filter ::Y_N2](mdm.sc[+mdm::tsk::demodulate ].s_in[+mdm::sck::demodulate ::Y_N1]); - mdm.sc[+mdm::tsk::demodulate ].s_out [+mdm::sck::demodulate ::Y_N2](qnt.sc[+qnt::tsk::process ].s_in[+qnt::sck::process ::Y_N1]); - } - qnt.sc [+qnt::tsk::process ].s_out [+qnt::sck::process ::Y_N2](pct.sc[+pct::tsk::depuncture ].s_in[+pct::sck::depuncture ::Y_N1]); - pct.sc [+pct::tsk::depuncture ].s_out [+pct::sck::depuncture ::Y_N2](dec.sc[+dec::tsk::decode_siho ].s_in[+dec::sck::decode_siho ::Y_N ]); - dec.sc [+dec::tsk::decode_siho ].s_out [+dec::sck::decode_siho ::V_K ](crc.sc[+crc::tsk::extract ].s_in[+crc::sck::extract ::V_K1]); - crc.sc [+crc::tsk::extract ].s_out [+crc::sck::extract ::V_K2](mnt.sc[+mnt::tsk::check_errors ].s_in[+mnt::sck::check_errors ::V ]); - } -} - -// ==================================================================================== explicit template instantiation -#include "Tools/types.h" -#ifdef AFF3CT_MULTI_PREC -template class aff3ct::simulation::SC_BFER_std; -template class aff3ct::simulation::SC_BFER_std; -template class aff3ct::simulation::SC_BFER_std; -template class aff3ct::simulation::SC_BFER_std; -#else -template class aff3ct::simulation::SC_BFER_std; -#endif -// ==================================================================================== explicit template instantiation - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp b/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp deleted file mode 100644 index 4556d0c08..000000000 --- a/src/Simulation/Legacy/BFER/Standard/SystemC/SC_BFER_std.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifdef AFF3CT_SYSTEMC_SIMU - -#ifndef SC_SIMULATION_BFER_STD_HPP_ -#define SC_SIMULATION_BFER_STD_HPP_ - -#include -#include - -#include "Tools/SystemC/SC_Duplicator.hpp" -#include "Factory/Simulation/BFER/BFER_std.hpp" -#include "Simulation/Legacy/BFER/Standard/BFER_std.hpp" - -namespace aff3ct -{ -namespace simulation -{ -template -class SC_BFER_std : public BFER_std -{ -protected: - std::vector> duplicator; - -public: - explicit SC_BFER_std(const factory::BFER_std ¶ms_BFER_std); - virtual ~SC_BFER_std() = default; - -protected: - void create_sc_modules(); - - virtual void __build_communication_chain(const int tid = 0); - virtual void _launch(); - -private: - void bind_sockets(); -}; -} -} - -#endif /* SC_SIMULATION_BFER_STD_HPP_ */ - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Tools/SystemC/SC_Dummy.cpp b/src/Tools/SystemC/SC_Dummy.cpp deleted file mode 100644 index 46218862a..000000000 --- a/src/Tools/SystemC/SC_Dummy.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include "Tools/SystemC/SC_Dummy.hpp" - -using namespace aff3ct; -using namespace aff3ct::tools; - -SC_Dummy -::SC_Dummy(sc_core::sc_module_name name) -: sc_module(name), s_in("s_in") -{ - s_in.register_b_transport(this, &SC_Dummy::b_transport); -} - -void SC_Dummy -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ -} - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Tools/SystemC/SC_Duplicator.cpp b/src/Tools/SystemC/SC_Duplicator.cpp deleted file mode 100644 index 2636d4e2c..000000000 --- a/src/Tools/SystemC/SC_Duplicator.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include "Tools/SystemC/SC_Duplicator.hpp" - -using namespace aff3ct; -using namespace aff3ct::tools; - -SC_Duplicator -::SC_Duplicator(sc_core::sc_module_name name) -: sc_module(name), s_in("s_in"), s_out1("s_out1"), s_out2("s_out2") -{ - s_in.register_b_transport(this, &SC_Duplicator::b_transport); -} - -void SC_Duplicator -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - s_out1->b_transport(trans, zero_time); - s_out2->b_transport(trans, zero_time); -} - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Tools/SystemC/SC_Funnel.cpp b/src/Tools/SystemC/SC_Funnel.cpp deleted file mode 100644 index 1a24dadd4..000000000 --- a/src/Tools/SystemC/SC_Funnel.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include "Tools/SystemC/SC_Funnel.hpp" - -using namespace aff3ct; -using namespace aff3ct::tools; - -SC_Funnel -::SC_Funnel(sc_core::sc_module_name name) -: sc_module(name), s_in1("s_in1"), s_in2("s_in2"), s_out("s_out") -{ - s_in1.register_b_transport(this, &SC_Funnel::b_transport); - s_in2.register_b_transport(this, &SC_Funnel::b_transport); -} - -void SC_Funnel -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - s_out->b_transport(trans, zero_time); -} - -#endif /* AFF3CT_SYSTEMC */ diff --git a/src/Tools/SystemC/SC_Predicate.cpp b/src/Tools/SystemC/SC_Predicate.cpp deleted file mode 100644 index 22058bbdc..000000000 --- a/src/Tools/SystemC/SC_Predicate.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include "Tools/SystemC/SC_Predicate.hpp" - -using namespace aff3ct; -using namespace aff3ct::tools; - -SC_Predicate -::SC_Predicate(Predicate &p, sc_core::sc_module_name name) -: sc_module(name), s_in("s_in"), p(p) -{ - s_in.register_b_transport(this, &SC_Predicate::b_transport); -} - -void SC_Predicate -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - p.reset(); -} - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/Tools/SystemC/SC_Router.cpp b/src/Tools/SystemC/SC_Router.cpp deleted file mode 100644 index 47a19437d..000000000 --- a/src/Tools/SystemC/SC_Router.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#if defined(AFF3CT_SYSTEMC_SIMU) || defined(AFF3CT_SYSTEMC_MODULE) - -#include "Tools/SystemC/SC_Router.hpp" - -using namespace aff3ct; -using namespace aff3ct::tools; - -SC_Router -::SC_Router(Predicate &p, sc_core::sc_module_name name) -: sc_module(name), s_in("s_in"), s_out1("s_out1"), s_out2("s_out2"), p(p) -{ - s_in.register_b_transport(this, &SC_Router::b_transport); -} - -void SC_Router -::b_transport(tlm::tlm_generic_payload& trans, sc_core::sc_time& t) -{ - sc_core::sc_time zero_time(sc_core::SC_ZERO_TIME); - if (!p()) - s_out1->b_transport(trans, zero_time); - else - s_out2->b_transport(trans, zero_time); -} - -#endif /* AFF3CT_SYSTEMC_SIMU */ diff --git a/src/main.cpp b/src/main.cpp index da6c37c71..5d4bcc226 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,9 +7,6 @@ #ifdef AFF3CT_MPI #include #endif -#ifdef AFF3CT_SYSTEMC_SIMU -#include -#endif #include #include "Tools/types.h" @@ -129,12 +126,6 @@ void print_version() std::string mkl = "off"; #endif -#if defined(AFF3CT_SYSTEMC_SIMU) - std::string systemc = "on"; -#else - std::string systemc = "off"; -#endif - std::cout << "aff3ct (" << os << prec << ", " << compiler << "-" << compiler_version << ", " << mipp::InstructionFullType << ") " << affect_version << std::endl; std::cout << "Compilation options:" << std::endl; @@ -147,7 +138,6 @@ void print_version() std::cout << " - MPI: " << mpi << std::endl; std::cout << " - GSL: " << gsl << std::endl; std::cout << " - MKL: " << mkl << std::endl; - std::cout << " - SystemC: " << systemc << std::endl; std::cout << "Copyright (c) 2016-2020 - MIT license." << std::endl; std::cout << "This is free software; see the source for copying conditions. There is NO" << std::endl; std::cout << "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << std::endl; @@ -197,11 +187,7 @@ int read_arguments(const int argc, const char** argv, factory::Launcher ¶ms) return (cmd_error.size() || display_help) ? EXIT_FAILURE : EXIT_SUCCESS; } -#ifndef AFF3CT_SYSTEMC_SIMU int main(int argc, char **argv) -#else -int sc_main(int argc, char **argv) -#endif { int exit_code = EXIT_SUCCESS; #ifdef AFF3CT_MPI