Browse Source

Merge branch 'develop'

pull/3/head
Eyck Jentzsch 2 years ago
parent
commit
1859c341ab
57 changed files with 124447 additions and 49125 deletions
  1. +63
    -27
      cmake/FindSystemC.cmake
  2. +292
    -0
      cmake/FindVerilator.cmake
  3. +74
    -0
      incl/scc/configurable_tracer.h
  4. +27
    -27
      incl/scc/configurer.h
  5. +8
    -8
      incl/scc/core/sc_logic_7.h
  6. +5
    -5
      incl/scc/ext_attribute.h
  7. +2
    -2
      incl/scc/initiator_mixin.h
  8. +4
    -4
      incl/scc/memory.h
  9. +79
    -0
      incl/scc/peq.h
  10. +60
    -0
      incl/scc/perf_estimator.h
  11. +48
    -23
      incl/scc/register.h
  12. +50
    -62
      incl/scc/report.h
  13. +2
    -2
      incl/scc/resetable.h
  14. +6
    -3
      incl/scc/resource_access_if.h
  15. +49
    -15
      incl/scc/router.h
  16. +30
    -10
      incl/scc/scv_tr_db.h
  17. +156
    -0
      incl/scc/signal_initiator_mixin.h
  18. +145
    -0
      incl/scc/signal_target_mixin.h
  19. +127
    -0
      incl/scc/tagged_initiator_mixin.h
  20. +514
    -0
      incl/scc/tagged_target_mixin.h
  21. +4
    -3
      incl/scc/target_mixin.h
  22. +50
    -0
      incl/scc/time2tick.h
  23. +11
    -10
      incl/scc/tlm_target.h
  24. +6
    -6
      incl/scc/traceable.h
  25. +13
    -13
      incl/scc/tracer.h
  26. +36
    -25
      incl/scc/utilities.h
  27. +35
    -37
      incl/scv4tlm/tlm2_recorder.h
  28. +2
    -2
      incl/scv4tlm/tlm2_recorder_module.h
  29. +13
    -14
      incl/scv4tlm/tlm_gp_data.h
  30. +1
    -1
      incl/scv4tlm/tlm_gp_data_ext.h
  31. +1
    -1
      incl/scv4tlm/tlm_rec_initiator_socket.h
  32. +1
    -1
      incl/scv4tlm/tlm_rec_target_socket.h
  33. +3
    -3
      incl/scv4tlm/tlm_recording_extension.h
  34. +92
    -0
      incl/tlm/tlm_extensions.h
  35. +114
    -0
      incl/tlm/tlm_signal.h
  36. +101
    -0
      incl/tlm/tlm_signal_conv.h
  37. +317
    -0
      incl/tlm/tlm_signal_gp.h
  38. +98
    -0
      incl/tlm/tlm_signal_sockets.h
  39. +15
    -3
      incl/util/delegate.h
  40. +30
    -7
      incl/util/ities.h
  41. +16
    -18
      incl/util/logging.h
  42. +7
    -5
      incl/util/range_lut.h
  43. +10
    -2
      src/CMakeLists.txt
  44. +117
    -0
      src/configurable_tracer.cpp
  45. +131
    -114
      src/configurer.cpp
  46. +110
    -0
      src/perf_estimator.cpp
  47. +63
    -53
      src/report.cpp
  48. +61
    -57
      src/sc_logic_7.cpp
  49. +545
    -0
      src/scv_tr_binary/scv_tr_binary.cpp
  50. +17
    -17
      src/scv_tr_compressed.cpp
  51. +495
    -0
      src/scv_tr_ldb/scv_tr_ldb.cpp
  52. +90
    -53
      src/scv_tr_sqlite/scv_tr_sqlite.cpp
  53. +114177
    -46748
      src/scv_tr_sqlite/sqlite3.c
  54. +5823
    -1678
      src/scv_tr_sqlite/sqlite3.h
  55. +68
    -64
      src/tracer.cpp
  56. +3
    -2
      src/utilities.cpp
  57. +30
    -0
      src/verilator_callbacks.cpp

+ 63
- 27
cmake/FindSystemC.cmake View File

@ -1,11 +1,5 @@
SET(_SYSTEMC_HINTS
${CONAN_INCLUDE_DIRS_SYSTEMC}
${CONAN_LIB_DIRS_SYSTEMC}
${CONAN_INCLUDE_DIRS_SYSTEMCVERIFICATION}
${CONAN_LIB_DIRS_SYSTEMCVERIFICATION}
${CONAN_INCLUDE_DIRS_SYSTEMC-CCI}
${CONAN_LIB_DIRS_SYSTEMC-CCI}
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SystemC\\2.2;SystemcHome]/include"
SET(_COMMON_HINTS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\SystemC\\2.3;SystemcHome]/include"
${SYSTEMC_PREFIX}/include
${SYSTEMC_PREFIX}/lib
${SYSTEMC_PREFIX}/lib-linux
@ -27,13 +21,37 @@ SET(_SYSTEMC_HINTS
${CMAKE_INSTALL_PREFIX}/lib-linux64
${CMAKE_INSTALL_PREFIX}/lib-macos
)
SET(_SYSTEMC_PATHS
SET(_SYSTEMC_HINTS
${CONAN_INCLUDE_DIRS_SYSTEMC}
${CONAN_LIB_DIRS_SYSTEMC}
${_COMMON_HINTS}
)
SET(_SCV_HINTS
${CONAN_INCLUDE_DIRS_SYSTEMCVERIFICATION}
${CONAN_LIB_DIRS_SYSTEMCVERIFICATION}
$ENV{SCV_HOME}/include
$ENV{SCV_HOME}/lib
$ENV{SCV_HOME}/lib-linux
$ENV{SCV_HOME}/lib-linux64
$ENV{SCV_HOME}/lib-macos
${_COMMON_HINTS}
)
SET(_CCI_HINTS
${CONAN_INCLUDE_DIRS_SYSTEMC-CCI}
${CONAN_LIB_DIRS_SYSTEMC-CCI}
$ENV{CCI_HOME}/include
$ENV{CCI_HOME}/src
$ENV{CCI_HOME}/lib
$ENV{CCI_HOME}/lib-linux
$ENV{CCI_HOME}/lib-linux64
$ENV{CCI_HOME}/lib-macos
${_COMMON_HINTS}
)
SET(_COMMON_PATHS
/usr/include/systemc
/usr/lib
/usr/lib-linux
@ -45,6 +63,25 @@ SET(_SYSTEMC_PATHS
/usr/local/lib-linux64
/usr/local/lib-macos
)
SET(_SYSTEMC_PATHS
${CONAN_INCLUDE_DIRS_SYSTEMC}
${CONAN_LIB_DIRS_SYSTEMC}
${_COMMON_PATHS}
)
SET(_SCV_PATHS
${CONAN_INCLUDE_DIRS_SYSTEMCVERIFICATION}
${CONAN_LIB_DIRS_SYSTEMCVERIFICATION}
${_COMMON_PATHS}
)
SET(_CCI_PATHS
${CONAN_INCLUDE_DIRS_SYSTEMC}
${CONAN_LIB_DIRS_SYSTEMC}
${_COMMON_PATHS}
)
FIND_FILE(_SYSTEMC_HEADER_FILE
NAMES systemc
HINTS ${_SYSTEMC_HINTS}
@ -54,15 +91,15 @@ FIND_FILE(_SYSTEMC_HEADER_FILE
FIND_FILE(_SCV_HEADER_FILE
NAMES scv.h
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_SCV_HINTS}
PATHS ${_SCV_PATHS}
PATH_SUFFIXES sysc/kernel
)
FIND_FILE(_CCI_HEADER_FILE
NAMES cci_configuration
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_CCI_HINTS}
PATHS ${_CCI_PATHS}
PATH_SUFFIXES sysc/kernel
)
@ -70,9 +107,11 @@ if(NOT _SYSTEMC_HEADER_FILE STREQUAL _SYSTEMC_HEADER_FILE-NOTFOUND)
set(SystemC_FOUND TRUE)
endif()
if(ENABLE_SCV)
if(NOT _SCV_HEADER_FILE STREQUAL _SCV_HEADER_FILE-NOTFOUND)
set(SCV_FOUND TRUE)
endif()
endif()
if(NOT _CCI_HEADER_FILE STREQUAL _CCI_HEADER_FILE-NOTFOUND)
set(CCI_FOUND TRUE)
@ -83,6 +122,7 @@ FIND_PATH(SystemC_INCLUDE_DIRS
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
)
FIND_PATH(SystemC_LIBRARY_DIRS
NAMES libsystemc.so libsystemc.a
HINTS ${_SYSTEMC_HINTS}
@ -91,38 +131,34 @@ FIND_PATH(SystemC_LIBRARY_DIRS
FIND_PATH(SCV_INCLUDE_DIRS
NAMES scv.h
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_SCV_HINTS}
PATHS ${_SCV_PATHS}
)
FIND_PATH(SCV_LIBRARY_DIRS
NAMES libscv.a libscv.so
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_SCV_HINTS}
PATHS ${_SCV_PATHS}
)
FIND_PATH(CCI_INCLUDE_DIRS
NAMES cci_configuration
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_CCI_HINTS}
PATHS ${_CCI_PATHS}
)
FIND_PATH(CCI_LIBRARY_DIRS
NAMES libcciapi.a libcciapi.so
HINTS ${_SYSTEMC_HINTS}
PATHS ${_SYSTEMC_PATHS}
HINTS ${_CCI_HINTS}
PATHS ${_CCI_PATHS}
)
if(SystemC_FOUND)
set(SystemC_LIBRARIES systemc)
message(STATUS "SystemC header files are taken from ${SystemC_INCLUDE_DIRS}")
message(STATUS "SystemC library is taken from ${SystemC_LIBRARY_DIRS}")
if(SCV_FOUND)
set(SCV_LIBRARIES scv)
message(STATUS "SCV header files are taken from ${SCV_INCLUDE_DIRS}")
message(STATUS "SCV library is taken from ${SCV_LIBRARY_DIRS}")
endif(SCV_FOUND)
if(CCI_FOUND)
set(CCI_LIBRARIES cciapi)
message(STATUS "CCI header files are taken from ${CCI_INCLUDE_DIRS}")
message(STATUS "CCI library is taken from ${CCI_LIBRARY_DIRS}")
endif()
endif(SystemC_FOUND)

+ 292
- 0
cmake/FindVerilator.cmake View File

@ -0,0 +1,292 @@
# Copyright 2018 Tymoteusz Blazejczyk
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#.rst:
# FindVerilator
# --------
#
# Find Verilator
#
# ::
#
# VERILATOR_EXECUTABLE - Verilator
# VERILATOR_FOUND - true if Verilator found
if (COMMAND _find_verilator)
return()
endif()
function(verilator_target_compile_options target)
set(options "")
if (CMAKE_SYSTEM_NAME MATCHES CYGWIN)
list(APPEND options -std=gnu++11)
else()
list(APPEND options -std=c++11)
endif()
list(APPEND options -fPIC)
if (LTO)
list(APPEND options -flto)
endif()
if (LOGIC_WARNINGS_INTO_ERRORS)
list(APPEND options -Werror)
endif()
if (CMAKE_BUILD_TYPE MATCHES "Release" OR NOT CMAKE_BUILD_TYPE)
list(APPEND options
-O2
-s
-DNDEBUG
-fdata-sections
-ffunction-sections
)
elseif (CMAKE_BUILD_TYPE MATCHES "MinSizeRel")
list(APPEND options
-Os
-DNDEBUG
-fdata-sections
-ffunction-sections
)
elseif (CMAKE_BUILD_TYPE MATCHES "Coverage")
list(APPEND options
-O0
-g
--coverage
)
endif()
list(APPEND options
-fstrict-aliasing
-pedantic
-Wall
-Wcast-qual
-Wcomments
-Wconversion
-Wctor-dtor-privacy
-Wdisabled-optimization
-Wendif-labels
-Wenum-compare
-Wfloat-equal
-Wformat=2
-Wformat-nonliteral
-Winit-self
-Winvalid-pch
-Wlogical-op
-Wmissing-declarations
-Wmissing-include-dirs
-Wno-long-long
-Wnon-virtual-dtor
-Wold-style-cast
-Woverloaded-virtual
-Wpacked
-Wparentheses
-Wpointer-arith
#-Wredundant-decls
-Wshadow
-Wsign-conversion
-Wsign-promo
-Wstack-protector
-Wstrict-null-sentinel
-Wstrict-overflow=2
-Wsuggest-attribute=noreturn
-Wswitch-default
-Wswitch-enum
-Wundef
-Wuninitialized
-Wunknown-pragmas
-Wunused
-Wunused-function
-Wwrite-strings
)
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
list(APPEND options
-Wduplicated-cond
-Whsa
-Wignored-attributes
-Wmisleading-indentation
-Wnull-dereference
-Wplacement-new=2
-Wshift-negative-value
-Wshift-overflow=2
-Wvirtual-inheritance
)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
list(APPEND options
-Wdouble-promotion
-Wsized-deallocation
-Wsuggest-override
-Wtrampolines
-Wvector-operation-performance
-Wzero-as-null-pointer-constant
)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
list(APPEND options
-Wconditionally-supported
-Wdate-time
-Weffc++
-Wextra
-Winline
-Wopenmp-simd
)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
list(APPEND options
-Wpedantic
-Wsuggest-attribute=format
)
endif()
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.6)
list(APPEND options
-Wnoexcept
)
endif()
target_compile_options(${target} PRIVATE ${options} ${ARGN})
endfunction()
function(_find_verilator)
find_package(PackageHandleStandardArgs REQUIRED)
find_package(SystemC)
find_program(VERILATOR_EXECUTABLE verilator
HINTS $ENV{VERILATOR_ROOT} /usr/local/bin
PATH_SUFFIXES bin
DOC "Path to the Verilator executable"
)
if(VERILATOR_EXECUTABLE STREQUAL VERILATOR_EXECUTABLE-NOTFOUND)
set(VERILATOR_FOUND FALSE PARENT_SCOPE)
else()
find_program(VERILATOR_COVERAGE_EXECUTABLE verilator_coverage
HINTS $ENV{VERILATOR_ROOT} /usr/local/bin
PATH_SUFFIXES bin
DOC "Path to the Verilator coverage executable"
)
get_filename_component(VERILATOR_EXECUTABLE_DIR ${VERILATOR_EXECUTABLE}
DIRECTORY)
find_path(VERILATOR_INCLUDE_DIR verilated.h
HINTS $ENV{VERILATOR_ROOT} ${VERILATOR_EXECUTABLE_DIR}/.. /usr/local
PATH_SUFFIXES include share/verilator/include
DOC "Path to the Verilator headers"
)
if(VERILATOR_INCLUDE_DIR STREQUAL VERILATOR_INCLUDE_DIR-NOTFOUND)
message( FATAL_ERROR "verilator include files not found." )
endif()
mark_as_advanced(VERILATOR_EXECUTABLE)
mark_as_advanced(VERILATOR_COVERAGE_EXECUTABLE)
mark_as_advanced(VERILATOR_INCLUDE_DIR)
find_package_handle_standard_args(Verilator REQUIRED_VARS
VERILATOR_EXECUTABLE VERILATOR_COVERAGE_EXECUTABLE VERILATOR_INCLUDE_DIR)
if (WIN32)
set(library_policy STATIC)
else()
set(library_policy SHARED)
endif()
add_library(verilated ${library_policy}
${VERILATOR_INCLUDE_DIR}/verilated.cpp
${VERILATOR_INCLUDE_DIR}/verilated_cov.cpp
${VERILATOR_INCLUDE_DIR}/verilated_dpi.cpp
${VERILATOR_INCLUDE_DIR}/verilated_vcd_c.cpp
${VERILATOR_INCLUDE_DIR}/verilated_vcd_sc.cpp
${CMAKE_CURRENT_LIST_DIR}/../src/verilator_callbacks.cpp
)
set_target_properties(verilated PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
set_source_files_properties(
${VERILATOR_INCLUDE_DIR}/verilated.cpp
PROPERTIES
COMPILE_DEFINITIONS "VL_USER_STOP;VL_USER_FINISH"
)
set_source_files_properties(
${VERILATOR_INCLUDE_DIR}/verilated_cov.cpp
PROPERTIES
COMPILE_DEFINITIONS "VM_COVERAGE=1"
)
target_link_libraries(verilated PRIVATE systemc)
set_target_properties(verilated PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
)
target_include_directories(verilated SYSTEM PRIVATE
${VERILATOR_INCLUDE_DIR}
${VERILATOR_INCLUDE_DIR}/vltstd
${SYSTEMC_INCLUDE_DIRS}
)
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
verilator_target_compile_options(verilated PRIVATE
-Wno-attributes
-Wno-cast-qual
-Wno-float-equal
-Wno-suggest-override
-Wno-conversion
-Wno-unused-parameter
-Wno-effc++
-Wno-format
-Wno-format-nonliteral
-Wno-missing-declarations
-Wno-old-style-cast
-Wno-shadow
-Wno-sign-conversion
-Wno-strict-overflow
-Wno-suggest-attribute=noreturn
-Wno-suggest-final-methods
-Wno-suggest-final-types
-Wno-switch-default
-Wno-switch-enum
-Wno-undef
-Wno-inline
-Wno-variadic-macros
-Wno-suggest-attribute=format
-Wno-zero-as-null-pointer-constant
)
elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang)
verilator_target_compile_options(verilated PRIVATE -Wno-everything)
endif()
set(VERILATOR_FOUND ${VERILATOR_FOUND} PARENT_SCOPE)
set(VERILATOR_EXECUTABLE "${VERILATOR_EXECUTABLE}" PARENT_SCOPE)
set(VERILATOR_INCLUDE_DIR "${VERILATOR_INCLUDE_DIR}" PARENT_SCOPE)
set(VERILATOR_COVERAGE_EXECUTABLE "${VERILATOR_COVERAGE_EXECUTABLE}" PARENT_SCOPE)
endif()
endfunction()
_find_verilator()

+ 74
- 0
incl/scc/configurable_tracer.h View File

@ -0,0 +1,74 @@
/*******************************************************************************
* Copyright (C) 2018, MINRES Technologies GmbH
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* Contributors:
* eyck@minres.com - initial API and implementation
******************************************************************************/
#ifndef _SCC_CONFIGURABLE_TRACER_H_
#define _SCC_CONFIGURABLE_TRACER_H_
#include "tracer.h"
#include <cci_configuration>
namespace scc {
class configurable_tracer : public scc::tracer {
public:
/**
*
* @param name basename of the trace file(s)
* @param type type of trace file for transactions
* @param enable enable VCD (signal based) tracing
* @param default value of attribute enableTracing if not defined by module or CCIs
*/
configurable_tracer(const std::string&&, file_type, bool = true, bool = false);
configurable_tracer(const std::string& name, file_type type, bool enable_vcd = true, bool default_enable = false)
:configurable_tracer(std::string(name), type, enable_vcd, default_enable)
{}
~configurable_tracer();
void add_control() {
for (auto *o : sc_core::sc_get_top_level_objects(sc_core::sc_curr_simcontext)) augment_object_hierarchical(o);
}
protected:
const bool default_trace_enable;
void descend(const sc_core::sc_object *) override;
bool get_trace_enabled(const sc_core::sc_object *, bool = false);
void augment_object_hierarchical(const sc_core::sc_object *);
cci::cci_originator cci_originator;
cci::cci_broker_handle cci_broker;
std::vector<cci::cci_param_untyped *> params;
};
} /* namespace scc */
#endif /* _SCC_CONFIGURABLE_TRACER_H_ */

+ 27
- 27
incl/scc/configurer.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2017 MINRES Technologies GmbH
* Copyright 2017, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,10 +23,10 @@
#ifndef _SYSC_CONFIGURER_H_
#define _SYSC_CONFIGURER_H_
#include "report.h"
#include "utilities.h"
#include <cci_configuration>
#include <json/json.h>
#include "scc/report.h"
#include "scc/utilities.h"
namespace scc {
@ -38,13 +38,13 @@ public:
configurer() = delete;
configurer(const configurer&) = delete;
configurer(const configurer &) = delete;
configurer(configurer&&) = delete;
configurer(configurer &&) = delete;
configurer& operator=(const configurer&) = delete;
configurer &operator=(const configurer &) = delete;
configurer& operator=(configurer&&) = delete;
configurer &operator=(configurer &&) = delete;
void configure();
@ -53,25 +53,25 @@ public:
void dump_configuration(std::ostream &os = std::cout, sc_core::sc_object *obj = nullptr);
template <typename T> void set_value(const std::string &hier_name, T value) {
cci::cci_param_handle param_handle = cci_broker.get_param_handle(hier_name);
if(param_handle.is_valid()) {
param_handle.set_cci_value(cci::cci_value(value));
} else {
size_t pos = hier_name.find_last_of('.');
sc_core::sc_module *mod =
dynamic_cast<sc_core::sc_module *>(sc_core::sc_find_object(hier_name.substr(0, pos).c_str()));
if (mod != nullptr) {
sc_core::sc_attribute<T> *attr =
dynamic_cast<sc_core::sc_attribute<T> *>(mod->get_attribute(hier_name.substr(pos + 1)));
if (attr != nullptr)
attr->value = value;
else
LOG(ERROR) << "Could not set attribute value " << hier_name;
}
}
cci::cci_param_handle param_handle = cci_broker.get_param_handle(hier_name);
if (param_handle.is_valid()) {
param_handle.set_cci_value(cci::cci_value(value));
} else {
size_t pos = hier_name.find_last_of('.');
sc_core::sc_module *mod =
dynamic_cast<sc_core::sc_module *>(sc_core::sc_find_object(hier_name.substr(0, pos).c_str()));
if (mod != nullptr) {
sc_core::sc_attribute<T> *attr =
dynamic_cast<sc_core::sc_attribute<T> *>(mod->get_attribute(hier_name.substr(pos + 1)));
if (attr != nullptr)
attr->value = value;
else
LOG(ERROR) << "Could not set attribute value " << hier_name;
}
}
}
void set_configuration_value(sc_core::sc_attr_base *attr_base, sc_core::sc_module *owner);
void set_configuration_value(sc_core::sc_attr_base *attr_base, sc_core::sc_object *owner);
static configurer &instance() {
configurer *inst = dynamic_cast<configurer *>(sc_core::sc_find_object("configurer"));
@ -80,9 +80,9 @@ public:
}
protected:
void dump_configuration(std::ostream& os, sc_core::sc_object* obj, Json::Value& node);
void dump_configuration(std::ostream &os, sc_core::sc_object *obj, Json::Value &node);
void configure_sc_object(sc_core::sc_object *obj, Json::Value &hier_val);
void configure_sc_attribute_hierarchical(sc_core::sc_object *obj, Json::Value &hier_val);
void set_value(sc_core::sc_attr_base *attr_base, Json::Value &hier_val);
@ -90,7 +90,7 @@ protected:
Json::Value &get_value_from_hierarchy(const std::string &hier_name, Json::Value &val);
void traverse_json_tree(const Json::Value &root, std::string prefix);
void configure_cci_hierarchical(const Json::Value &root, std::string prefix);
Json::Value root;

+ 8
- 8
incl/scc/core/sc_logic_7.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -22,8 +22,8 @@
#ifndef INCL_SYSC_CORE_SC_LOGIC_7_H_
#define INCL_SYSC_CORE_SC_LOGIC_7_H_
#include <cstdio>
#include <array>
#include <cstdio>
#include "sysc/datatypes/bit/sc_bit.h"
#include "sysc/kernel/sc_macros.h"
@ -93,12 +93,12 @@ private:
public:
// conversion tables
static std::array<const sc_logic_7_value_t, 128> char_to_logic;
static std::array<const char, 7> logic_to_char;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> and_table;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> or_table;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> xor_table;
static std::array<const sc_logic_7_value_t, 7> not_table;
static std::array<const sc_logic_7_value_t, 128> char_to_logic;
static std::array<const char, 7> logic_to_char;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> and_table;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> or_table;
static std::array<std::array<const sc_logic_7_value_t, 7>, 7> xor_table;
static std::array<const sc_logic_7_value_t, 7> not_table;
// constructors

+ 5
- 5
incl/scc/ext_attribute.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2017 MINRES Technologies GmbH
* Copyright 2017, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,11 +20,11 @@
* Author: eyck
*/
#ifndef _SYSC_EXT_ATTRIBUTE_H_
#define _SYSC_EXT_ATTRIBUTE_H_
#ifndef _SCC_EXT_ATTRIBUTE_H_
#define _SCC_EXT_ATTRIBUTE_H_
#include "scc/configurer.h"
#include "scc/utilities.h"
#include "configurer.h"
#include "utilities.h"
namespace scc {
template <typename T> class ext_attribute : public sc_core::sc_attribute<T> {

+ 2
- 2
incl/scc/initiator_mixin.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,10 +17,10 @@
#ifndef _SYSC_INITIATOR_MIXIN_H__
#define _SYSC_INITIATOR_MIXIN_H__
#include "utilities.h"
#include <functional>
#include <sstream>
#include <tlm>
#include "scc/utilities.h"
namespace scc {

+ 4
- 4
incl/scc/memory.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -26,9 +26,9 @@
// Needed for the simple_target_socket
#define SC_INCLUDE_DYNAMIC_PROCESSES
#include "scc/report.h"
#include "scc/target_mixin.h"
#include "scc/utilities.h"
#include "report.h"
#include "target_mixin.h"
#include "utilities.h"
#include <tlm.h>
#include <util/sparse_array.h>

+ 79
- 0
incl/scc/peq.h View File

@ -0,0 +1,79 @@
/*******************************************************************************
* Copyright 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#ifndef _SCC_PEQ_H_
#define _SCC_PEQ_H_
#include <boost/optional.hpp>
#include <map>
#include <systemc>
#include <type_traits>
namespace scc {
/**
* a simple priority event queue with a copy of the original value
*/
template <class TYPE> struct peq : public sc_core::sc_object {
static_assert(std::is_copy_constructible<TYPE>::value, "TYPE needs to be copy-constructible");
using pair_type = std::pair<const sc_core::sc_time, TYPE>;
peq()
: sc_core::sc_object(sc_core::sc_gen_unique_name("peq")) {}
explicit peq(const char *name)
: sc_core::sc_object(name) {}
void notify(const TYPE &trans, const sc_core::sc_time &t) {
m_scheduled_events.insert(pair_type(t + sc_core::sc_time_stamp(), trans));
m_event.notify(t);
}
void notify(const TYPE &trans) {
m_scheduled_events.insert(pair_type(sc_core::sc_time_stamp(), trans));
m_event.notify(); // immediate notification
}
boost::optional<TYPE> get_next() {
if (m_scheduled_events.empty()) return boost::none;
;
sc_core::sc_time now = sc_core::sc_time_stamp();
if (m_scheduled_events.begin()->first <= now) {
auto trans = m_scheduled_events.begin()->second;
m_scheduled_events.erase(m_scheduled_events.begin());
return trans;
}
m_event.notify(m_scheduled_events.begin()->first - now);
return boost::none;
;
}
sc_core::sc_event &event() { return m_event; }
// Cancel all events from the event queue
void cancel_all() {
m_scheduled_events.clear();
m_event.cancel();
}
private:
std::map<const sc_core::sc_time, TYPE> m_scheduled_events;
sc_core::sc_event m_event;
};
}
#endif /* _SCC_PEQ_H_ */

+ 60
- 0
incl/scc/perf_estimator.h View File

@ -0,0 +1,60 @@
/*******************************************************************************
* Copyright 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#ifndef _SCC_PERFORMANCETRACER_H_
#define _SCC_PERFORMANCETRACER_H_
#include <boost/date_time/posix_time/posix_time.hpp>
#include <systemc>
namespace scc {
class perf_estimator : public sc_core::sc_module {
struct time_stamp {
boost::posix_time::ptime wall_clock_stamp;
double proc_clock_stamp;
time_stamp()
: wall_clock_stamp(boost::posix_time::microsec_clock::universal_time())
, proc_clock_stamp(get_cpu_time()) {}
time_stamp &operator=(const time_stamp &o) {
wall_clock_stamp = o.wall_clock_stamp;
proc_clock_stamp = o.proc_clock_stamp;
return *this;
}
void set() {
wall_clock_stamp = boost::posix_time::microsec_clock::universal_time();
proc_clock_stamp = get_cpu_time();
}
private:
static double get_cpu_time();
};
public:
SC_HAS_PROCESS(perf_estimator);// NOLINT
perf_estimator();
virtual ~perf_estimator();
protected:
void start_of_simulation() override;
void end_of_simulation() override;
time_stamp sos, eos;
};
} /* namespace scc */
#endif /* _SCC_PERFORMANCETRACER_H_ */

+ 48
- 23
incl/scc/register.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,13 +25,13 @@
#include <memory>
#include "resetable.h"
#include "resource_access_if.h"
#include "util/delegate.h"
#include "utilities.h"
#include <functional>
#include <limits>
#include <sstream>
#include "scc/resetable.h"
#include "scc/resource_access_if.h"
#include "scc/utilities.h"
#include "util/delegate.h"
namespace scc {
@ -81,6 +81,9 @@ public:
, storage(storage) {
owner.register_resource(this);
}
~sc_register() = default;
/**
*
* @return
@ -91,7 +94,7 @@ public:
*/
void reset() override {
DATATYPE r(res_val);
if (wr_cb) wr_cb(*this, r);
if (wr_cb) wr_cb(*this, r, sc_core::SC_ZERO_TIME);
storage = r;
}
/**
@ -101,12 +104,12 @@ public:
* @param offset
* @return
*/
bool write(const uint8_t *data, size_t length, uint64_t offset) override {
bool write(const uint8_t *data, size_t length, uint64_t offset, sc_core::sc_time d) override {
assert("Access out of range" && offset + length <= sizeof(DATATYPE));
auto temp(storage);
auto beg = reinterpret_cast<uint8_t *>(&temp) + offset;
std::copy(data, data + length, beg);
if (wr_cb) return wr_cb(*this, temp);
if (wr_cb) return wr_cb(*this, temp, d);
storage = (temp & wrmask) | (storage & ~wrmask);
return true;
}
@ -117,11 +120,11 @@ public:
* @param offset
* @return
*/
bool read(uint8_t *data, size_t length, uint64_t offset) const override {
bool read(uint8_t *data, size_t length, uint64_t offset, sc_core::sc_time d) const override {
assert("Access out of range" && offset + length <= sizeof(DATATYPE));
auto temp(storage);
if (rd_cb) {
if (!rd_cb(*this, temp)) return false;
if (!rd_cb(*this, temp, d)) return false;
} else
temp &= rdmask;
auto beg = reinterpret_cast<uint8_t *>(&temp) + offset;
@ -199,17 +202,31 @@ public:
*
* @param read_cb
*/
void set_read_cb(std::function<bool(const this_type &, DATATYPE &)> read_cb) { rd_cb = read_cb; }
void set_read_cb(std::function<bool(const this_type &, DATATYPE &)> read_cb) {
rd_cb = [read_cb](const this_type &reg, DATATYPE &data, sc_core::sc_time delay) { return read_cb(reg, data); };
}
/**
*
* @param read_cb
*/
void set_read_cb(std::function<bool(const this_type &, DATATYPE &, sc_core::sc_time)> read_cb) { rd_cb = read_cb; }
/**
*
* @param write_cb
*/
void set_write_cb(std::function<bool(this_type &, DATATYPE &)> write_cb) { wr_cb = write_cb; }
void set_write_cb(std::function<bool(this_type &, DATATYPE &)> write_cb) {
wr_cb = [write_cb](this_type &reg, DATATYPE &data, sc_core::sc_time delay) { return write_cb(reg, data); };
}
/**
*
* @param write_cb
*/
void set_write_cb(std::function<bool(this_type &, DATATYPE &, sc_core::sc_time)> write_cb) { wr_cb = write_cb; }
/**
*
* @param trf
*/
void trace(sc_core::sc_trace_file *trf) override { sc_trace(trf, storage, this->name()); }
void trace(sc_core::sc_trace_file *trf) const override { sc_trace(trf, storage, this->name()); }
const DATATYPE res_val;
const DATATYPE rdmask;
@ -217,11 +234,11 @@ public:
private:
DATATYPE &storage;
std::function<bool(const this_type &, DATATYPE &)> rd_cb;
std::function<bool(this_type &, DATATYPE &)> wr_cb;
std::function<bool(const this_type &, DATATYPE &, sc_core::sc_time)> rd_cb;
std::function<bool(this_type &, DATATYPE &, sc_core::sc_time)> wr_cb;
util::delegate<bool(const this_type &, DATATYPE &)> rd_dlgt;
util::delegate<bool(this_type &, DATATYPE &)> wr_dlgt;
util::delegate<bool(const this_type &, DATATYPE &, sc_core::sc_time)> rd_dlgt;
util::delegate<bool(this_type &, DATATYPE &, sc_core::sc_time)> wr_dlgt;
};
}
@ -236,9 +253,10 @@ public:
using pointer = value_type *;
sc_register_indexed(sc_core::sc_module_name nm, std::array<DATATYPE, SIZE> &storage, const DATATYPE reset_val,
resetable &owner, BASE_DATA_TYPE rdmask = std::numeric_limits<BASE_DATA_TYPE>::is_signed
? -1
: std::numeric_limits<BASE_DATA_TYPE>::max(),
resetable &owner,
BASE_DATA_TYPE rdmask = std::numeric_limits<BASE_DATA_TYPE>::is_signed
? -1
: std::numeric_limits<BASE_DATA_TYPE>::max(),
BASE_DATA_TYPE wrmask = std::numeric_limits<BASE_DATA_TYPE>::is_signed
? -1
: std::numeric_limits<BASE_DATA_TYPE>::max()) {
@ -252,9 +270,8 @@ public:
}
~sc_register_indexed() override {
for (size_t idx = START; idx < (START + SIZE); ++idx) {
(_reg_field + idx)->~sc_register<DATATYPE>();
}
// for (size_t idx = START; idx < (START + SIZE); ++idx)
// (_reg_field + idx)->~sc_register<DATATYPE>();
free(_reg_field);
}
@ -264,10 +281,18 @@ public:
for (std::unique_ptr<sc_register<DATATYPE>> reg : *this) reg->add_read_cb(read_cb);
}
void set_read_cb(std::function<bool(const sc_register<DATATYPE> &, DATATYPE &, sc_core::sc_time)> read_cb) {
for (std::unique_ptr<sc_register<DATATYPE>> reg : *this) reg->add_read_cb(read_cb);
}
void set_write_cb(std::function<bool(sc_register<DATATYPE> &, DATATYPE &)> write_cb) {
for (std::unique_ptr<sc_register<DATATYPE>> reg : *this) reg->add_write_cb(write_cb);
}
void set_write_cb(std::function<bool(sc_register<DATATYPE> &, DATATYPE &, sc_core::sc_time)> write_cb) {
for (std::unique_ptr<sc_register<DATATYPE>> reg : *this) reg->add_write_cb(write_cb);
}
// Element access.
indexed_resource_access_if::reference operator[](size_t __n) noexcept override { return *(_reg_field + __n); }

+ 50
- 62
incl/scc/report.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,86 +23,74 @@
#ifndef _SYSC_REPORT_H_
#define _SYSC_REPORT_H_
#include "utilities.h"
#include <iomanip>
#include <sstream>
#include <sysc/kernel/sc_time.h>
#include <sysc/utils/sc_report.h>
#include <util/logging.h>
#include "scc/utilities.h"
namespace logging {
class SystemC {};
}
namespace scc {
namespace log = logging;
/**
*
* initializes the SystemC logging system to use logging::Logger with a particular logging level
*/
void init_logging();
void init_logging(logging::log_level level = logging::WARNING);
/**
*
*/
template <typename T> class Log : public log::Log<T> {
public:
Log() = default;
template <sc_core::sc_severity SEVERITY> struct ScLogger {
ScLogger(const char *file, int line, sc_core::sc_verbosity level = sc_core::SC_MEDIUM)
: t(nullptr)
, file(file)
, line(line)
, level(level){};
Log(const Log &) = delete;
ScLogger() = delete;
Log &operator=(const Log &) = delete;
ScLogger(const ScLogger &) = delete;
/**
*
* @param level
* @return
*/
std::ostringstream &get(log::log_level level = log::INFO, const char *category = "") {
std::ios init(NULL);
init.copyfmt(this->os);
if (this->print_time()) this->os << "- " << log::now_time();
if (this->print_severity()) {
this->os << " " << std::setw(7) << std::left << this->to_string(level);
// if (strlen(category))
// this->os << "[" << std::setw(10) << category<<"]";
// else
// this->os << " ";
this->os << std::right;
}
this->os << " [" << std::setw(20) << sc_core::sc_time_stamp() << "] ";
this->os.copyfmt(init);
log::Log<T>::get_last_log_level() = level;
return this->os;
};
};
ScLogger &operator=(const ScLogger &) = delete;
template <typename CATEGORY = log::SystemC> class FILELOG_DECLSPEC Logger : public Log<log::Output2FILE<CATEGORY>> {
public:
/**
*
*
* @return
*/
static log::log_level &reporting_level() {
static std::once_flag once;
std::call_once(once, []() { init_logging(); });
return log::Log<log::Output2FILE<log::SystemC>>::reporting_level();
virtual ~ScLogger() {
::sc_core::sc_report_handler::report(SEVERITY, t ? t : "SystemC", os.str().c_str(), level, file, line);
}
};
}
#ifdef LOG
#undef LOG
#endif
#define LOG(LEVEL) \
if (logging::LEVEL <= logging::Log<logging::Output2FILE<logging::SystemC>>::reporting_level() && \
LOG_OUTPUT(SystemC)::stream()) \
scc::Log<logging::Output2FILE<logging::SystemC>>().get(logging::LEVEL, "SystemC")
inline ScLogger &type() { return *this; }
#ifdef CLOG
#undef CLOG
#endif
#define CLOG(LEVEL, CATEGORY) \
if (logging::LEVEL <= LOGGER(CATEGORY)::reporting_level() && LOG_OUTPUT(CATEGORY)::stream()) \
scc::Log<logging::Output2FILE<logging::CATEGORY>>().get(logging::LEVEL, #CATEGORY)
inline ScLogger &type(const char *t) {
this->t = const_cast<char *>(t);
return *this;
}
inline std::ostringstream &get() { return os; };
protected:
std::ostringstream os;
char *t;
const char *file;
const int line;
const sc_core::sc_verbosity level;
};
#define SCDBGTRC(...) \
if (::sc_core::sc_report_handler::get_verbosity_level() >= sc_core::SC_DEBUG) \
::scc::ScLogger<::sc_core::SC_INFO>(__FILE__, __LINE__, sc_core::SC_DEBUG).type(__VA_ARGS__).get()
#define SCTRACE(...) \
if (::sc_core::sc_report_handler::get_verbosity_level() >= sc_core::SC_FULL) \
::scc::ScLogger<::sc_core::SC_INFO>(__FILE__, __LINE__, sc_core::SC_FULL).type(__VA_ARGS__).get()
#define SCDEBUG(...) \
if (::sc_core::sc_report_handler::get_verbosity_level() >= sc_core::SC_HIGH) \
::scc::ScLogger<::sc_core::SC_INFO>(__FILE__, __LINE__, sc_core::SC_HIGH).type(__VA_ARGS__).get()
#define SCINFO(...) \
if (::sc_core::sc_report_handler::get_verbosity_level() >= sc_core::SC_MEDIUM) \
::scc::ScLogger<::sc_core::SC_INFO>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
#define SCWARN(...) \
::scc::ScLogger<::sc_core::SC_WARNING>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
#define SCERR(...) ::scc::ScLogger<::sc_core::SC_ERROR>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
#define SCFATAL(...) \
::scc::ScLogger<::sc_core::SC_FATAL>(__FILE__, __LINE__, sc_core::SC_MEDIUM).type(__VA_ARGS__).get()
}
#endif /* _SYSC_REPORT_H_ */

+ 2
- 2
incl/scc/resetable.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,8 +23,8 @@
#ifndef _SYSC_RESETTABLE_H_
#define _SYSC_RESETTABLE_H_
#include "resource_access_if.h"
#include <vector>
#include "scc/resource_access_if.h"
namespace scc {

+ 6
- 3
incl/scc/resource_access_if.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,6 +25,7 @@
#include <cstddef>
#include <cstdint>
#include <sysc/kernel/sc_time.h>
namespace scc {
@ -51,7 +52,8 @@ public:
* @param offset
* @return
*/
virtual bool write(const uint8_t *data, std::size_t length, uint64_t offset = 0) = 0;
virtual bool write(const uint8_t *data, std::size_t length, uint64_t offset = 0,
sc_core::sc_time d = sc_core::SC_ZERO_TIME) = 0;
/**
*
* @param data
@ -59,7 +61,8 @@ public:
* @param offset
* @return
*/
virtual bool read(uint8_t *data, std::size_t length, uint64_t offset = 0) const = 0;
virtual bool read(uint8_t *data, std::size_t length, uint64_t offset = 0,
sc_core::sc_time d = sc_core::SC_ZERO_TIME) const = 0;
// non-functional/debug accesses
/**
*

+ 49
- 15
incl/scc/router.h View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016 MINRES Technologies GmbH
* Copyright 2016, 2018 MINRES Technologies GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -23,15 +23,16 @@
#ifndef _SYSC_ROUTER_H_
#define _SYSC_ROUTER_H_
#include "util/range_lut.h"
#include "scc/utilities.h"
#include "initiator_mixin.h"
#include "scv4tlm/tlm_rec_initiator_socket.h"
#include "scv4tlm/tlm_rec_target_socket.h"
#include "scc/initiator_mixin.h"
#include "scc/target_mixin.h"
#include "target_mixin.h"
#include "util/range_lut.h"
#include "utilities.h"
#include <limits>
#include <sysc/utils/sc_vector.h>
#include <tlm.h>
#include <limits>
#include <unordered_map>
namespace scc {
@ -68,9 +69,14 @@ public:
*
* @param idx
*/
void set_default_target(size_t idx) { default_idx = idx; }
// bind target socket hierarchically
/**
* establish a mapping between socket naem name