Merge branch 'develop'

# Conflicts:
#	.cproject
#	.gitmodules
#	.settings/language.settings.xml
#	conanfile.txt
#	examples/simple_system/CMakeLists.txt
#	examples/simple_system/gen/e300_plat_t.h
#	examples/simple_system/gpio.cpp
#	examples/simple_system/plic.cpp
#	examples/simple_system/sc_main.cpp
#	examples/simple_system/simple_system.cpp
#	examples/transaction_recording/CMakeLists.txt
#	examples/transaction_recording/scv_tr_recording_example.cpp
This commit is contained in:
Eyck Jentzsch 2020-04-23 16:39:32 +02:00
commit bcea3ddf39
28 changed files with 810 additions and 438 deletions

362
.cproject
View File

@ -1,206 +1,296 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2088633632">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2088633632" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings>
<externalSetting>
<entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/SystemC-Components-Test"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/SystemC-Components-Test/build/Debug"/>
<entry flags="RESOLVED" kind="libraryFile" name="SystemC-Components-Test" srcPrefixMapping="" srcRootPath=""/>
</externalSetting>
</externalSettings>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="cdt.managedbuild.config.gnu.macosx.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.294919492" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.431503568" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/sc-components-test/}" id="de.marw.cdt.cmake.core.genscriptbuilder.649731186" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CMake Builder" parallelBuildOn="false" superClass="de.marw.cdt.cmake.core.genscriptbuilder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1722876084" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1937096603" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.1398860210" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${HOME}/.conan/data/SystemC/2.3.2/minres/stable/package/5da42a16f2fe7e4182d2c23eaed73d10d0bca3f4/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${HOME}/.conan/data/SystemCVerification/2.0.1/minres/stable/package/d9580b78ca474433b46b653ea2c6c83385840479/include&quot;"/>
<listOptionValue builtIn="false" value="&quot;${HOME}/.conan/data/SystemC-CCI/0.9.0/minres/stable/package/d9580b78ca474433b46b653ea2c6c83385840479/include&quot;"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.62636415" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="WITH_SCV"/>
</option>
<option id="gnu.cpp.compiler.option.optimization.level.1942034420" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.option.debugging.level.1510494821" name="Debug Level" superClass="gnu.cpp.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.803568785" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.sharedLib" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.sharedLib" description="" id="cdt.managedbuild.toolchain.gnu.base.2088633632" name="Debug" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2088633632.654284138" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.812439786" name="Linux GCC" nonInternalBuilderId="de.marw.cdt.cmake.core.genscriptbuilder" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.958806066" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="/SystemC-Components-Test/build/Debug" id="de.marw.cdt.cmake.core.genscriptbuilder.1812274003" keepEnvironmentInBuildfile="false" name="CMake Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="de.marw.cdt.cmake.core.genscriptbuilder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1152431980" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.2062399929" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.770113519" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.318007495" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1906356117" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.option.debugging.level.1659455273" name="Debug Level" superClass="gnu.c.compiler.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1732590288" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1686982336" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1800687036" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.706441092" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.264303412" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.libs.1865739110" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="systemc"/>
<listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="scv"/>
</option>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.link.option.paths.208272497" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="&quot;${SYSTEMC_HOME}/lib-linux64&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.291247993" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.554406388" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base">
<option defaultValue="true" id="gnu.c.link.option.shared.1649810515" name="Shared (-shared)" superClass="gnu.c.link.option.shared" valueType="boolean"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1953138424" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<option defaultValue="true" id="gnu.cpp.link.option.shared.982194157" name="Shared (-shared)" superClass="gnu.cpp.link.option.shared" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.928954566" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.1211993081" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1644645340" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.1364002333" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.846547799" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule buildDir="build/${ConfigName}" moduleId="de.marw.cdt.cmake.core.settings">
<options/>
<linux command="cmake" generator="UnixMakefiles" use-default="true">
<defs/>
<undefs/>
</linux>
<win32 command="cmake" generator="MinGWMakefiles" use-default="true">
<defs/>
<undefs/>
</win32>
<defs>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="${ConfigName}"/>
<def name="NO_SUBMODULE_CHECK" type="STRING" val="TRUE"/>
</defs>
</storageModule>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.macosx.exe.release.222902119">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.macosx.exe.release.222902119" moduleId="org.eclipse.cdt.core.settings" name="Release">
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.macosx.exe.release.222902119" name="Release" optionalBuildProperties="" parent="cdt.managedbuild.config.macosx.exe.release">
<folderInfo id="cdt.managedbuild.config.macosx.exe.release.222902119." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.release.370067321" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.release">
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.macosx.exe.release.1613432662" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.release"/>
<builder buildPath="${workspace_loc:/scv_tr_sqlite}/Release" id="cdt.managedbuild.target.gnu.builder.macosx.exe.release.1921784777" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.macosx.exe.release"/>
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release.835264205" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.release"/>
<tool id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release.807087528" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.release">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="macosx.cpp.link.option.paths.1094947030" name="Library search path (-L)" superClass="macosx.cpp.link.option.paths" valueType="libPaths">
<listOptionValue builtIn="false" value="/projects/tools/SystemC/opt/lib-linux64"/>
</option>
<inputType id="cdt.managedbuild.tool.macosx.cpp.linker.input.1729026262" superClass="cdt.managedbuild.tool.macosx.cpp.linker.input">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890" name="Release" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.enablement=false,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1771995322" name="Linux GCC" nonInternalBuilderId="de.marw.cdt.cmake.core.genscriptbuilder" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF;org.eclipse.cdt.core.ELF" id="cdt.managedbuild.target.gnu.platform.base.537650933" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="/SystemC-Components-Test/build/Release" id="de.marw.cdt.cmake.core.genscriptbuilder.1258411377" keepEnvironmentInBuildfile="false" name="CMake Builder (portable)" parallelBuildOn="true" parallelizationNumber="optimal" superClass="de.marw.cdt.cmake.core.genscriptbuilder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.107426579" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1213265767" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.2118017099" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.1199035274" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.471260944" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.141775679" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1658460188" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1464418269" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.macosx.exe.release.960768765" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.macosx.exe.release">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.both.asm.option.include.paths.1211035001" name="Include paths (-I)" superClass="gnu.both.asm.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="/usr/local/systemc2.3.1a/include/"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1845360319" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.macosx.base.2005529856" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.macosx.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release.1207281858" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release">
<option id="gnu.cpp.compiler.macosx.exe.release.option.optimization.level.1947685650" name="Optimization Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.optimization.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.macosx.exe.release.option.debugging.level.1098045969" name="Debug Level" superClass="gnu.cpp.compiler.macosx.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.2920067" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="/projects/tools/SystemC/opt/include"/>
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="&quot;${SYSTEMC_HOME}/include&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.749408456" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release.2136924185" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.macosx.exe.release.option.optimization.level.713312654" name="Optimization Level" superClass="gnu.c.compiler.macosx.exe.release.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
<option id="gnu.c.compiler.macosx.exe.release.option.debugging.level.1629703352" name="Debug Level" superClass="gnu.c.compiler.macosx.exe.release.option.debugging.level" useByScannerDiscovery="false" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.compiler.option.include.paths.1878457622" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="/usr/include"/>
<listOptionValue builtIn="false" value="&quot;${SYSTEMC_HOME}/include&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.220005104" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.584407986" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.2025921356" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule buildDir="build/${ConfigName}" moduleId="de.marw.cdt.cmake.core.settings">
<options/>
<linux command="cmake" generator="UnixMakefiles" use-default="true">
<defs/>
<undefs/>
</linux>
<win32 command="cmake" generator="MinGWMakefiles" use-default="true">
<defs/>
<undefs/>
</win32>
<defs>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="${ConfigName}"/>
</defs>
<undefs/>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="scv_tr_sqlite.cdt.managedbuild.target.macosx.exe.1724881597" name="Executable" projectType="cdt.managedbuild.target.macosx.exe"/>
<project id="SystemC-Components-Test.null.720884563" name="SystemC-Components-Test"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Default">
<resource resourceType="PROJECT" workspacePath="/SystemC-Components-Test"/>
</configuration>
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/sc-components-test"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/sc-components-test"/>
<resource resourceType="FOLDER" workspacePath="/SystemC-Components-Test/build"/>
</configuration>
<configuration configurationName="Release"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all VERBOSE=1" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all VERBOSE=1</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>clean</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581;cdt.managedbuild.config.gnu.macosx.exe.debug.133691581.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1937096603;cdt.managedbuild.tool.gnu.cpp.compiler.input.803568785">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890;cdt.managedbuild.toolchain.gnu.base.2088633632.342506890.;cdt.managedbuild.tool.gnu.cpp.compiler.base.1213265767;cdt.managedbuild.tool.gnu.cpp.compiler.input.2118017099">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581;cdt.managedbuild.config.gnu.macosx.exe.debug.133691581.;cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.debug.1149501692;cdt.managedbuild.tool.gnu.cpp.compiler.input.506955043">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2088633632;cdt.managedbuild.toolchain.gnu.base.2088633632.654284138;cdt.managedbuild.tool.gnu.cpp.compiler.base.2062399929;cdt.managedbuild.tool.gnu.cpp.compiler.input.770113519">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581;cdt.managedbuild.config.gnu.macosx.exe.debug.133691581.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.debug.1993665797;cdt.managedbuild.tool.gnu.c.compiler.input.1884051627">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2088633632;cdt.managedbuild.toolchain.gnu.base.2088633632.654284138;cdt.managedbuild.tool.gnu.c.compiler.base.1686982336;cdt.managedbuild.tool.gnu.c.compiler.input.1800687036">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.macosx.exe.release.222902119;cdt.managedbuild.config.macosx.exe.release.222902119.;cdt.managedbuild.tool.gnu.cpp.compiler.macosx.exe.release.1207281858;cdt.managedbuild.tool.gnu.cpp.compiler.input.749408456">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581;cdt.managedbuild.config.gnu.macosx.exe.debug.133691581.;cdt.managedbuild.tool.gnu.c.compiler.base.318007495;cdt.managedbuild.tool.gnu.c.compiler.input.1732590288">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.macosx.exe.release.222902119;cdt.managedbuild.config.macosx.exe.release.222902119.;cdt.managedbuild.tool.gnu.c.compiler.macosx.exe.release.2136924185;cdt.managedbuild.tool.gnu.c.compiler.input.220005104">
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890;cdt.managedbuild.toolchain.gnu.base.2088633632.342506890.;cdt.managedbuild.tool.gnu.c.compiler.base.1199035274;cdt.managedbuild.tool.gnu.c.compiler.input.471260944">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

1
.gitignore vendored
View File

@ -33,3 +33,4 @@
/build/
/simple_system.txlog
/my_db*

1
.gitmodules vendored
View File

@ -2,3 +2,4 @@
path = sc-components
url = https://git.minres.com/SystemC/SystemC-Components.git
branch = master

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sc-components-test</name>
<name>SystemC-Components-Test</name>
<comment></comment>
<projects>
</projects>

View File

@ -1,35 +1,54 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581" name="Debug">
<configuration id="cdt.managedbuild.toolchain.gnu.base.2088633632" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<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="-1312736236955371365" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1600315999323265833" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider class="de.marw.cmake.cdt.language.settings.providers.BuiltinsCompileCommandsJsonParser" id="de.marw.cmake.cdt.language.settings.providers.BuiltinsCompileCommandsJsonParser" name="CMAKE_EXPORT_COMPILE_COMMANDS Compiler Built-ins" store-entries-with-project="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
<language-scope id="com.nvidia.cuda.toolchain.language.cuda.cu"/>
</provider>
<provider class="de.marw.cmake.cdt.language.settings.providers.CompileCommandsJsonParser" id="de.marw.cmake.cdt.language.settings.providers.CompileCommandsJsonParser" name="CMAKE_EXPORT_COMPILE_COMMANDS Parser" store-entries-with-project="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
<language-scope id="com.nvidia.cuda.toolchain.language.cuda.cu"/>
</provider>
<provider-reference id="de.marw.cmake.cdt.language.settings.providers.CompileCommandsJsonParser" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="cdt.managedbuild.config.macosx.exe.release.222902119" name="Release">
<configuration id="cdt.managedbuild.toolchain.gnu.base.2088633632.342506890" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<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.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1600315999323265833" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<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="-1312736236955371365" 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 &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@ -1,11 +0,0 @@
eclipse.preferences.version=1
environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/delimiter=\:
environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/operation=append
environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/SC_DEFAULT_WRITER_POLICY/value=SC_MANY_WRITERS
environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/append=true
environment/project/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/appendContributed=true
environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/delimiter=\:
environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/operation=append
environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/SC_DEFAULT_WRITER_POLICY/value=SC_MANY_WRITERS
environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/append=true
environment/project/cdt.managedbuild.config.macosx.exe.release.222902119/appendContributed=true

View File

@ -1,13 +1,25 @@
eclipse.preferences.version=1
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.macosx.exe.debug.133691581/appendContributed=true
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/appendContributed=true
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.toolchain.gnu.base.2088633632/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632.342506890/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.toolchain.gnu.base.2088633632/appendContributed=true

View File

@ -1,9 +1,13 @@
cmake_minimum_required(VERSION 3.3)
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${CMAKE_CURRENT_SOURCE_DIR}/cmake
${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake
)
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)
project(SCC_Test)
set(ENABLE_SCV TRUE CACHE BOOL "Enable use of SCV")
set(ENABLE_SHARED TRUE CACHE BOOL "Build shared libraries")
set(NO_SUBMODULE_CHECK FALSE CACHE BOOL "Disable the submodule check")
include(GitFunctions)
get_branch_from_git()
@ -17,21 +21,34 @@ set(GIT_SUBMODULE_DIR_sc-components .)
set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH})
include(GNUInstallDirs)
include(Submodules)
if(NOT NO_SUBMODULE_CHECK)
include(Submodules)
endif()
include(Conan)
include(BuildType)
#enable_testing()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
elseif(NOT(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo"))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(warnings "-Wall -Wextra -Werror")
set(CMAKE_CXX_FLAG_RELEASE "-O2 -DNDEBUG")
set(CMAKE_C_FLAG_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAG_DEBUG "-Og")
set(CMAKE_C_FLAG_DEBUG "-Og")
set(CMAKE_CXX_FLAG_RELEASE "-O3 -DNDEBUG")
set(CMAKE_C_FLAG_RELEASE "-O3 -DNDEBUG")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(warnings "/W4 /WX /EHsc")
endif()
@ -40,36 +57,17 @@ setup_conan()
# 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.
find_package(Boost COMPONENTS program_options system thread REQUIRED)
find_package(Boost COMPONENTS program_options filesystem system thread REQUIRED)
# set-up SystemC and SCV
find_package(SystemC)
if(SystemC_FOUND)
add_definitions(-DWITH_SYSTEMC)
include_directories(${SystemC_INCLUDE_DIRS})
link_directories(${SystemC_LIBRARY_DIRS})
else()
find_package(OSCISystemC)
if(NOT SystemC_FOUND)
message( FATAL_ERROR "SystemC library not found." )
endif()
if(CCI_FOUND)
include_directories(${CCI_INCLUDE_DIRS})
link_directories(${CCI_LIBRARY_DIRS})
else()
message( FATAL_ERROR "SystemC CCI library not found." )
endif()
if(SCV_FOUND)
add_definitions(-DWITH_SCV)
link_directories(${SCV_LIBRARY_DIRS})
endif()
set(PROJECT_3PARTY_DIRS external sr_report sr_signal)
include(sc-components/cmake/clang-format.cmake)
add_subdirectory(sc-components)
add_subdirectory(examples)
#add_subdirectory(test)
add_subdirectory(tests)
#
# SYSTEM PACKAGING (RPM, TGZ, ...)
@ -83,3 +81,5 @@ add_subdirectory(examples)
#include(PackageConfigurator)
#include(FeatureSummary)
#feature_summary(WHAT ENABLED_FEATURES DISABLED_FEATURES PACKAGES_FOUND)

View File

@ -1,5 +1,5 @@
macro(setup_conan)
find_program(conan conan)
find_program(conan conan PATHS /usr/bin /usr/local/bin)
if(NOT EXISTS ${conan})
message(FATAL_ERROR "Conan is required. Please see README.md")
return()

View File

@ -1,6 +1,6 @@
[requires]
gsl_microsoft/20180102@bincrafters/stable
SystemC/2.3.3@minres/stable
fmt/6.1.2
SystemCVerification/2.0.1@minres/stable
SystemC-CCI/1.0.0@minres/stable
@ -9,7 +9,6 @@
txt
[options]
SystemC:stdcxx=14
SystemC:shared=True
SystemCVerification:stdcxx=14
SystemC-CCI:stdcxx=14
fmt:header_only=True
SystemCVerification:stdcxx=11
SystemC-CCI:stdcxx=11

View File

@ -1,9 +1,32 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.cdt.launch.applicationLaunchType">
<booleanAttribute key="de.toem.impulse.launchactivateLaunch" value="false"/>
<booleanAttribute key="de.toem.impulse.launchactivateTermination" value="false"/>
<intAttribute key="de.toem.impulse.launchdelayLaunch" value="0"/>
<intAttribute key="de.toem.impulse.launchlaunch" value="2"/>
<intAttribute key="de.toem.impulse.launchmode" value="3"/>
<stringAttribute key="de.toem.impulse.launchport" value=""/>
<booleanAttribute key="de.toem.impulse.launchrestart" value="true"/>
<intAttribute key="de.toem.impulse.launchterminate" value="1"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB" value="true"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.AUTO_SOLIB_LIST"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="gdb"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_ON_FORK" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.GDB_INIT" value=".gdbinit"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.NON_STOP" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE" value="false"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.REVERSE_MODE" value="UseSoftTrace"/>
<listAttribute key="org.eclipse.cdt.dsf.gdb.SOLIB_PATH"/>
<stringAttribute key="org.eclipse.cdt.dsf.gdb.TRACEPOINT_MODE" value="TP_NORMAL_ONLY"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.internal.ui.launching.LocalApplicationCDebuggerTab.DEFAULTS_SET" value="true"/>
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_ID" value="gdb"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_START_MODE" value="run"/>
<booleanAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN" value="true"/>
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_STOP_AT_MAIN_SYMBOL" value="sc_main"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_ARGUMENTS" value="-d"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/bin/simple_system"/>
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="build/Debug/bin/simple_system"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="sc-components-test"/>
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581"/>
@ -16,5 +39,6 @@
<mapAttribute key="org.eclipse.debug.core.environmentVariables">
<mapEntry key="SC_SIGNAL_WRITE_CHECK" value="DISABLE"/>
</mapAttribute>
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;memoryBlockExpressionList context=&quot;reserved-for-future-use&quot;/&gt;&#10;"/>
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
</launchConfiguration>

View File

@ -1,41 +1,8 @@
cmake_minimum_required(VERSION 3.3)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
project (sc-components)
# Set the version number of your project here (format is MAJOR.MINOR.PATCHLEVEL - e.g. 1.0.0)
set(VERSION_MAJOR "0")
set(VERSION_MINOR "0")
set(VERSION_PATCH "1")
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
include(Common)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Threads)
find_package(SystemC REQUIRED)
find_package(ZLIB)
if(SystemC_FOUND)
include_directories(${SystemC_INCLUDE_DIRS})
link_directories(${SystemC_LIBRARY_DIRS}
)
else()
message( FATAL_ERROR "SystemC library not found." )
endif()
if(ZLIB_FOUND)
include_directories( ${ZLIB_INCLUDE_DIRS} )
endif(ZLIB_FOUND)
cmake_minimum_required(VERSION 3.12)
if(SCV_FOUND)
add_definitions(-DWITH_SCV)
include_directories(${SCV_INCLUDE_DIRS})
link_directories(${SCV_LIBRARY_DIRS})
add_subdirectory(transaction_recording)
endif(SCV_FOUND)
endif()
add_subdirectory(simple_system)
add_subdirectory(transaction_recording)
add_subdirectory(ahb_bfm)

View File

@ -1,6 +1,4 @@
cmake_minimum_required(VERSION 3.3)
# Add executable called "simple_system" that is built from the source files
# "scv_tr_recording_example.cpp". The extensions are automatically found.
cmake_minimum_required(VERSION 3.12)
add_executable (simple_system
plic.cpp
uart.cpp
@ -10,9 +8,5 @@ add_executable (simple_system
simple_system.cpp
sc_main.cpp
)
# 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
# simple_system
target_link_libraries (simple_system LINK_PUBLIC scc)
target_link_libraries (simple_system LINK_PUBLIC ${Boost_LIBRARIES} )
target_link_libraries (simple_system LINK_PUBLIC ${ZLIB_LIBRARY})

View File

@ -17,11 +17,11 @@
#define _E300_PLAT_MAP_H_
// need double braces, see
// https://stackoverflow.com/questions/6893700/how-to-construct-stdarray-object-with-initializer-list#6894191
const std::array<scc::target_memory_map_entry<32>, 4> e300_plat_map = {{
{i_plic.socket, 0x0c000000, 0x200008},
{i_gpio.socket, 0x10012000, 0x1000},
{i_uart.socket, 0x10013000, 0x1000},
{i_spi.socket, 0x10014000, 0x1000},
const std::array<scc::target_name_map_entry<32>, 4> e300_plat_map = {{
{"plic", 0x0c000000, 0x200008},
{"gpio", 0x10012000, 0x1000},
{"uart", 0x10013000, 0x1000},
{"spi", 0x10014000, 0x1000},
}};
#endif /* _E300_PLAT_MAP_H_ */

View File

@ -44,7 +44,7 @@
namespace sysc {
class gpio_regs : public sc_core::sc_module, public scc::resetable {
protected:
public:
// storage declarations
uint32_t r_value;

View File

@ -1,47 +1,224 @@
////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 eyck@minres.com
// Copyright (C) 2017, MINRES Technologies GmbH
// All rights reserved.
//
// 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
// 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 implementation
//
// 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.
////////////////////////////////////////////////////////////////////////////////
#include "gpio.h"
#include "gen/gpio_regs.h"
#include "scc/report.h"
#include "scc/utilities.h"
#include "gen/gpio_regs.h"
#include <limits>
namespace sysc {
gpio::gpio(sc_core::sc_module_name nm)
: sc_core::sc_module(nm)
using namespace sc_core;
gpio::gpio(sc_module_name nm)
: sc_module(nm)
, tlm_target<>(clk)
, NAMED(clk_i)
, NAMED(rst_i)
, NAMEDD(regs, gpio_regs) {
, NAMED(pins_o, 32)
, NAMED(pins_i, 32)
, NAMED(iof0_o, 32)
, NAMED(iof1_o, 32)
, NAMED(iof0_i, 32)
, NAMED(iof1_i, 32)
, NAMEDD(regs, gpio_regs)
{
regs->registerResources(*this);
SC_METHOD(clock_cb);
sensitive << clk_i;
SC_METHOD(reset_cb);
sensitive << rst_i;
dont_initialize();
auto pins_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
this->pin_input(tag, gp, delay);
return tlm::TLM_COMPLETED;
};
auto i=0U;
for(auto& s:pins_i){
s.register_nb_transport(pins_i_cb, i);
++i;
}
auto iof0_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
last_iof0[tag]=gp.get_value();
this->iof_input(tag, 0, gp, delay);
return tlm::TLM_COMPLETED;
};
i=0;
for(auto& s:iof0_i){
s.register_nb_transport(iof0_i_cb, i);
++i;
}
auto iof1_i_cb =[this](unsigned int tag, tlm::tlm_signal_gp<>& gp,
tlm::tlm_phase& phase, sc_time& delay)->tlm::tlm_sync_enum{
last_iof1[tag]=gp.get_value();
this->iof_input(tag, 1, gp, delay);
return tlm::TLM_COMPLETED;
};
i=0;
for(auto& s:iof1_i){
s.register_nb_transport(iof1_i_cb, i);
++i;
}
auto update_pins_cb = [this](scc::sc_register<uint32_t> &reg, uint32_t data, sc_time d) -> bool {
if (!this->regs->in_reset()) {
auto changed_bits = (reg.get()^data);
reg.put(data);
update_pins(changed_bits);
}
return true;
};
regs->port.set_write_cb(update_pins_cb);
regs->output_en.set_write_cb(update_pins_cb);
regs->out_xor.set_write_cb(update_pins_cb);
regs->iof_en.set_write_cb(update_pins_cb);
regs->iof_sel.set_write_cb(update_pins_cb);
}
gpio::~gpio() {}
void gpio::clock_cb() {}
void gpio::reset_cb() {
if (rst_i.read())
if (rst_i.read()){
regs->reset_start();
else
} else {
regs->reset_stop();
}
update_pins(std::numeric_limits<uint32_t>::max());
}
void gpio::clock_cb() {
this->clk = clk_i.read();
}
tlm::tlm_phase gpio::write_output(tlm::tlm_signal_gp<bool>& gp, size_t i, bool val) {
sc_time delay{SC_ZERO_TIME};
tlm::tlm_phase phase{ tlm::BEGIN_REQ };
gp.set_command(tlm::TLM_WRITE_COMMAND);
gp.set_response_status(tlm::TLM_OK_RESPONSE);
gp.set_value(val);
pins_o.at(i)->nb_transport_fw(gp, phase, delay);
return phase;
}
void gpio::update_pins(uint32_t changed_bits) {
sc_inout_rv<32>::data_type out_val;
tlm::tlm_signal_gp<bool> gp;
bool val;
for(size_t i=0, mask = 1; i<32; ++i, mask<<=1){
if(changed_bits&mask){
if((regs->r_iof_en&mask!=0) && (iof0_i[i].size()==0 || iof1_i[i].size()==0)){
if((regs->r_iof_sel&mask)==0 && iof0_i[i].size()>0){
val=last_iof0[i]?sc_dt::Log_1:sc_dt::Log_0;
} else if((regs->r_iof_sel&mask)==1 && iof1_i[i].size()>0)
val=last_iof1[i]?sc_dt::Log_1:sc_dt::Log_0;
} else {
if((regs->r_output_en&mask) && (regs->r_port&mask))
val=true;
else
val=false;
if(regs->r_out_xor&mask)
val=~val;
}
tlm::tlm_phase phase = write_output(gp, i, val);
}
}
}
void gpio::pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp, sc_time& delay) {
if(delay>SC_ZERO_TIME){
wait(delay);
delay=SC_ZERO_TIME;
}
auto mask = 1u<<tag;
switch(gp.get_value()){
case true:
if(regs->r_output_en&mask==0)
regs->r_value|=mask;
forward_pin_input(tag, gp);
break;
case false:
if(regs->r_output_en&mask==0) regs->r_value&=~mask;
forward_pin_input(tag, gp);
break;
}
}
void gpio::forward_pin_input(unsigned int tag, tlm::tlm_signal_gp<bool>& gp) {
const auto mask = 1U<<tag;
if(regs->iof_en&mask){
auto& socket = regs->iof_sel&mask?iof1_o[tag]:iof0_o[tag];
tlm::tlm_signal_gp<> new_gp;
for(size_t i=0; i<socket.size(); ++i){
sc_time delay{SC_ZERO_TIME};
tlm::tlm_phase phase{tlm::BEGIN_REQ};
new_gp.set_command(tlm::TLM_WRITE_COMMAND);
new_gp.set_response_status(tlm::TLM_OK_RESPONSE);
new_gp.set_value(gp.get_value());
new_gp.update_extensions_from(gp);
socket->nb_transport_fw(new_gp, phase, delay); // we don't care about phase and sync enum
}
}
}
void gpio::iof_input(unsigned int tag, unsigned iof_idx, tlm::tlm_signal_gp<>& gp, sc_time& delay) {
if(delay>SC_ZERO_TIME){
wait(delay);
delay=SC_ZERO_TIME;
}
const auto mask = 1U<<tag;
if(regs->r_iof_en&mask){
const auto idx = regs->r_iof_sel&mask?1:0;
if(iof_idx == idx){
auto& socket = pins_o[tag];
for(size_t i=0; i<socket.size(); ++i){
sc_time delay{SC_ZERO_TIME};
tlm::tlm_phase phase{tlm::BEGIN_REQ};
tlm::tlm_signal_gp<> new_gp;
new_gp.set_command(tlm::TLM_WRITE_COMMAND);
auto val = gp.get_value();
new_gp.set_value(val);
new_gp.copy_extensions_from(gp);
socket->nb_transport_fw(new_gp, phase, delay); // we don't care about phase and sync enum
gp.update_extensions_from(new_gp);
}
}
}
}
} /* namespace sysc */

View File

@ -1,41 +1,84 @@
/*******************************************************************************
* Copyright 2017 eyck@minres.com
*
* 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.
******************************************************************************/
////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2017, 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 implementation
//
//
////////////////////////////////////////////////////////////////////////////////
#ifndef _GPIO_H_
#define _GPIO_H_
#include <scc/tlm_target.h>
#include "scc/tlm_target.h"
#include "scc/signal_target_mixin.h"
#include "scc/signal_initiator_mixin.h"
#include <tlm/tlm_signal.h>
namespace sysc {
class gpio_regs;
class WsHandler;
class gpio : public sc_core::sc_module, public scc::tlm_target<> {
public:
SC_HAS_PROCESS(gpio);
sc_core::sc_in<sc_core::sc_time> clk_i;
sc_core::sc_in<bool> rst_i;
// sc_core::sc_inout_rv<32> pins_io;
sc_core::sc_vector<scc::tlm_signal_bool_out> pins_o;
sc_core::sc_vector<scc::tlm_signal_bool_in> pins_i;
sc_core::sc_vector<scc::tlm_signal_bool_opt_out> iof0_o;
sc_core::sc_vector<scc::tlm_signal_bool_opt_out> iof1_o;
sc_core::sc_vector<scc::tlm_signal_bool_opt_in> iof0_i;
sc_core::sc_vector<scc::tlm_signal_bool_opt_in> iof1_i;
gpio(sc_core::sc_module_name nm);
virtual ~gpio();
virtual ~gpio() override; // need to keep it in source file because of fwd declaration of gpio_regs
protected:
void clock_cb();
void reset_cb();
void update_pins(uint32_t changed_bits);
void pin_input(unsigned int tag, tlm::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
void forward_pin_input(unsigned int tag, tlm::tlm_signal_gp<>& gp);
void iof_input(unsigned int tag, unsigned iof_idx, tlm::tlm_signal_gp<>& gp, sc_core::sc_time& delay);
sc_core::sc_time clk;
std::array<bool, 32> last_iof0, last_iof1;
std::unique_ptr<gpio_regs> regs;
std::shared_ptr<sysc::WsHandler> handler;
private:
tlm::tlm_phase write_output(tlm::tlm_signal_gp<>& gp, size_t i, bool val);
};
} /* namespace sysc */

View File

@ -119,7 +119,7 @@ void plic::global_int_port_cb() {
if (enable && global_interrupts_i[i].read() == 1) {
regs->r_pending = regs->r_pending | (0x1 << i);
LOG(INFO) << "pending interrupt identified: " << i;
SCDEBUG("plic") << "pending interrupt identified: " << i;
}
}
@ -147,7 +147,7 @@ void plic::handle_pending_int() {
claim_prio = prio;
claim_int = i;
raise_int = 1;
LOG(INFO) << "pending interrupt activated: " << i;
SCDEBUG("plic") << "pending interrupt activated: " << i;
}
}
}
@ -158,14 +158,14 @@ void plic::handle_pending_int() {
// todo: evluate clock period
} else {
regs->r_claim_complete = 0;
LOG(INFO) << "no further pending interrupt.";
SCDEBUG("plic") << "no further pending interrupt.";
}
}
void plic::reset_pending_int(uint32_t irq) {
// todo: evaluate enable register (see spec)
// todo: make sure that pending is set, otherwise don't reset irq ... read spec.
LOG(INFO) << "reset pending interrupt: " << irq;
SCDEBUG("plic") << "reset pending interrupt: " << irq;
// reset related pending bit
regs->r_pending &= ~(0x1 << irq);
core_interrupt_o.write(0);

View File

@ -24,9 +24,7 @@
#include <scc/report.h>
#include <scc/scv_tr_db.h>
#include <scc/tracer.h>
#include <cci_utils/broker.h>
#include <boost/program_options.hpp>
#include <sstream>
using namespace sysc;
using namespace scc;
@ -42,10 +40,6 @@ int sc_main(int argc, char *argv[]) {
sc_core::sc_report_handler::set_actions( "/IEEE_Std_1666/deprecated", sc_core::SC_DO_NOTHING );
sc_core::sc_report_handler::set_actions(sc_core::SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, sc_core::SC_DO_NOTHING);
///////////////////////////////////////////////////////////////////////////
// create global CCI broker
///////////////////////////////////////////////////////////////////////////
cci::cci_register_broker(new cci_utils::broker("Global Broker"));
///////////////////////////////////////////////////////////////////////////
// CLI argument parsing
///////////////////////////////////////////////////////////////////////////
po::options_description desc("Options");
@ -77,14 +71,13 @@ int sc_main(int argc, char *argv[]) {
///////////////////////////////////////////////////////////////////////////
// set up tracing & transaction recording
///////////////////////////////////////////////////////////////////////////
tracer trace("simple_system", tracer::TEXT, vm.count("trace"));
tracer trace("simple_system", tracer::COMPRESSED, vm.count("trace"));
// todo: fix displayed clock period in VCD
///////////////////////////////////////////////////////////////////////////
// instantiate top level
///////////////////////////////////////////////////////////////////////////
simple_system i_simple_system("i_simple_system");
// sr_report_handler::add_sc_object_to_filter(&i_simple_system.i_master, sc_core::SC_WARNING, sc_core::SC_MEDIUM);
///////////////////////////////////////////////////////////////////////////
// run simulation
@ -93,7 +86,7 @@ int sc_main(int argc, char *argv[]) {
// todo: provide end-of-simulation macros
if (!sc_core::sc_end_of_simulation_invoked()) {
LOG(ERROR) << "simulation timed out";
SCERR() << "simulation timed out";
sc_core::sc_stop();
}
return SUCCESS;

View File

@ -35,17 +35,21 @@ simple_system::simple_system(sc_core::sc_module_name nm)
, NAMED(s_clk)
, NAMED(s_rst)
, NAMED(s_global_interrupts, 256)
, NAMED(s_core_interrupt) {
, NAMED(s_core_interrupt)
, NAMED(s_gpio, 32)
{
// todo: discuss naming conventions (s_<signal> vs. <port>_i/_o) --> covnert into _s
// bus connections
i_master.intor(i_router.target[0]);
size_t i = 0;
for (const auto &e : e300_plat_map) {
i_router.initiator[i](e.target);
i_router.set_target_range(i, e.start, e.size);
i++;
}
i_router.bind_target(i_plic.socket, 0, "plic");
i_router.bind_target(i_uart.socket, 1, "uart");
i_router.bind_target(i_spi.socket, 2, "spi");
i_router.bind_target(i_gpio.socket, 3, "gpio");
// target address ranges
for (const auto &e : e300_plat_map)
i_router.add_target_range(e.name, e.start, e.size);
// clock/reset connections
i_uart.clk_i(s_clk);
@ -66,6 +70,11 @@ simple_system::simple_system(sc_core::sc_module_name nm)
i_master.global_interrupts_o(s_global_interrupts);
i_master.core_interrupt_i(s_core_interrupt);
for(auto i=0U; i<s_gpio.size(); ++i){
s_gpio[i].in(i_gpio.pins_o[i]);
i_gpio.pins_i[i](s_gpio[i].out);
}
SC_THREAD(gen_reset);
}

View File

@ -48,7 +48,8 @@ public:
sc_core::sc_signal<sc_core::sc_time> s_clk;
sc_core::sc_signal<bool> s_rst;
sc_core::sc_vector<sc_core::sc_signal<bool>> s_global_interrupts;
sc_core::sc_signal<bool> 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;
simple_system(sc_core::sc_module_name nm);

View File

@ -36,8 +36,10 @@
#define PLIC_CLAIM_COMPLETE_REG 0x0C200004
namespace sysc {
test_initiator::test_initiator(sc_core::sc_module_name nm)
: sc_core::sc_module(nm)
using namespace sc_core;
test_initiator::test_initiator(sc_module_name nm)
: sc_module(nm)
, NAMED(intor)
, NAMED(rst_i)
, NAMED(global_interrupts_o, 256)
@ -62,6 +64,8 @@ void test_initiator::run() {
test_irq_stress();
// todo: review irq sequences from FW point of view ... expected ???
wait(100_ns);
sc_stop();
}
void test_initiator::test_unique_irq() {
@ -211,14 +215,14 @@ void test_initiator::write_bus(std::uint32_t adr, std::uint32_t dat) {
data[1] = 0xff & dat >> 8;
data[0] = 0xff & dat;
LOG(INFO) << "write_bus(0x" << std::hex << adr << ") : " << dat;
SCDEBUG("test_initiator") << "write_bus(0x" << std::hex << adr << ") : " << dat;
gp.set_command(tlm::TLM_WRITE_COMMAND);
gp.set_address(adr);
gp.set_data_ptr(data.data());
gp.set_data_length(data.size());
gp.set_streaming_width(4);
sc_core::sc_time delay;
sc_time delay;
intor->b_transport(gp, delay);
if (gp.get_response_status() != tlm::TLM_OK_RESPONSE) {
@ -236,7 +240,7 @@ std::uint32_t test_initiator::read_bus(std::uint32_t adr) {
gp.set_data_ptr(data.data());
gp.set_data_length(data.size());
gp.set_streaming_width(4);
sc_core::sc_time delay;
sc_time delay;
intor->b_transport(gp, delay);
if (gp.get_response_status() != tlm::TLM_OK_RESPONSE) {
@ -248,21 +252,21 @@ std::uint32_t test_initiator::read_bus(std::uint32_t adr) {
// todo: use reinterpret_cast instead
std::uint32_t rdat = data[3] << 24 | data[2] << 16 | data[1] << 8 | data[0];
LOG(INFO) << "read_bus(0x" << std::hex << adr << ") -> " << rdat;
SCDEBUG("test_initiator") << "read_bus(0x" << std::hex << adr << ") -> " << rdat;
return rdat;
}
void test_initiator::reg_check(std::uint32_t adr, std::uint32_t exp) {
uint32_t dat = read_bus(adr);
if (dat != exp) {
LOG(ERROR) << "register check failed for address 0x" << std::hex << adr << ": " << dat << " != " << exp;
SCERR("test_initiator") << "register check failed for address 0x" << std::hex << adr << ": " << dat << " != " << exp;
} else {
LOG(INFO) << "register check passed for address 0x" << std::hex << adr << ": " << dat;
SCDEBUG("test_initiator") << "register check passed for address 0x" << std::hex << adr << ": " << dat;
}
}
void test_initiator::core_irq_handler() {
LOG(INFO) << "core_interrupt_i edge detected -> " << core_interrupt_i.read();
SCDEBUG("test_initiator") << "core_interrupt_i edge detected -> " << core_interrupt_i.read();
}
} /* namespace sysc */

View File

@ -1,10 +1,5 @@
cmake_minimum_required(VERSION 3.3)
# Add executable called "transaction_recording" that is built from the source files
# "scv_tr_recording_example.cpp". The extensions are automatically found.
cmake_minimum_required(VERSION 3.12)
add_executable (transaction_recording
scv_tr_recording_example.cpp
)
# 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
# transaction_recording
target_link_libraries (transaction_recording LINK_PUBLIC scc ${CONAN_LIBS})
target_link_libraries (transaction_recording LINK_PUBLIC scc)

View File

@ -16,6 +16,15 @@
*****************************************************************************/
#include "scv.h"
#include "scc/scv_tr_db.h"
#include "scc/report.h"
#include "scc/value_registry.h"
// text 11308µs/11602µs
// compressed 10365µs/ 9860µs
// binary 13233µs/10698µs
// SQLite 30363µs/30018µs
// LeveDB 23898µs/22367µs
// hack to fake a true fifo_mutex
#define fifo_mutex sc_mutex
@ -189,8 +198,7 @@ inline void test::main1() {
for (int i = 0; i < 3; i++) {
rw_task_if::addr_t addr = i;
rw_task_if::data_t data = transactor->read(&addr);
cout << "at time " << sc_time_stamp() << ": ";
cout << "received data : " << data << endl;
SCINFO(sc_get_current_object()->name()) << "received data : " << data;
}
scv_smart_ptr<rw_task_if::addr_t> addr;
@ -198,14 +206,14 @@ inline void test::main1() {
addr->next();
rw_task_if::data_t data = transactor->read(addr->get_instance());
cout << "data for address " << *addr << " is " << data << endl;
SCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data;
}
scv_smart_ptr<rw_task_if::write_t> write;
for (int i = 0; i < 3; i++) {
write->next();
transactor->write(write->get_instance());
cout << "send data : " << write->data << endl;
SCINFO(sc_get_current_object()->name()) << "send data : " << write->data;
}
scv_smart_ptr<int> data;
@ -224,8 +232,7 @@ inline void test::main2() {
for (int i = 0; i < 3; i++) {
rw_task_if::addr_t addr = i;
rw_task_if::data_t data = transactor->read(&addr);
cout << "at time " << sc_time_stamp() << ": ";
cout << "received data : " << data << endl;
SCINFO(sc_get_current_object()->name()) << "received data : " << data;
}
scv_smart_ptr<rw_task_if::addr_t> addr;
@ -233,14 +240,14 @@ inline void test::main2() {
addr->next();
rw_task_if::data_t data = transactor->read(addr->get_instance());
cout << "data for address " << *addr << " is " << data << endl;
SCINFO(sc_get_current_object()->name()) << "data for address " << *addr << " is " << data;
}
scv_smart_ptr<rw_task_if::write_t> write;
for (int i = 0; i < 3; i++) {
write->next();
transactor->write(write->get_instance());
cout << "send data : " << write->data << endl;
SCINFO(sc_get_current_object()->name()) << "send data : " << write->data;
}
scv_smart_ptr<int> data;
@ -291,8 +298,7 @@ inline void design::addr_phase() {
outstandingAddresses.push_back(_addr);
outstandingType.push_back(_rw);
cout << "at time " << sc_time_stamp() << ": ";
cout << "received request for memory address " << _addr << endl;
SCINFO(sc_get_current_object()->name()) << "received request for memory address " << _addr;
}
}
@ -306,15 +312,15 @@ inline void design::data_phase() {
wait(clk->posedge_event());
}
if (outstandingType.front() == false) {
cout << "reading memory address " << outstandingAddresses.front() << " with value "
<< memory[outstandingAddresses.front().to_ulong()] << endl;
SCINFO(sc_get_current_object()->name()) << "reading memory address " << outstandingAddresses.front() << " with value "
<< memory[outstandingAddresses.front().to_ulong()];
bus_data = memory[outstandingAddresses.front().to_ulong()];
data_rdy = 1;
wait(clk->posedge_event());
data_rdy = 0;
} else {
cout << "writing memory address " << outstandingAddresses.front() << " with value " << bus_data << endl;
SCINFO(sc_get_current_object()->name()) << "writing memory address " << outstandingAddresses.front() << " with value " << bus_data;
memory[outstandingAddresses.front().to_ulong()] = bus_data;
data_rdy = 1;
wait(clk->posedge_event());
@ -324,13 +330,30 @@ inline void design::data_phase() {
outstandingType.pop_front();
}
}
extern void scv_tr_sqlite_init();
inline const char* init_db(char type){
switch(type){
case '2':
scv_tr_compressed_init();
return "my_db.txlog";
break;
case '3':
scv_tr_sqlite_init();
return "my_db.txdb";
break;
default:
scv_tr_text_init();
return "my_db.txlog";
break;
}
}
int sc_main(int argc, char *argv[]) {
auto start = std::chrono::system_clock::now();
scv_startup();
scv_tr_text_init();
const char* fileName = "my_db.txlog";
scc::init_logging(scc::LogConfig().logLevel(logging::DEBUG));
const char *fileName = argc==2? init_db(argv[1][0]): "my_db.txlog";
if(argc<2) scv_tr_text_init();
scv_tr_db db(fileName);
scv_tr_db::set_default_db(&db);
sc_trace_file *tf = sc_create_vcd_trace_file("my_db");
@ -343,6 +366,7 @@ int sc_main(int argc, char *argv[]) {
sc_signal<bool> data_rdy;
sc_signal<sc_uint<8>> bus_data;
scc::value_registry registry;
// create modules/channels
test t("t");
rw_pipelined_transactor tr("tr");
@ -373,7 +397,9 @@ int sc_main(int argc, char *argv[]) {
// Disable check for bus simulation.
sc_report_handler::set_actions(SC_ID_MORE_THAN_ONE_SIGNAL_DRIVER_, SC_DO_NOTHING);
// run the simulation
sc_start(1.0, SC_MS);
sc_start(10.0, SC_US);
sc_close_vcd_trace_file(tf);
auto int_us = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now()-start);
SCINFO() << "simulation duration "<<int_us.count()<<"µs";
return 0;
}

@ -1 +1 @@
Subproject commit 72806c0fd634b15fa23666843c3db2ad7f6b5077
Subproject commit 213293bc01287e8104ca8b03e552d69376ebb7a3

1
tests/CMakeLists.txt Normal file
View File

@ -0,0 +1 @@
add_subdirectory(io-redirector)

View File

@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.12)
add_executable (io_redirector_test
main.cpp
)
target_link_libraries (io_redirector_test LINK_PUBLIC scc)

View File

@ -0,0 +1,22 @@
/*
* main.cpp
*
* Created on: 01.01.2019
* Author: eyck
*/
#include <util/io-redirector.h>
#include <iostream>
#include <cstdio>
#include <cassert>
int main(int arcg, char* argv[]){
IoRedirector::get().start();
auto result1 = IoRedirector::get().get_output();
assert(result1=="");
printf("Some output");
std::cout<<"Some other output"<<std::endl;
auto result2 = IoRedirector::get().get_output();
assert(result2=="Some outputSome other output\n");
IoRedirector::get().stop();
}