Merge branch 'master' into develop
Conflicts: .cproject .settings/language.settings.xml CMakeLists.txt examples/simple_system/gpio.cpp examples/simple_system/plic.cpp sc-components
This commit is contained in:
commit
406e04377d
|
@ -1,5 +1,8 @@
|
||||||
[submodule "sc-components"]
|
[submodule "sc-components"]
|
||||||
path = sc-components
|
path = sc-components
|
||||||
url = https://git.minres.com/SystemC/SystemC-Components.git
|
url = https://github.com/Minres/SystemC-Components.git
|
||||||
branch = master
|
branch = main
|
||||||
|
|
||||||
|
[submodule "scc"]
|
||||||
|
path = scc
|
||||||
|
url = https://github.com/Minres/SystemC-Components.git
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1298439859859319129" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1471514668944563477" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1298439859859319129" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1471514668944563477" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1298439859859319129" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1471514668944563477" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
|
@ -43,11 +43,11 @@
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
|
||||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1298439859859319129" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1471514668944563477" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
</provider>
|
</provider>
|
||||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
</extension>
|
</extension>
|
||||||
</configuration>
|
</configuration>
|
||||||
</project>
|
</project>
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.12)
|
cmake_minimum_required(VERSION 3.12)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/scc/cmake)
|
||||||
|
|
||||||
project(SCC_Test)
|
project(SCC_Test)
|
||||||
|
|
||||||
|
@ -11,10 +11,10 @@ set(NO_SUBMODULE_CHECK FALSE CACHE BOOL "Disable the submodule check")
|
||||||
|
|
||||||
set(ENABLE_CLANG_TIDY FALSE CACHE BOOL "Enable clang-tidy checks")
|
set(ENABLE_CLANG_TIDY FALSE CACHE BOOL "Enable clang-tidy checks")
|
||||||
include(GitFunctions)
|
include(GitFunctions)
|
||||||
get_branch_from_git()
|
get_info_from_git()
|
||||||
|
|
||||||
### set the directory names of the submodules
|
### set the directory names of the submodules
|
||||||
set(GIT_SUBMODULES sc-components)
|
set(GIT_SUBMODULES scc)
|
||||||
set(GIT_SUBMODULE_DIR_sc-components .)
|
set(GIT_SUBMODULE_DIR_sc-components .)
|
||||||
### set each submodules's commit or tag that is to be checked out
|
### set each submodules's commit or tag that is to be checked out
|
||||||
### (leave empty if you want master)
|
### (leave empty if you want master)
|
||||||
|
@ -75,7 +75,7 @@ else()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
setup_conan()
|
setup_conan(TARGETS)
|
||||||
|
|
||||||
# This line finds the boost lib and headers.
|
# This line finds the boost lib and headers.
|
||||||
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
||||||
|
@ -89,7 +89,7 @@ endif()
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
add_subdirectory(sc-components)
|
add_subdirectory(scc)
|
||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#%Module######################################################################
|
||||||
|
##
|
||||||
|
## Project Module
|
||||||
|
##
|
||||||
|
proc ModulesHelp { } {
|
||||||
|
puts stderr "\tThe SCC Tests Project Module\n"
|
||||||
|
puts stderr "\tThis module loads PATHs and variables for SCC tests."
|
||||||
|
}
|
||||||
|
|
||||||
|
set distro [exec /bin/lsb_release -i -s]
|
||||||
|
if { $distro == "CentOS" && ![info exists ::env(PROJECT)] && ![info exists ::env(PCP_DIR)] } {
|
||||||
|
puts stderr "Don't forget to execute 'scl enable devtoolset-7 llvm-toolset-7 bash'"
|
||||||
|
}
|
||||||
|
|
||||||
|
module load tools/cmake
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Function to link between sub-projects
|
|
||||||
function(add_dependent_subproject subproject_name)
|
|
||||||
#if (NOT TARGET ${subproject_name}) # target unknown
|
|
||||||
if(NOT PROJECT_${subproject_name}) # var unknown because we build only this subproject
|
|
||||||
find_package(${subproject_name} CONFIG REQUIRED)
|
|
||||||
else () # we know the target thus we are doing a build from the top directory
|
|
||||||
include_directories(../${subproject_name}/incl)
|
|
||||||
endif ()
|
|
||||||
endfunction(add_dependent_subproject)
|
|
||||||
|
|
||||||
# Make sure we tell the topdir CMakeLists that we exist (if build from topdir)
|
|
||||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
|
||||||
if(hasParent)
|
|
||||||
set(PROJECT_${PROJECT_NAME} true PARENT_SCOPE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Function to link between sub-projects
|
|
||||||
function(add_dependent_header subproject_name)
|
|
||||||
include_directories(../${subproject_name}/incl)
|
|
||||||
endfunction(add_dependent_header)
|
|
|
@ -1,24 +0,0 @@
|
||||||
function(PrepareDocTarget)
|
|
||||||
|
|
||||||
# Configure the doxygen config file with current settings:
|
|
||||||
configure_file(documentation-config.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/documentation-config.doxygen @ONLY)
|
|
||||||
|
|
||||||
# Set the name of the target : "doc" if it doesn't already exist and "doc<projectname>" if it does.
|
|
||||||
# This way we make sure to have a single "doc" target. Either it is the one of the top directory or
|
|
||||||
# it is the one of the subproject that we are compiling alone.
|
|
||||||
set(DOC_TARGET_NAME "doc")
|
|
||||||
if(TARGET doc)
|
|
||||||
set(DOC_TARGET_NAME "doc${PROJECT_NAME}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_custom_target(${DOC_TARGET_NAME} ${TARGET_ALL}
|
|
||||||
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/documentation-config.doxygen
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
COMMENT "Generating API documentation using doxygen for ${PROJECT_NAME}" VERBATIM)
|
|
||||||
|
|
||||||
set(INSTALL_DOC_DIR ${CMAKE_BINARY_DIR}/doc/${PROJECT_NAME}/html)
|
|
||||||
file(MAKE_DIRECTORY ${INSTALL_DOC_DIR}) # needed for install
|
|
||||||
|
|
||||||
install(DIRECTORY ${INSTALL_DOC_DIR} DESTINATION share/${PROJECT_NAME}-${VERSION_MAJOR} COMPONENT doc)
|
|
||||||
|
|
||||||
endfunction()
|
|
|
@ -1,22 +0,0 @@
|
||||||
if(__git_functions)
|
|
||||||
return()
|
|
||||||
endif()
|
|
||||||
set(__git_functions YES)
|
|
||||||
|
|
||||||
function( get_branch_from_git )
|
|
||||||
execute_process(
|
|
||||||
COMMAND git rev-parse --abbrev-ref HEAD
|
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
||||||
RESULT_VARIABLE git_result
|
|
||||||
OUTPUT_VARIABLE git_branch
|
|
||||||
ERROR_VARIABLE git_error
|
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
||||||
ERROR_STRIP_TRAILING_WHITESPACE
|
|
||||||
)
|
|
||||||
if( NOT git_result EQUAL 0 )
|
|
||||||
message( FATAL_ERROR "Failed to execute Git: ${git_error}" )
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set( GIT_BRANCH ${git_branch} PARENT_SCOPE )
|
|
||||||
endfunction( get_branch_from_git )
|
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
[requires]
|
[requires]
|
||||||
gsl_microsoft/20180102@bincrafters/stable
|
|
||||||
fmt/6.1.2
|
fmt/6.1.2
|
||||||
SystemCVerification/2.0.1@minres/stable
|
boost/1.75.0
|
||||||
SystemC-CCI/1.0.0@minres/stable
|
gsl-lite/0.37.0
|
||||||
|
systemc/2.3.3
|
||||||
|
#systemc-scv/2.0.1
|
||||||
|
systemc-cci/1.0.0
|
||||||
|
|
||||||
[generators]
|
[generators]
|
||||||
cmake
|
cmake
|
||||||
txt
|
|
||||||
|
|
||||||
[options]
|
[options]
|
||||||
fmt:header_only=True
|
fmt:header_only=True
|
||||||
SystemCVerification:stdcxx=11
|
|
||||||
SystemC-CCI:stdcxx=11
|
|
|
@ -7,4 +7,4 @@ add_executable (ahb_bfm
|
||||||
# Link the executable to the sc_components library. Since the sc_components library has
|
# Link the executable to the sc_components library. Since the sc_components library has
|
||||||
# public include directories we will use those link directories when building
|
# public include directories we will use those link directories when building
|
||||||
# transaction_recording
|
# transaction_recording
|
||||||
target_link_libraries (ahb_bfm LINK_PUBLIC scc ${CONAN_LIBS})
|
target_link_libraries (ahb_bfm LINK_PUBLIC scc)
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
#include <tlm/ahb/bfm/initiator.h>
|
#include <ahb/bfm/initiator.h>
|
||||||
#include <tlm/ahb/bfm/target.h>
|
#include <ahb/bfm/target.h>
|
||||||
#include <scc/initiator_mixin.h>
|
#include <tlm/scc/initiator_mixin.h>
|
||||||
#include <scc/target_mixin.h>
|
#include <tlm/scc/target_mixin.h>
|
||||||
#include <scc/configurable_tracer.h>
|
#include <scc/configurable_tracer.h>
|
||||||
#include <scc/configurer.h>
|
#include <scc/configurer.h>
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <scc/scv_tr_db.h>
|
|
||||||
#include <scc/tracer.h>
|
#include <scc/tracer.h>
|
||||||
#include <scc/traceable.h>
|
#include <scc/traceable.h>
|
||||||
#include <scv.h>
|
|
||||||
#include <cci_utils/broker.h>
|
#include <cci_utils/broker.h>
|
||||||
#include <iostream>
|
#include <fstream>
|
||||||
|
|
||||||
using namespace sc_core;
|
using namespace sc_core;
|
||||||
using namespace scc;
|
using namespace scc;
|
||||||
|
@ -18,8 +16,8 @@ using namespace scc;
|
||||||
class testbench: public sc_module, public scc::traceable {
|
class testbench: public sc_module, public scc::traceable {
|
||||||
public:
|
public:
|
||||||
enum { WIDTH=64};
|
enum { WIDTH=64};
|
||||||
scc::initiator_mixin<tlm::tlm_initiator_socket<WIDTH>> isck{"isck"};
|
tlm::scc::initiator_mixin<tlm::tlm_initiator_socket<WIDTH>> isck{"isck"};
|
||||||
tlm::ahb::bfm::initiator<WIDTH> intor{"intor"};
|
ahb::bfm::initiator<WIDTH> intor{"intor"};
|
||||||
sc_core::sc_clock HCLK{"HCLK", 10_ns};
|
sc_core::sc_clock HCLK{"HCLK", 10_ns};
|
||||||
sc_core::sc_signal<bool> HRESETn{"HRESETn"};
|
sc_core::sc_signal<bool> HRESETn{"HRESETn"};
|
||||||
sc_core::sc_signal<sc_dt::sc_uint<32>> HADDR{"HADDR"};
|
sc_core::sc_signal<sc_dt::sc_uint<32>> HADDR{"HADDR"};
|
||||||
|
@ -35,8 +33,8 @@ public:
|
||||||
sc_core::sc_signal<bool> HRESP{"HRESP"};
|
sc_core::sc_signal<bool> HRESP{"HRESP"};
|
||||||
sc_core::sc_signal<bool> HSEL{"HSEL"};
|
sc_core::sc_signal<bool> HSEL{"HSEL"};
|
||||||
|
|
||||||
tlm::ahb::bfm::target<WIDTH> target{"target"};
|
ahb::bfm::target<WIDTH> target{"target"};
|
||||||
scc::target_mixin<tlm::tlm_target_socket<WIDTH>> tsck{"tsck"};
|
tlm::scc::target_mixin<tlm::tlm_target_socket<WIDTH>> tsck{"tsck"};
|
||||||
|
|
||||||
testbench(sc_module_name nm):sc_module(nm){
|
testbench(sc_module_name nm):sc_module(nm){
|
||||||
SC_HAS_PROCESS(testbench);
|
SC_HAS_PROCESS(testbench);
|
||||||
|
|
|
@ -63,7 +63,7 @@ gpio::gpio(sc_module_name nm)
|
||||||
SC_METHOD(reset_cb);
|
SC_METHOD(reset_cb);
|
||||||
sensitive << rst_i;
|
sensitive << rst_i;
|
||||||
dont_initialize();
|
dont_initialize();
|
||||||
auto pins_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
|
auto pins_i_cb =[this](unsigned int tag, tlm::scc::tlm_signal_gp<>& gp,
|
||||||
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
||||||
this->pin_input(tag, gp, delay);
|
this->pin_input(tag, gp, delay);
|
||||||
return tlm::TLM_COMPLETED;
|
return tlm::TLM_COMPLETED;
|
||||||
|
@ -73,7 +73,7 @@ gpio::gpio(sc_module_name nm)
|
||||||
s.register_nb_transport(pins_i_cb, i);
|
s.register_nb_transport(pins_i_cb, i);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
auto iof0_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
|
auto iof0_i_cb =[this](unsigned int tag, tlm::scc::tlm_signal_gp<>& gp,
|
||||||
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
||||||
last_iof0[tag]=gp.get_value();
|
last_iof0[tag]=gp.get_value();
|
||||||
this->iof_input(tag, 0, gp, delay);
|
this->iof_input(tag, 0, gp, delay);
|
||||||
|
@ -84,7 +84,7 @@ gpio::gpio(sc_module_name nm)
|
||||||
s.register_nb_transport(iof0_i_cb, i);
|
s.register_nb_transport(iof0_i_cb, i);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
auto iof1_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
|
auto iof1_i_cb =[this](unsigned int tag, tlm::scc::tlm_signal_gp<>& gp,
|
||||||
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
|
||||||
last_iof1[tag]=gp.get_value();
|
last_iof1[tag]=gp.get_value();
|
||||||
this->iof_input(tag, 1, gp, delay);
|
this->iof_input(tag, 1, gp, delay);
|
||||||
|
@ -125,7 +125,7 @@ void gpio::clock_cb() {
|
||||||
this->clk = clk_i.read();
|
this->clk = clk_i.read();
|
||||||
}
|
}
|
||||||
|
|
||||||
tlm::tlm_phase gpio::write_output(tlm::tlm_signal_gp<bool>& gp, size_t i, bool val) {
|
tlm::tlm_phase gpio::write_output(tlm::scc::tlm_signal_gp<bool>& gp, size_t i, bool val) {
|
||||||
sc_time delay{SC_ZERO_TIME};
|
sc_time delay{SC_ZERO_TIME};
|
||||||
tlm::tlm_phase phase{ tlm::BEGIN_REQ };
|
tlm::tlm_phase phase{ tlm::BEGIN_REQ };
|
||||||
gp.set_command(tlm::TLM_WRITE_COMMAND);
|
gp.set_command(tlm::TLM_WRITE_COMMAND);
|
||||||
|
@ -137,7 +137,7 @@ tlm::tlm_phase gpio::write_output(tlm::tlm_signal_gp<bool>& gp, size_t i, bool v
|
||||||
|
|
||||||
void gpio::update_pins(uint32_t changed_bits) {
|
void gpio::update_pins(uint32_t changed_bits) {
|
||||||
sc_inout_rv<32>::data_type out_val;
|
sc_inout_rv<32>::data_type out_val;
|
||||||
tlm::tlm_signal_gp<bool> gp;
|
tlm::scc::tlm_signal_gp<bool> gp;
|
||||||
bool val{false};
|
bool val{false};
|
||||||
for(size_t i=0, mask = 1; i<32; ++i, mask<<=1){
|
for(size_t i=0, mask = 1; i<32; ++i, mask<<=1){
|
||||||
if(changed_bits&mask){
|
if(changed_bits&mask){
|
||||||
|
@ -159,7 +159,7 @@ void gpio::update_pins(uint32_t changed_bits) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio::pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp, sc_time& delay) {
|
void gpio::pin_input(unsigned int tag, tlm::scc::tlm_signal_gp<bool>& gp, sc_time& delay) {
|
||||||
if(delay>SC_ZERO_TIME){
|
if(delay>SC_ZERO_TIME){
|
||||||
wait(delay);
|
wait(delay);
|
||||||
delay=SC_ZERO_TIME;
|
delay=SC_ZERO_TIME;
|
||||||
|
@ -174,11 +174,11 @@ void gpio::pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp, sc_time& de
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio::forward_pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp) {
|
void gpio::forward_pin_input(unsigned int tag, tlm::scc::tlm_signal_gp<bool>& gp) {
|
||||||
const auto mask = 1U<<tag;
|
const auto mask = 1U<<tag;
|
||||||
if(regs->iof_en&mask){
|
if(regs->iof_en&mask){
|
||||||
auto& socket = regs->iof_sel&mask?iof1_o[tag]:iof0_o[tag];
|
auto& socket = regs->iof_sel&mask?iof1_o[tag]:iof0_o[tag];
|
||||||
tlm::tlm_signal_gp<> new_gp;
|
tlm::scc::tlm_signal_gp<> new_gp;
|
||||||
for(size_t i=0; i<socket.size(); ++i){
|
for(size_t i=0; i<socket.size(); ++i){
|
||||||
sc_time delay{SC_ZERO_TIME};
|
sc_time delay{SC_ZERO_TIME};
|
||||||
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
||||||
|
@ -191,7 +191,7 @@ void gpio::forward_pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gpio::iof_input(unsigned int tag, unsigned iof_idx, tlm::tlm_signal_gp<>& gp, sc_time& delay) {
|
void gpio::iof_input(unsigned int tag, unsigned iof_idx, tlm::scc::tlm_signal_gp<>& gp, sc_time& delay) {
|
||||||
if(delay>SC_ZERO_TIME){
|
if(delay>SC_ZERO_TIME){
|
||||||
wait(delay);
|
wait(delay);
|
||||||
delay=SC_ZERO_TIME;
|
delay=SC_ZERO_TIME;
|
||||||
|
@ -204,7 +204,7 @@ void gpio::iof_input(unsigned int tag, unsigned iof_idx, tlm::tlm_signal_gp<>& g
|
||||||
for(size_t i=0; i<socket.size(); ++i){
|
for(size_t i=0; i<socket.size(); ++i){
|
||||||
sc_time delay{SC_ZERO_TIME};
|
sc_time delay{SC_ZERO_TIME};
|
||||||
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
||||||
tlm::tlm_signal_gp<> new_gp;
|
tlm::scc::tlm_signal_gp<> new_gp;
|
||||||
new_gp.set_command(tlm::TLM_WRITE_COMMAND);
|
new_gp.set_command(tlm::TLM_WRITE_COMMAND);
|
||||||
auto val = gp.get_value();
|
auto val = gp.get_value();
|
||||||
new_gp.set_value(val);
|
new_gp.set_value(val);
|
||||||
|
|
|
@ -38,9 +38,9 @@
|
||||||
#define _GPIO_H_
|
#define _GPIO_H_
|
||||||
|
|
||||||
#include "scc/tlm_target.h"
|
#include "scc/tlm_target.h"
|
||||||
#include "scc/signal_target_mixin.h"
|
#include "tlm/scc/signal_target_mixin.h"
|
||||||
#include "scc/signal_initiator_mixin.h"
|
#include "tlm/scc/signal_initiator_mixin.h"
|
||||||
#include <tlm/tlm_signal.h>
|
#include <tlm/scc/tlm_signal.h>
|
||||||
|
|
||||||
namespace sysc {
|
namespace sysc {
|
||||||
|
|
||||||
|
@ -54,13 +54,13 @@ public:
|
||||||
sc_core::sc_in<bool> rst_i;
|
sc_core::sc_in<bool> rst_i;
|
||||||
// sc_core::sc_inout_rv<32> pins_io;
|
// sc_core::sc_inout_rv<32> pins_io;
|
||||||
|
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_out> pins_o;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_out> pins_o;
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_in> pins_i;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_in> pins_i;
|
||||||
|
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_opt_out> iof0_o;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_opt_out> iof0_o;
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_opt_out> iof1_o;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_opt_out> iof1_o;
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_opt_in> iof0_i;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_opt_in> iof0_i;
|
||||||
sc_core::sc_vector<scc::tlm_signal_bool_opt_in> iof1_i;
|
sc_core::sc_vector<tlm::scc::tlm_signal_bool_opt_in> iof1_i;
|
||||||
|
|
||||||
gpio(sc_core::sc_module_name nm);
|
gpio(sc_core::sc_module_name nm);
|
||||||
virtual ~gpio() override; // need to keep it in source file because of fwd declaration of gpio_regs
|
virtual ~gpio() override; // need to keep it in source file because of fwd declaration of gpio_regs
|
||||||
|
@ -69,16 +69,16 @@ protected:
|
||||||
void clock_cb();
|
void clock_cb();
|
||||||
void reset_cb();
|
void reset_cb();
|
||||||
void update_pins(uint32_t changed_bits);
|
void update_pins(uint32_t changed_bits);
|
||||||
void pin_input(unsigned int tag, tlm::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
|
void pin_input(unsigned int tag, tlm::scc::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
|
||||||
void forward_pin_input(unsigned int tag, tlm::tlm_signal_gp<>& gp);
|
void forward_pin_input(unsigned int tag, tlm::scc::tlm_signal_gp<>& gp);
|
||||||
void iof_input(unsigned int tag, unsigned iof_idx, tlm::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
|
void iof_input(unsigned int tag, unsigned iof_idx, tlm::scc::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
|
||||||
sc_core::sc_time clk;
|
sc_core::sc_time clk;
|
||||||
std::array<bool, 32> last_iof0, last_iof1;
|
std::array<bool, 32> last_iof0, last_iof1;
|
||||||
std::unique_ptr<gpio_regs> regs;
|
std::unique_ptr<gpio_regs> regs;
|
||||||
std::shared_ptr<sysc::WsHandler> handler;
|
std::shared_ptr<sysc::WsHandler> handler;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
tlm::tlm_phase write_output(tlm::tlm_signal_gp<>& gp, size_t i, bool val);
|
tlm::tlm_phase write_output(tlm::scc::tlm_signal_gp<>& gp, size_t i, bool val);
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace sysc */
|
} /* namespace sysc */
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
|
|
||||||
#include "simple_system.h"
|
#include "simple_system.h"
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <scc/scv_tr_db.h>
|
|
||||||
#include <scc/tracer.h>
|
#include <scc/tracer.h>
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ public:
|
||||||
sc_core::sc_signal<bool> s_rst;
|
sc_core::sc_signal<bool> s_rst;
|
||||||
sc_core::sc_vector<sc_core::sc_signal<bool>> s_global_interrupts;
|
sc_core::sc_vector<sc_core::sc_signal<bool>> s_global_interrupts;
|
||||||
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> s_core_interrupt;
|
sc_core::sc_signal<bool, sc_core::SC_MANY_WRITERS> s_core_interrupt;
|
||||||
sc_core::sc_vector<tlm::tlm_signal<>> s_gpio;
|
sc_core::sc_vector<tlm::scc::tlm_signal<>> s_gpio;
|
||||||
|
|
||||||
simple_system(sc_core::sc_module_name nm);
|
simple_system(sc_core::sc_module_name nm);
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 3192c9cc2169b18ee7e1cd2c9fbb92d04887e7ac
|
|
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 2a11251ae63f3470245e13f4f576e4c93d2f243c
|
|
@ -21,7 +21,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <scc/scv_tr_db.h>
|
|
||||||
#include <scc/tracer.h>
|
#include <scc/tracer.h>
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
#include <scc/ordered_semaphore.h>
|
#include <scc/ordered_semaphore.h>
|
||||||
|
@ -50,7 +49,7 @@ private:
|
||||||
sem_t.set_capacity(4);
|
sem_t.set_capacity(4);
|
||||||
sem_t.post();
|
sem_t.post();
|
||||||
sem.post();
|
sem.post();
|
||||||
sc_stop();
|
sc_core::sc_stop();
|
||||||
}
|
}
|
||||||
scc::ordered_semaphore sem{"sem", 2};
|
scc::ordered_semaphore sem{"sem", 2};
|
||||||
scc::ordered_semaphore_t<2> sem_t{"sem_t"};
|
scc::ordered_semaphore_t<2> sem_t{"sem_t"};
|
||||||
|
@ -103,8 +102,8 @@ int sc_main(int argc, char *argv[]) {
|
||||||
SCCERR() << "simulation timed out";
|
SCCERR() << "simulation timed out";
|
||||||
sc_core::sc_stop();
|
sc_core::sc_stop();
|
||||||
}
|
}
|
||||||
auto errcnt = sc_report_handler::get_count(SC_ERROR);
|
auto errcnt = sc_core::sc_report_handler::get_count(sc_core::SC_ERROR);
|
||||||
auto warncnt = sc_report_handler::get_count(SC_WARNING);
|
auto warncnt = sc_core::sc_report_handler::get_count(sc_core::SC_WARNING);
|
||||||
SCCINFO() << "Finished, there were " << errcnt << " error" << (errcnt == 1 ? "" : "s") << " and " << warncnt << " warning"
|
SCCINFO() << "Finished, there were " << errcnt << " error" << (errcnt == 1 ? "" : "s") << " and " << warncnt << " warning"
|
||||||
<< (warncnt == 1 ? "" : "s, 1 warning expected");
|
<< (warncnt == 1 ? "" : "s, 1 warning expected");
|
||||||
return errcnt + (warncnt-1);
|
return errcnt + (warncnt-1);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "pkt_sender.h"
|
#include "pkt_sender.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <tlm/tlm_mm.h>
|
#include <tlm/scc/tlm_mm.h>
|
||||||
|
|
||||||
using namespace sc_core;
|
using namespace sc_core;
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ void pkt_sender::gen_routing(std::vector<uint8_t> &route_vec) {
|
||||||
void pkt_sender::run() {
|
void pkt_sender::run() {
|
||||||
wait(clk_i.posedge_event());
|
wait(clk_i.posedge_event());
|
||||||
for(auto i=0U; i<count; i++){
|
for(auto i=0U; i<count; i++){
|
||||||
tlm::tlm_generic_payload* gp = tlm::tlm_mm<>::get().allocate<packet_ext>();
|
tlm::tlm_generic_payload* gp = tlm::scc::tlm_mm<>::get().allocate<packet_ext>();
|
||||||
gen_routing(gp->get_extension<packet_ext>()->routing);
|
gen_routing(gp->get_extension<packet_ext>()->routing);
|
||||||
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
tlm::tlm_phase phase{tlm::BEGIN_REQ};
|
||||||
sc_time delay;
|
sc_time delay;
|
||||||
|
|
|
@ -10,15 +10,15 @@
|
||||||
|
|
||||||
#include <systemc>
|
#include <systemc>
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include <scc/initiator_mixin.h>
|
#include <tlm/scc/initiator_mixin.h>
|
||||||
#include <scc/target_mixin.h>
|
#include <tlm/scc/target_mixin.h>
|
||||||
|
|
||||||
|
|
||||||
class pkt_sender : sc_core::sc_module {
|
class pkt_sender : sc_core::sc_module {
|
||||||
public:
|
public:
|
||||||
sc_core::sc_in<bool> clk_i{"clk_i"};
|
sc_core::sc_in<bool> clk_i{"clk_i"};
|
||||||
scc::initiator_mixin<tlm::tlm_initiator_socket<32>> isck;
|
tlm::scc::initiator_mixin<tlm::tlm_initiator_socket<32>> isck;
|
||||||
scc::target_mixin<tlm::tlm_target_socket<32>> tsck;
|
tlm::scc::target_mixin<tlm::tlm_target_socket<32>> tsck;
|
||||||
pkt_sender(sc_core::sc_module_name const&, unsigned dim, unsigned pos_x, unsigned pos_y, unsigned count);
|
pkt_sender(sc_core::sc_module_name const&, unsigned dim, unsigned pos_x, unsigned pos_y, unsigned count);
|
||||||
virtual ~pkt_sender() = default;
|
virtual ~pkt_sender() = default;
|
||||||
sc_core::sc_event const& get_finish_event(){return finish_evt;}
|
sc_core::sc_event const& get_finish_event(){return finish_evt;}
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include "pkt_switch.h"
|
#include "pkt_switch.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
#include <tlm/tlm_mm.h>
|
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
|
|
||||||
using namespace sc_core;
|
using namespace sc_core;
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
#include <systemc>
|
#include <systemc>
|
||||||
#include "packet.h"
|
#include "packet.h"
|
||||||
#include <scc/tagged_initiator_mixin.h>
|
#include <tlm/scc/tagged_initiator_mixin.h>
|
||||||
#include <scc/tagged_target_mixin.h>
|
#include <tlm/scc/tagged_target_mixin.h>
|
||||||
#include <scc/sc_owning_signal.h>
|
#include <scc/sc_owning_signal.h>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ class pkt_switch : sc_core::sc_module {
|
||||||
public:
|
public:
|
||||||
enum {NONE=std::numeric_limits<unsigned>::max()};
|
enum {NONE=std::numeric_limits<unsigned>::max()};
|
||||||
sc_core::sc_in<bool> clk_i{"clk_i"};
|
sc_core::sc_in<bool> clk_i{"clk_i"};
|
||||||
sc_core::sc_vector<scc::tagged_target_mixin<tlm::tlm_target_socket<32>>> tsck{"tsck",4};
|
sc_core::sc_vector<tlm::scc::tagged_target_mixin<tlm::tlm_target_socket<32>>> tsck{"tsck",4};
|
||||||
sc_core::sc_vector<scc::tagged_initiator_mixin<tlm::tlm_initiator_socket<32>>> isck{"isck",4};
|
sc_core::sc_vector<tlm::scc::tagged_initiator_mixin<tlm::tlm_initiator_socket<32>>> isck{"isck",4};
|
||||||
pkt_switch(sc_core::sc_module_name const&);
|
pkt_switch(sc_core::sc_module_name const&);
|
||||||
virtual ~pkt_switch() = default;
|
virtual ~pkt_switch() = default;
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "top.h"
|
#include "top.h"
|
||||||
#include <scc/perf_estimator.h>
|
#include <scc/perf_estimator.h>
|
||||||
#include <scc/report.h>
|
#include <scc/report.h>
|
||||||
#include <scc/scv_tr_db.h>
|
|
||||||
#include <scc/tracer.h>
|
#include <scc/tracer.h>
|
||||||
#include <boost/program_options.hpp>
|
#include <boost/program_options.hpp>
|
||||||
|
|
||||||
|
@ -88,19 +87,19 @@ int sc_main(int argc, char *argv[]) {
|
||||||
// run simulation
|
// run simulation
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
sc_start(sc_core::sc_time(1, sc_core::SC_MS));
|
sc_start(sc_core::sc_time(1, sc_core::SC_MS));
|
||||||
if(sc_is_running()) {
|
if(sc_core::sc_is_running()) {
|
||||||
SCCERR() << "simulation timed out"; // calls sc_stop
|
SCCERR() << "simulation timed out"; // calls sc_stop
|
||||||
sc_core::sc_stop();
|
sc_core::sc_stop();
|
||||||
}
|
}
|
||||||
} catch(sc_report& e) {
|
} catch(sc_core::sc_report& e) {
|
||||||
SCCERR() << "Caught sc_report exception during simulation: " << e.what() << ":" << e.get_msg();
|
SCCERR() << "Caught sc_report exception during simulation: " << e.what() << ":" << e.get_msg();
|
||||||
} catch(std::exception& e) {
|
} catch(std::exception& e) {
|
||||||
SCCERR() << "Caught exception during simulation: " << e.what();
|
SCCERR() << "Caught exception during simulation: " << e.what();
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
SCCERR() << "Caught unspecified exception during simulation";
|
SCCERR() << "Caught unspecified exception during simulation";
|
||||||
}
|
}
|
||||||
auto errcnt = sc_report_handler::get_count(SC_ERROR);
|
auto errcnt = sc_core::sc_report_handler::get_count(sc_core::SC_ERROR);
|
||||||
auto warncnt = sc_report_handler::get_count(SC_WARNING);
|
auto warncnt = sc_core::sc_report_handler::get_count(sc_core::SC_WARNING);
|
||||||
SCCINFO() << "simulation finished, " << errcnt << " error" << (errcnt == 1 ? "" : "s") << " and " << warncnt << " warning"
|
SCCINFO() << "simulation finished, " << errcnt << " error" << (errcnt == 1 ? "" : "s") << " and " << warncnt << " warning"
|
||||||
<< (warncnt == 1 ? "" : "s");
|
<< (warncnt == 1 ? "" : "s");
|
||||||
return errcnt + warncnt;
|
return errcnt + warncnt;
|
||||||
|
|
Loading…
Reference in New Issue