merge commit

This commit is contained in:
Eyck-Alexander Jentzsch 2023-10-22 15:13:25 +02:00
commit ffe730219d
32 changed files with 525 additions and 552 deletions

View File

@ -1,73 +0,0 @@
eclipse.preferences.version=1
org.eclipse.cdt.codan.checkers.errnoreturn=Warning
org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false}
org.eclipse.cdt.codan.checkers.errreturnvalue=Error
org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"}
org.eclipse.cdt.codan.checkers.nocommentinside=-Error
org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"}
org.eclipse.cdt.codan.checkers.nolinecomment=-Error
org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"}
org.eclipse.cdt.codan.checkers.noreturn=Error
org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false}
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=Error
org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"}
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=Error
org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"}
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"}
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"}
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false}
org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=Error
org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"}
org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true}
org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem=Error
org.eclipse.cdt.codan.internal.checkers.DecltypeAutoProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid 'decltype(auto)' specifier\\")"}
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.InvalidArguments=Error
org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"}
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=Error
org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"}
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"}
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=Error
org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"}
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"}
org.eclipse.cdt.codan.internal.checkers.OverloadProblem=Error
org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"}
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"}
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=Error
org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"}
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"}
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"}
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()}
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false}
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false}
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"}
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true}
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")}
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=Error
org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"}

View File

@ -1,13 +0,0 @@
eclipse.preferences.version=1
environment/project/cdt.managedbuild.config.gnu.exe.debug.1751741082/append=true
environment/project/cdt.managedbuild.config.gnu.exe.debug.1751741082/appendContributed=true
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LLVM_HOME/delimiter=\:
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LLVM_HOME/operation=append
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LLVM_HOME/value=/usr/lib/llvm-6.0
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/append=true
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/appendContributed=true
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171/LLVM_HOME/delimiter=\:
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171/LLVM_HOME/operation=append
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171/LLVM_HOME/value=/usr/lib/llvm-6.0
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171/append=true
environment/project/cdt.managedbuild.config.gnu.exe.release.1745230171/appendContributed=true

View File

@ -1,37 +0,0 @@
eclipse.preferences.version=1
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.debug.1751741082/appendContributed=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/appendContributed=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/CPATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/CPLUS_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/C_INCLUDE_PATH/delimiter=\:
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.exe.release.1745230171/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.debug.1751741082/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171.1259602404/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171/LIBRARY_PATH/delimiter=\:
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.exe.release.1745230171/appendContributed=true

View File

@ -39,6 +39,7 @@ endif()
# library files # library files
FILE(GLOB GEN_ISS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/iss/arch/*.cpp) FILE(GLOB GEN_ISS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/iss/arch/*.cpp)
FILE(GLOB GEN_VM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/interp/vm_*.cpp) FILE(GLOB GEN_VM_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/interp/vm_*.cpp)
FILE(GLOB GEN_YAML_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/contrib/instr/*.yaml)
list(APPEND LIB_SOURCES ${GEN_ISS_SOURCES} ${GEN_VM_SOURCES}) list(APPEND LIB_SOURCES ${GEN_ISS_SOURCES} ${GEN_VM_SOURCES})
foreach(FILEPATH ${GEN_ISS_SOURCES}) foreach(FILEPATH ${GEN_ISS_SOURCES})
get_filename_component(CORE ${FILEPATH} NAME_WE) get_filename_component(CORE ${FILEPATH} NAME_WE)
@ -60,13 +61,9 @@ if(WITH_ASMJIT)
FILE(GLOB TCC_GEN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/asmjit/vm_*.cpp) FILE(GLOB TCC_GEN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src-gen/vm/asmjit/vm_*.cpp)
list(APPEND LIB_SOURCES ${TCC_GEN_SOURCES}) list(APPEND LIB_SOURCES ${TCC_GEN_SOURCES})
endif() endif()
if(TARGET RapidJSON OR TARGET RapidJSON::RapidJSON) if(TARGET yaml-cpp::yaml-cpp)
list(APPEND LIB_SOURCES list(APPEND LIB_SOURCES
src/iss/plugin/cycle_estimate.cpp src/iss/plugin/cycle_estimate.cpp
)
endif()
if(TARGET jsoncpp::jsoncpp)
list(APPEND LIB_SOURCES
src/iss/plugin/instruction_count.cpp src/iss/plugin/instruction_count.cpp
) )
endif() endif()
@ -91,11 +88,9 @@ if(NOT (DBT_CORE_DEFS STREQUAL DBT_CORE_DEFS-NOTFOUND))
endif() endif()
target_link_libraries(${PROJECT_NAME} PUBLIC elfio::elfio softfloat scc-util Boost::coroutine) target_link_libraries(${PROJECT_NAME} PUBLIC elfio::elfio softfloat scc-util Boost::coroutine)
if(TARGET jsoncpp::jsoncpp) if(TARGET yaml-cpp::yaml-cpp)
target_link_libraries(${PROJECT_NAME} PUBLIC jsoncpp::jsoncpp) target_compile_definitions(${PROJECT_NAME} PUBLIC WITH_PLUGINS)
endif() target_link_libraries(${PROJECT_NAME} PUBLIC yaml-cpp::yaml-cpp)
if(TARGET RapidJSON)
target_link_libraries(${PROJECT_NAME} PUBLIC RapidJSON)
endif() endif()
if(WITH_LLVM) if(WITH_LLVM)
@ -125,9 +120,11 @@ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/incl/iss COMPONENT ${PROJECT_NAME}
FILES_MATCHING # install only matched files FILES_MATCHING # install only matched files
PATTERN "*.h" # select header files PATTERN "*.h" # select header files
) )
install(FILES ${GEN_YAML_SOURCES} DESTINATION share/tgc-vp)
############################################################################### ###############################################################################
# #
############################################################################### ###############################################################################
set(CMAKE_INSTALL_RPATH $ORIGIN/../${CMAKE_INSTALL_LIBDIR})
project(tgc-sim) project(tgc-sim)
find_package(Boost COMPONENTS program_options thread REQUIRED) find_package(Boost COMPONENTS program_options thread REQUIRED)

1
contrib/instr/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/*.yaml

View File

@ -1,297 +1,348 @@
RV32I: RV32I:
- LUI: LUI:
index: 0
encoding: 0b00000000000000000000000000110111 encoding: 0b00000000000000000000000000110111
mask: 0b00000000000000000000000001111111 mask: 0b00000000000000000000000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- AUIPC: AUIPC:
index: 1
encoding: 0b00000000000000000000000000010111 encoding: 0b00000000000000000000000000010111
mask: 0b00000000000000000000000001111111 mask: 0b00000000000000000000000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- JAL: JAL:
index: 2
encoding: 0b00000000000000000000000001101111 encoding: 0b00000000000000000000000001101111
mask: 0b00000000000000000000000001111111 mask: 0b00000000000000000000000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: 1
- JALR: JALR:
index: 3
encoding: 0b00000000000000000000000001100111 encoding: 0b00000000000000000000000001100111
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BEQ: BEQ:
index: 4
encoding: 0b00000000000000000000000001100011 encoding: 0b00000000000000000000000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BNE: BNE:
index: 5
encoding: 0b00000000000000000001000001100011 encoding: 0b00000000000000000001000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BLT: BLT:
index: 6
encoding: 0b00000000000000000100000001100011 encoding: 0b00000000000000000100000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BGE: BGE:
index: 7
encoding: 0b00000000000000000101000001100011 encoding: 0b00000000000000000101000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BLTU: BLTU:
index: 8
encoding: 0b00000000000000000110000001100011 encoding: 0b00000000000000000110000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- BGEU: BGEU:
index: 9
encoding: 0b00000000000000000111000001100011 encoding: 0b00000000000000000111000001100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: true branch: true
delay: 1 delay: [1,1]
- LB: LB:
index: 10
encoding: 0b00000000000000000000000000000011 encoding: 0b00000000000000000000000000000011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- LH: LH:
index: 11
encoding: 0b00000000000000000001000000000011 encoding: 0b00000000000000000001000000000011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- LW: LW:
index: 12
encoding: 0b00000000000000000010000000000011 encoding: 0b00000000000000000010000000000011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- LBU: LBU:
index: 13
encoding: 0b00000000000000000100000000000011 encoding: 0b00000000000000000100000000000011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- LHU: LHU:
index: 14
encoding: 0b00000000000000000101000000000011 encoding: 0b00000000000000000101000000000011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SB: SB:
index: 15
encoding: 0b00000000000000000000000000100011 encoding: 0b00000000000000000000000000100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SH: SH:
index: 16
encoding: 0b00000000000000000001000000100011 encoding: 0b00000000000000000001000000100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SW: SW:
index: 17
encoding: 0b00000000000000000010000000100011 encoding: 0b00000000000000000010000000100011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- ADDI: ADDI:
index: 18
encoding: 0b00000000000000000000000000010011 encoding: 0b00000000000000000000000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLTI: SLTI:
index: 19
encoding: 0b00000000000000000010000000010011 encoding: 0b00000000000000000010000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLTIU: SLTIU:
index: 20
encoding: 0b00000000000000000011000000010011 encoding: 0b00000000000000000011000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- XORI: XORI:
index: 21
encoding: 0b00000000000000000100000000010011 encoding: 0b00000000000000000100000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- ORI: ORI:
index: 22
encoding: 0b00000000000000000110000000010011 encoding: 0b00000000000000000110000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- ANDI: ANDI:
index: 23
encoding: 0b00000000000000000111000000010011 encoding: 0b00000000000000000111000000010011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLLI: SLLI:
index: 24
encoding: 0b00000000000000000001000000010011 encoding: 0b00000000000000000001000000010011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SRLI: SRLI:
index: 25
encoding: 0b00000000000000000101000000010011 encoding: 0b00000000000000000101000000010011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SRAI: SRAI:
index: 26
encoding: 0b01000000000000000101000000010011 encoding: 0b01000000000000000101000000010011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- ADD: ADD:
index: 27
encoding: 0b00000000000000000000000000110011 encoding: 0b00000000000000000000000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SUB: SUB:
index: 28
encoding: 0b01000000000000000000000000110011 encoding: 0b01000000000000000000000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLL: SLL:
index: 29
encoding: 0b00000000000000000001000000110011 encoding: 0b00000000000000000001000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLT: SLT:
index: 30
encoding: 0b00000000000000000010000000110011 encoding: 0b00000000000000000010000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SLTU: SLTU:
index: 31
encoding: 0b00000000000000000011000000110011 encoding: 0b00000000000000000011000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- XOR: XOR:
index: 32
encoding: 0b00000000000000000100000000110011 encoding: 0b00000000000000000100000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SRL: SRL:
index: 33
encoding: 0b00000000000000000101000000110011 encoding: 0b00000000000000000101000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- SRA: SRA:
index: 34
encoding: 0b01000000000000000101000000110011 encoding: 0b01000000000000000101000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- OR: OR:
index: 35
encoding: 0b00000000000000000110000000110011 encoding: 0b00000000000000000110000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- AND: AND:
index: 36
encoding: 0b00000000000000000111000000110011 encoding: 0b00000000000000000111000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- FENCE: FENCE:
index: 37
encoding: 0b00000000000000000000000000001111 encoding: 0b00000000000000000000000000001111
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- ECALL: ECALL:
index: 38
encoding: 0b00000000000000000000000001110011 encoding: 0b00000000000000000000000001110011
mask: 0b11111111111111111111111111111111 mask: 0b11111111111111111111111111111111
attributes: [[name:no_cont]]
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- EBREAK: EBREAK:
index: 39
encoding: 0b00000000000100000000000001110011 encoding: 0b00000000000100000000000001110011
mask: 0b11111111111111111111111111111111 mask: 0b11111111111111111111111111111111
attributes: [[name:no_cont]]
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- MRET: MRET:
index: 40
encoding: 0b00110000001000000000000001110011 encoding: 0b00110000001000000000000001110011
mask: 0b11111111111111111111111111111111 mask: 0b11111111111111111111111111111111
attributes: [[name:no_cont]] attributes: [[name:no_cont]]
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- WFI: WFI:
index: 41
encoding: 0b00010000010100000000000001110011 encoding: 0b00010000010100000000000001110011
mask: 0b11111111111111111111111111111111 mask: 0b11111111111111111111111111111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
Zicsr: Zicsr:
- CSRRW: CSRRW:
index: 42
encoding: 0b00000000000000000001000001110011 encoding: 0b00000000000000000001000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- CSRRS: CSRRS:
index: 43
encoding: 0b00000000000000000010000001110011 encoding: 0b00000000000000000010000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- CSRRC: CSRRC:
index: 44
encoding: 0b00000000000000000011000001110011 encoding: 0b00000000000000000011000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- CSRRWI: CSRRWI:
index: 45
encoding: 0b00000000000000000101000001110011 encoding: 0b00000000000000000101000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- CSRRSI: CSRRSI:
index: 46
encoding: 0b00000000000000000110000001110011 encoding: 0b00000000000000000110000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- CSRRCI: CSRRCI:
index: 47
encoding: 0b00000000000000000111000001110011 encoding: 0b00000000000000000111000001110011
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
Zifencei: Zifencei:
- FENCE_I: FENCE_I:
index: 48
encoding: 0b00000000000000000001000000001111 encoding: 0b00000000000000000001000000001111
mask: 0b00000000000000000111000001111111 mask: 0b00000000000000000111000001111111
attributes: [[name:flush]] attributes: [[name:flush]]
@ -299,218 +350,272 @@ Zifencei:
branch: false branch: false
delay: 1 delay: 1
RV32M: RV32M:
- MUL: MUL:
index: 49
encoding: 0b00000010000000000000000000110011 encoding: 0b00000010000000000000000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- MULH: MULH:
index: 50
encoding: 0b00000010000000000001000000110011 encoding: 0b00000010000000000001000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- MULHSU: MULHSU:
index: 51
encoding: 0b00000010000000000010000000110011 encoding: 0b00000010000000000010000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- MULHU: MULHU:
index: 52
encoding: 0b00000010000000000011000000110011 encoding: 0b00000010000000000011000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- DIV: DIV:
index: 53
encoding: 0b00000010000000000100000000110011 encoding: 0b00000010000000000100000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- DIVU: DIVU:
index: 54
encoding: 0b00000010000000000101000000110011 encoding: 0b00000010000000000101000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- REM: REM:
index: 55
encoding: 0b00000010000000000110000000110011 encoding: 0b00000010000000000110000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
- REMU: REMU:
index: 56
encoding: 0b00000010000000000111000000110011 encoding: 0b00000010000000000111000000110011
mask: 0b11111110000000000111000001111111 mask: 0b11111110000000000111000001111111
size: 32 size: 32
branch: false branch: false
delay: 1 delay: 1
RV32IC: Zca:
- CADDI4SPN: C__ADDI4SPN:
index: 57
encoding: 0b0000000000000000 encoding: 0b0000000000000000
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CLW: C__LW:
index: 58
encoding: 0b0100000000000000 encoding: 0b0100000000000000
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CSW: C__SW:
index: 59
encoding: 0b1100000000000000 encoding: 0b1100000000000000
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CADDI: C__ADDI:
index: 60
encoding: 0b0000000000000001 encoding: 0b0000000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CNOP: C__NOP:
index: 61
encoding: 0b0000000000000001 encoding: 0b0000000000000001
mask: 0b1110111110000011 mask: 0b1110111110000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CJAL: C__JAL:
index: 62
encoding: 0b0010000000000001 encoding: 0b0010000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
attributes: [[name:enable, value:1]]
size: 16 size: 16
branch: true branch: true
delay: 1 delay: 1
- CLI: C__LI:
index: 63
encoding: 0b0100000000000001 encoding: 0b0100000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CLUI: C__LUI:
index: 64
encoding: 0b0110000000000001 encoding: 0b0110000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CADDI16SP: C__ADDI16SP:
index: 65
encoding: 0b0110000100000001 encoding: 0b0110000100000001
mask: 0b1110111110000011 mask: 0b1110111110000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CSRLI: __reserved_clui:
index: 66
encoding: 0b0110000000000001
mask: 0b1111000001111111
size: 16
branch: false
delay: 1
C__SRLI:
index: 67
encoding: 0b1000000000000001 encoding: 0b1000000000000001
mask: 0b1111110000000011 mask: 0b1111110000000011
attributes: [[name:enable, value:1]]
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CSRAI: C__SRAI:
index: 68
encoding: 0b1000010000000001 encoding: 0b1000010000000001
mask: 0b1111110000000011 mask: 0b1111110000000011
attributes: [[name:enable, value:1]]
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CANDI: C__ANDI:
index: 69
encoding: 0b1000100000000001 encoding: 0b1000100000000001
mask: 0b1110110000000011 mask: 0b1110110000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CSUB: C__SUB:
index: 70
encoding: 0b1000110000000001 encoding: 0b1000110000000001
mask: 0b1111110001100011 mask: 0b1111110001100011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CXOR: C__XOR:
index: 71
encoding: 0b1000110000100001 encoding: 0b1000110000100001
mask: 0b1111110001100011 mask: 0b1111110001100011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- COR: C__OR:
index: 72
encoding: 0b1000110001000001 encoding: 0b1000110001000001
mask: 0b1111110001100011 mask: 0b1111110001100011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CAND: C__AND:
index: 73
encoding: 0b1000110001100001 encoding: 0b1000110001100001
mask: 0b1111110001100011 mask: 0b1111110001100011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CJ: C__J:
index: 74
encoding: 0b1010000000000001 encoding: 0b1010000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: true branch: true
delay: 1 delay: 1
- CBEQZ: C__BEQZ:
index: 75
encoding: 0b1100000000000001 encoding: 0b1100000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: true branch: true
delay: 1 delay: [1,1]
- CBNEZ: C__BNEZ:
index: 76
encoding: 0b1110000000000001 encoding: 0b1110000000000001
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: true branch: true
delay: 1 delay: [1,1]
- CSLLI: C__SLLI:
index: 77
encoding: 0b0000000000000010 encoding: 0b0000000000000010
mask: 0b1111000000000011 mask: 0b1111000000000011
attributes: [[name:enable, value:1]]
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CLWSP: C__LWSP:
index: 78
encoding: 0b0100000000000010 encoding: 0b0100000000000010
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CMV: C__MV:
index: 79
encoding: 0b1000000000000010 encoding: 0b1000000000000010
mask: 0b1111000000000011 mask: 0b1111000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CJR: C__JR:
index: 80
encoding: 0b1000000000000010 encoding: 0b1000000000000010
mask: 0b1111000001111111 mask: 0b1111000001111111
size: 16 size: 16
branch: true branch: true
delay: 1 delay: 1
- CADD: __reserved_cmv:
index: 81
encoding: 0b1000000000000010
mask: 0b1111111111111111
size: 16
branch: false
delay: 1
C__ADD:
index: 82
encoding: 0b1001000000000010 encoding: 0b1001000000000010
mask: 0b1111000000000011 mask: 0b1111000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CJALR: C__JALR:
index: 83
encoding: 0b1001000000000010 encoding: 0b1001000000000010
mask: 0b1111000001111111 mask: 0b1111000001111111
size: 16 size: 16
branch: true branch: true
delay: 1 delay: 1
- CEBREAK: C__EBREAK:
index: 84
encoding: 0b1001000000000010 encoding: 0b1001000000000010
mask: 0b1111111111111111 mask: 0b1111111111111111
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- CSWSP: C__SWSP:
index: 85
encoding: 0b1100000000000010 encoding: 0b1100000000000010
mask: 0b1110000000000011 mask: 0b1110000000000011
size: 16 size: 16
branch: false branch: false
delay: 1 delay: 1
- DII: DII:
index: 86
encoding: 0b0000000000000000 encoding: 0b0000000000000000
mask: 0b1111111111111111 mask: 0b1111111111111111
size: 16 size: 16

View File

@ -19,7 +19,7 @@ setenv CXX $COWAREHOME/SLS/linux/common/bin/g++
cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \ cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \
-DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT} -DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT}
cmake --build build/PA --target install -j16 cmake --build build/PA --target install -j16
cd dbt-rise-tgc/contrib cd dbt-rise-tgc/contrib/pa
# import the TGC core itself # import the TGC core itself
pct tgc_import_tb.tcl pct tgc_import_tb.tcl
``` ```
@ -37,7 +37,7 @@ export CXX=$COWAREHOME/SLS/linux/common/bin/g++
cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \ cmake -S . -B build/PA -DCMAKE_BUILD_TYPE=Debug -DUSE_CWR_SYSTEMC=ON -DBUILD_SHARED_LIBS=ON \
-DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT} -DCODEGEN=OFF -DCMAKE_INSTALL_PREFIX=${TGFS_INSTALL_ROOT}
cmake --build build/PA --target install -j16 cmake --build build/PA --target install -j16
cd dbt-rise-tgc/contrib cd dbt-rise-tgc/contrib/pa
# import the TGC core itself # import the TGC core itself
pct tgc_import_tb.tcl pct tgc_import_tb.tcl
``` ```

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -8,9 +8,10 @@
instrGroups[groupName]+=it; instrGroups[groupName]+=it;
} }
instrGroups instrGroups
}%><%getInstructionGroups().each{name, instrList -> %> }%><%int index = 0; getInstructionGroups().each{name, instrList -> %>
${name}: <% instrList.findAll{!it.instruction.name.startsWith("__")}.each { %> ${name}: <% instrList.each { %>
- ${it.instruction.name}: ${it.instruction.name}:
index: ${index++}
encoding: ${it.encoding} encoding: ${it.encoding}
mask: ${it.mask}<%if(it.attributes.size) {%> mask: ${it.mask}<%if(it.attributes.size) {%>
attributes: ${it.attributes}<%}%> attributes: ${it.attributes}<%}%>

View File

@ -40,10 +40,11 @@ def nativeTypeSize(int size){
#include <iss/iss.h> #include <iss/iss.h>
#include <iss/interp/vm_base.h> #include <iss/interp/vm_base.h>
#include <util/logging.h> #include <util/logging.h>
#include <sstream>
#include <boost/coroutine2/all.hpp> #include <boost/coroutine2/all.hpp>
#include <functional> #include <functional>
#include <exception> #include <exception>
#include <vector>
#include <sstream>
#ifndef FMT_HEADER_ONLY #ifndef FMT_HEADER_ONLY
#define FMT_HEADER_ONLY #define FMT_HEADER_ONLY

View File

@ -46,7 +46,7 @@ public:
using this_class = hwl<BASE>; using this_class = hwl<BASE>;
using reg_t = typename BASE::reg_t; using reg_t = typename BASE::reg_t;
hwl(); hwl(feature_config cfg = feature_config{});
virtual ~hwl() = default; virtual ~hwl() = default;
protected: protected:
@ -56,7 +56,7 @@ protected:
template<typename BASE> template<typename BASE>
inline hwl<BASE>::hwl() { inline hwl<BASE>::hwl(feature_config cfg): BASE(cfg) {
for (unsigned addr = 0x800; addr < 0x803; ++addr){ for (unsigned addr = 0x800; addr < 0x803; ++addr){
this->register_custom_csr_rd(addr); this->register_custom_csr_rd(addr);
this->register_custom_csr_wr(addr); this->register_custom_csr_wr(addr);

View File

@ -226,6 +226,8 @@ struct feature_config {
unsigned clic_num_trigger{0}; unsigned clic_num_trigger{0};
uint64_t tcm_base{0x10000000}; uint64_t tcm_base{0x10000000};
uint64_t tcm_size{0x8000}; uint64_t tcm_size{0x8000};
uint64_t io_address{0xf0000000};
uint64_t io_addr_mask{0xf0000000};
}; };
class trap_load_access_fault : public trap_access { class trap_load_access_fault : public trap_access {

View File

@ -682,7 +682,7 @@ iss::status riscv_hart_m_p<BASE, FEAT>::read(const address_type type, const acce
} else { } else {
res = hart_mem_rd_delegate( phys_addr, length, data); res = hart_mem_rd_delegate( phys_addr, length, data);
} }
if (unlikely(res != iss::Ok)){ if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)){
this->reg.trap_state = (1UL << 31) | (5 << 16); // issue trap 5 (load access fault this->reg.trap_state = (1UL << 31) | (5 << 16); // issue trap 5 (load access fault
fault_data=addr; fault_data=addr;
} }
@ -775,7 +775,7 @@ iss::status riscv_hart_m_p<BASE, FEAT>::write(const address_type type, const acc
} else { } else {
res = write_mem( phys_addr, length, data); res = write_mem( phys_addr, length, data);
} }
if (unlikely(res != iss::Ok)) { if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)) {
this->reg.trap_state = (1UL << 31) | (7 << 16); // issue trap 7 (Store/AMO access fault) this->reg.trap_state = (1UL << 31) | (7 << 16); // issue trap 7 (Store/AMO access fault)
fault_data=addr; fault_data=addr;
} }

View File

@ -286,7 +286,7 @@ public:
return m[mode]; return m[mode];
} }
riscv_hart_msu_vp(); riscv_hart_msu_vp(feature_config cfg = feature_config{});
virtual ~riscv_hart_msu_vp() = default; virtual ~riscv_hart_msu_vp() = default;
void reset(uint64_t address) override; void reset(uint64_t address) override;
@ -636,7 +636,7 @@ iss::status riscv_hart_msu_vp<BASE>::read(const address_type type, const access_
} }
} }
auto res = read_mem( BASE::v2p(iss::addr_t{access, type, space, addr}), length, data); auto res = read_mem( BASE::v2p(iss::addr_t{access, type, space, addr}), length, data);
if (unlikely(res != iss::Ok)){ if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)){
this->reg.trap_state = (1 << 31) | (5 << 16); // issue trap 5 (load access fault this->reg.trap_state = (1 << 31) | (5 << 16); // issue trap 5 (load access fault
fault_data=addr; fault_data=addr;
} }
@ -734,7 +734,7 @@ iss::status riscv_hart_msu_vp<BASE>::write(const address_type type, const access
} }
} }
auto res = write_mem(paddr, length, data); auto res = write_mem(paddr, length, data);
if (unlikely(res != iss::Ok)) { if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)) {
this->reg.trap_state = (1UL << 31) | (7UL << 16); // issue trap 7 (Store/AMO access fault) this->reg.trap_state = (1UL << 31) | (7UL << 16); // issue trap 7 (Store/AMO access fault)
fault_data=addr; fault_data=addr;
} }

View File

@ -850,7 +850,7 @@ iss::status riscv_hart_mu_p<BASE, FEAT>::read(const address_type type, const acc
} else { } else {
res = hart_mem_rd_delegate( phys_addr, length, data); res = hart_mem_rd_delegate( phys_addr, length, data);
} }
if (unlikely(res != iss::Ok)){ if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)){
this->reg.trap_state = (1UL << 31) | (5 << 16); // issue trap 5 (load access fault this->reg.trap_state = (1UL << 31) | (5 << 16); // issue trap 5 (load access fault
fault_data=addr; fault_data=addr;
} }
@ -951,7 +951,7 @@ iss::status riscv_hart_mu_p<BASE, FEAT>::write(const address_type type, const ac
} else { } else {
res = hart_mem_wr_delegate( phys_addr, length, data); res = hart_mem_wr_delegate( phys_addr, length, data);
} }
if (unlikely(res != iss::Ok)) { if (unlikely(res != iss::Ok && (access & access_type::DEBUG) == 0)) {
this->reg.trap_state = (1UL << 31) | (7UL << 16); // issue trap 7 (Store/AMO access fault) this->reg.trap_state = (1UL << 31) | (7UL << 16); // issue trap 7 (Store/AMO access fault)
fault_data=addr; fault_data=addr;
} }

View File

@ -81,7 +81,7 @@ public:
using mem_write_f = typename BASE::mem_write_f; using mem_write_f = typename BASE::mem_write_f;
using phys_addr_t = typename BASE::phys_addr_t; using phys_addr_t = typename BASE::phys_addr_t;
wt_cache(); wt_cache(feature_config cfg = feature_config{});
virtual ~wt_cache() = default; virtual ~wt_cache() = default;
unsigned size{4096}; unsigned size{4096};
@ -103,7 +103,11 @@ protected:
template<typename BASE> template<typename BASE>
inline wt_cache<BASE>::wt_cache() { inline wt_cache<BASE>::wt_cache(feature_config cfg)
:BASE(cfg)
, io_address{cfg.io_address}
, io_addr_mask{cfg.io_addr_mask}
{
auto cb = base_class::replace_mem_access( auto cb = base_class::replace_mem_access(
[this](phys_addr_t a, unsigned l, uint8_t* const d) -> iss::status { return read_cache(a, l,d);}, [this](phys_addr_t a, unsigned l, uint8_t* const d) -> iss::status { return read_cache(a, l,d);},
[this](phys_addr_t a, unsigned l, uint8_t const* const d) -> iss::status { return write_cache(a, l,d);}); [this](phys_addr_t a, unsigned l, uint8_t const* const d) -> iss::status { return write_cache(a, l,d);});

View File

@ -1,3 +1,4 @@
/******************************************************************************* /*******************************************************************************
* Copyright (C) 2017 - 2023, MINRES Technologies GmbH * Copyright (C) 2017 - 2023, MINRES Technologies GmbH
* All rights reserved. * All rights reserved.
@ -33,18 +34,12 @@
******************************************************************************/ ******************************************************************************/
#include "cycle_estimate.h" #include "cycle_estimate.h"
#include <yaml-cpp/yaml.h>
#include <iss/arch_if.h> #include <iss/arch_if.h>
#include <util/logging.h> #include <util/logging.h>
#include <rapidjson/document.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/writer.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/ostreamwrapper.h>
#include <rapidjson/error/en.h>
#include <fstream> #include <fstream>
using namespace rapidjson;
using namespace std; using namespace std;
iss::plugin::cycle_estimate::cycle_estimate(string const& config_file_name) iss::plugin::cycle_estimate::cycle_estimate(string const& config_file_name)
@ -61,40 +56,31 @@ bool iss::plugin::cycle_estimate::registration(const char* const version, vm_if&
if(!instr_if) return false; if(!instr_if) return false;
const string core_name = instr_if->core_type_name(); const string core_name = instr_if->core_type_name();
if (config_file_name.length() > 0) { if (config_file_name.length() > 0) {
ifstream is(config_file_name); std::ifstream is(config_file_name);
if (is.is_open()) { if (is.is_open()) {
try { try {
IStreamWrapper isw(is); auto root = YAML::LoadAll(is);
Document d; if(root.size()!=1) {
ParseResult ok = d.ParseStream(isw); LOG(ERR) << "Too many root nodes in YAML file " << config_file_name;
if(ok) { }
Value& val = d[core_name.c_str()]; for (auto p : root[0]) {
if(val.IsArray()){ auto isa_subset = p.first;
delays.reserve(val.Size()); auto instructions = p.second;
for (auto it = val.Begin(); it != val.End(); ++it) { for (auto const& instr : instructions) {
auto& name = (*it)["name"]; instr_desc res;
auto& size = (*it)["size"]; res.is_branch = instr.second["branch"].as<bool>();
auto& delay = (*it)["delay"]; auto delay = instr.second["delay"];
auto& branch = (*it)["branch"]; if(delay.IsSequence()) {
if(delay.IsArray()) { res.not_taken = delay[0].as<uint64_t>();
auto dt = delay[0].Get<unsigned>(); res.taken = delay[1].as<uint64_t>();
auto dnt = delay[1].Get<unsigned>(); } else {
delays.push_back(instr_desc{size.Get<unsigned>(), dt, dnt, branch.Get<bool>()}); res.not_taken = delay.as<uint64_t>();
} else if(delay.Is<unsigned>()) { res.taken = res.not_taken;
auto d = delay.Get<unsigned>(); }
delays.push_back(instr_desc{size.Get<unsigned>(), d, d, branch.Get<bool>()}); delays.push_back(std::move(res));
} else }
throw runtime_error("JSON parse error"); }
} } catch (YAML::ParserException &e) {
} else {
LOG(ERR)<<"plugin cycle_estimate: could not find an entry for "<<core_name<<" in JSON file"<<endl;
return false;
}
} else {
LOG(ERR)<<"plugin cycle_estimate: could not parse in JSON file at "<< ok.Offset()<<": "<<GetParseError_En(ok.Code())<<endl;
return false;
}
} catch (runtime_error &e) {
LOG(ERR) << "Could not parse input file " << config_file_name << ", reason: " << e.what(); LOG(ERR) << "Could not parse input file " << config_file_name << ", reason: " << e.what();
return false; return false;
} }
@ -112,7 +98,7 @@ void iss::plugin::cycle_estimate::callback(instr_info_t instr_info) {
auto entry = delays[instr_info.instr_id]; auto entry = delays[instr_info.instr_id];
bool taken = instr_if->is_branch_taken(); bool taken = instr_if->is_branch_taken();
if (taken && (entry.taken > 1)) if (taken && (entry.taken > 1))
instr_if->update_last_instr_cycles(entry.taken); instr_if->update_last_instr_cycles(entry.taken);
else if (entry.not_taken > 1) else if (entry.not_taken > 1)
instr_if->update_last_instr_cycles(entry.not_taken); instr_if->update_last_instr_cycles(entry.not_taken);
} }

View File

@ -34,6 +34,7 @@
#include "instruction_count.h" #include "instruction_count.h"
#include <iss/instrumentation_if.h> #include <iss/instrumentation_if.h>
#include <yaml-cpp/yaml.h>
#include <iss/arch_if.h> #include <iss/arch_if.h>
#include <util/logging.h> #include <util/logging.h>
@ -44,8 +45,30 @@ iss::plugin::instruction_count::instruction_count(std::string config_file_name)
std::ifstream is(config_file_name); std::ifstream is(config_file_name);
if (is.is_open()) { if (is.is_open()) {
try { try {
is >> root; auto root = YAML::LoadAll(is);
} catch (Json::RuntimeError &e) { if(root.size()!=1) {
LOG(ERR) << "Too many rro nodes in YAML file " << config_file_name;
}
for (auto p : root[0]) {
auto isa_subset = p.first;
auto instructions = p.second;
for (auto const& instr : instructions) {
instr_delay res;
res.instr_name = instr.first.as<std::string>();
res.size = instr.second["encoding"].as<std::string>().size()-2; // not counting 0b
auto delay = instr.second["delay"];
if(delay.IsSequence()) {
res.not_taken_delay = delay[0].as<uint64_t>();
res.taken_delay = delay[1].as<uint64_t>();
} else {
res.not_taken_delay = delay.as<uint64_t>();
res.taken_delay = res.not_taken_delay;
}
delays.push_back(std::move(res));
}
}
rep_counts.resize(delays.size());
} catch (YAML::ParserException &e) {
LOG(ERR) << "Could not parse input file " << config_file_name << ", reason: " << e.what(); LOG(ERR) << "Could not parse input file " << config_file_name << ", reason: " << e.what();
} }
} else { } else {
@ -57,7 +80,7 @@ iss::plugin::instruction_count::instruction_count(std::string config_file_name)
iss::plugin::instruction_count::~instruction_count() { iss::plugin::instruction_count::~instruction_count() {
size_t idx=0; size_t idx=0;
for(auto it:delays){ for(auto it:delays){
if(rep_counts[idx]>0) if(rep_counts[idx]>0 && it.instr_name.find("__"!=0))
LOG(INFO)<<it.instr_name<<";"<<rep_counts[idx]; LOG(INFO)<<it.instr_name<<";"<<rep_counts[idx];
idx++; idx++;
} }
@ -66,27 +89,6 @@ iss::plugin::instruction_count::~instruction_count() {
bool iss::plugin::instruction_count::registration(const char* const version, vm_if& vm) { bool iss::plugin::instruction_count::registration(const char* const version, vm_if& vm) {
auto instr_if = vm.get_arch()->get_instrumentation_if(); auto instr_if = vm.get_arch()->get_instrumentation_if();
if(!instr_if) return false; if(!instr_if) return false;
const std::string core_name = instr_if->core_type_name();
Json::Value &val = root[core_name];
if(!val.isNull() && val.isArray()){
delays.reserve(val.size());
for(auto it:val){
auto name = it["name"];
auto size = it["size"];
auto delay = it["delay"];
if(!name.isString() || !size.isUInt() || !(delay.isUInt() || delay.isArray())) throw std::runtime_error("JSON parse error");
if(delay.isUInt()){
const instr_delay entry{name.asCString(), size.asUInt(), delay.asUInt(), 0};
delays.push_back(entry);
} else {
const instr_delay entry{name.asCString(), size.asUInt(), delay[0].asUInt(), delay[1].asUInt()};
delays.push_back(entry);
}
}
rep_counts.resize(delays.size());
} else {
LOG(ERR)<<"plugin instruction_count: could not find an entry for "<<core_name<<" in JSON file"<<std::endl;
}
return true; return true;
} }

View File

@ -36,8 +36,8 @@
#define _ISS_PLUGIN_INSTRUCTION_COUNTER_H_ #define _ISS_PLUGIN_INSTRUCTION_COUNTER_H_
#include <iss/vm_plugin.h> #include <iss/vm_plugin.h>
#include <json/json.h>
#include <string> #include <string>
#include <vector>
namespace iss { namespace iss {
namespace plugin { namespace plugin {
@ -72,7 +72,6 @@ public:
void callback(instr_info_t) override; void callback(instr_info_t) override;
private: private:
Json::Value root;
std::vector<instr_delay> delays; std::vector<instr_delay> delays;
std::vector<uint64_t> rep_counts; std::vector<uint64_t> rep_counts;
}; };

View File

@ -1,217 +1,222 @@
/******************************************************************************* /*******************************************************************************
* Copyright (C) 2017, 2018 MINRES Technologies GmbH * Copyright (C) 2017, 2018 MINRES Technologies GmbH
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* *
* 1. Redistributions of source code must retain the above copyright notice, * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer. * this list of conditions and the following disclaimer.
* *
* 2. Redistributions in binary form must reproduce the above copyright notice, * 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation * this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution. * and/or other materials provided with the distribution.
* *
* 3. Neither the name of the copyright holder nor the names of its contributors * 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 * may be used to endorse or promote products derived from this software
* without specific prior written permission. * without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * 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 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
* *
*******************************************************************************/ *******************************************************************************/
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <array> #include <array>
#include <iss/factory.h> #include <iss/factory.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
#include "iss/arch/tgc_mapper.h" #include "iss/arch/tgc_mapper.h"
#ifdef WITH_LLVM #ifdef WITH_LLVM
#include <iss/llvm/jit_init.h> #include <iss/llvm/jit_init.h>
#endif #endif
#include <iss/log_categories.h> #include <iss/log_categories.h>
#include "iss/plugin/cycle_estimate.h" #include "iss/plugin/cycle_estimate.h"
#include "iss/plugin/instruction_count.h" #include "iss/plugin/instruction_count.h"
#ifndef WIN32 #ifndef WIN32
#include <iss/plugin/loader.h> #include <iss/plugin/loader.h>
#endif #endif
#if defined(HAS_LUA) #if defined(HAS_LUA)
#include <iss/plugin/lua.h> #include <iss/plugin/lua.h>
#endif #endif
namespace po = boost::program_options; namespace po = boost::program_options;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
/* /*
* Define and parse the program options * Define and parse the program options
*/ */
po::variables_map clim; po::variables_map clim;
po::options_description desc("Options"); po::options_description desc("Options");
// clang-format off // clang-format off
desc.add_options() desc.add_options()
("help,h", "Print help message") ("help,h", "Print help message")
("verbose,v", po::value<int>()->default_value(4), "Sets logging verbosity") ("verbose,v", po::value<int>()->default_value(4), "Sets logging verbosity")
("logfile,l", po::value<std::string>(), "Sets default log file.") ("logfile,l", po::value<std::string>(), "Sets default log file.")
("disass,d", po::value<std::string>()->implicit_value(""), "Enables disassembly") ("disass,d", po::value<std::string>()->implicit_value(""), "Enables disassembly")
("gdb-port,g", po::value<unsigned>()->default_value(0), "enable gdb server and specify port to use") ("gdb-port,g", po::value<unsigned>()->default_value(0), "enable gdb server and specify port to use")
("instructions,i", po::value<uint64_t>()->default_value(std::numeric_limits<uint64_t>::max()), "max. number of instructions to simulate") ("instructions,i", po::value<uint64_t>()->default_value(std::numeric_limits<uint64_t>::max()), "max. number of instructions to simulate")
("reset,r", po::value<std::string>(), "reset address") ("reset,r", po::value<std::string>(), "reset address")
("dump-ir", "dump the intermediate representation") ("dump-ir", "dump the intermediate representation")
("elf,f", po::value<std::vector<std::string>>(), "ELF file(s) to load") ("elf,f", po::value<std::vector<std::string>>(), "ELF file(s) to load")
("mem,m", po::value<std::string>(), "the memory input file") ("mem,m", po::value<std::string>(), "the memory input file")
("plugin,p", po::value<std::vector<std::string>>(), "plugin to activate") ("plugin,p", po::value<std::vector<std::string>>(), "plugin to activate")
("backend", po::value<std::string>()->default_value("interp"), "the ISS backend to use, options are: interp, tcc") ("backend", po::value<std::string>()->default_value("interp"), "the ISS backend to use, options are: interp, tcc")
("isa", po::value<std::string>()->default_value("tgc5c"), "isa to use for simulation"); ("isa", po::value<std::string>()->default_value("tgc5c"), "core or isa name to use for simulation, use '?' to get list");
// clang-format on // clang-format on
auto parsed = po::command_line_parser(argc, argv).options(desc).allow_unregistered().run(); auto parsed = po::command_line_parser(argc, argv).options(desc).allow_unregistered().run();
try { try {
po::store(parsed, clim); // can throw po::store(parsed, clim); // can throw
// --help option // --help option
if (clim.count("help")) { if (clim.count("help")) {
std::cout << "DBT-RISE-RiscV simulator for RISC-V" << std::endl << desc << std::endl; std::cout << "DBT-RISE-TGC simulator for TGC RISC-V cores" << std::endl << desc << std::endl;
return 0; return 0;
} }
po::notify(clim); // throws on error, so do after help in case po::notify(clim); // throws on error, so do after help in case
} catch (po::error &e) { } catch (po::error &e) {
// there are problems // there are problems
std::cerr << "ERROR: " << e.what() << std::endl << std::endl; std::cerr << "ERROR: " << e.what() << std::endl << std::endl;
std::cerr << desc << std::endl; std::cerr << desc << std::endl;
return 1; return 1;
} }
std::vector<std::string> args = collect_unrecognized(parsed.options, po::include_positional); std::vector<std::string> args = collect_unrecognized(parsed.options, po::include_positional);
LOGGER(DEFAULT)::print_time() = false; LOGGER(DEFAULT)::print_time() = false;
LOGGER(connection)::print_time() = false; LOGGER(connection)::print_time() = false;
auto l = logging::as_log_level(clim["verbose"].as<int>()); auto l = logging::as_log_level(clim["verbose"].as<int>());
LOGGER(DEFAULT)::reporting_level() = l; LOGGER(DEFAULT)::reporting_level() = l;
LOGGER(connection)::reporting_level() = l; LOGGER(connection)::reporting_level() = l;
if (clim.count("logfile")) { if (clim.count("logfile")) {
// configure the connection logger // configure the connection logger
auto f = fopen(clim["logfile"].as<std::string>().c_str(), "w"); auto f = fopen(clim["logfile"].as<std::string>().c_str(), "w");
LOG_OUTPUT(DEFAULT)::stream() = f; LOG_OUTPUT(DEFAULT)::stream() = f;
LOG_OUTPUT(connection)::stream() = f; LOG_OUTPUT(connection)::stream() = f;
} }
std::vector<iss::vm_plugin *> plugin_list; std::vector<iss::vm_plugin *> plugin_list;
auto res = 0; auto res = 0;
try { try {
#ifdef WITH_LLVM #ifdef WITH_LLVM
// application code comes here // // application code comes here //
iss::init_jit_debug(argc, argv); iss::init_jit_debug(argc, argv);
#endif #endif
bool dump = clim.count("dump-ir"); bool dump = clim.count("dump-ir");
auto & f = iss::core_factory::instance(); auto & f = iss::core_factory::instance();
// instantiate the simulator // instantiate the simulator
iss::vm_ptr vm{nullptr}; iss::vm_ptr vm{nullptr};
iss::cpu_ptr cpu{nullptr}; iss::cpu_ptr cpu{nullptr};
std::string isa_opt(clim["isa"].as<std::string>()); std::string isa_opt(clim["isa"].as<std::string>());
if(isa_opt.size()==0 || isa_opt == "?") { if(isa_opt.size()==0 || isa_opt == "?") {
std::cout<<"Available cores: "<<util::join(f.get_names(), ", ")<<std::endl; auto list = f.get_names();
return 0; std::sort(std::begin(list), std::end(list));
} else if (isa_opt.find('|') != std::string::npos) { std::cout<<"Available implementations (core|platform|backend):\n - "<<util::join(list, "\n - ")<<std::endl;
std::tie(cpu, vm) = f.create(isa_opt+"|"+clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>()); return 0;
} else { } else if (isa_opt.find('|') != std::string::npos) {
auto base_isa = isa_opt.substr(0, 5); std::tie(cpu, vm) = f.create(isa_opt+"|"+clim["backend"].as<std::string>(), clim["gdb-port"].as<unsigned>());
if(base_isa=="tgc_d" || base_isa=="tgc_e") { } else {
isa_opt += "|mu_p_clic_pmp|"+clim["backend"].as<std::string>(); auto base_isa = isa_opt.substr(0, 5);
} else { if(base_isa=="tgc5d" || base_isa=="tgc5e") {
isa_opt += "|m_p|"+clim["backend"].as<std::string>(); isa_opt += "|mu_p_clic_pmp|"+clim["backend"].as<std::string>();
} } else {
std::tie(cpu, vm) = f.create(isa_opt, clim["gdb-port"].as<unsigned>()); isa_opt += "|m_p|"+clim["backend"].as<std::string>();
} }
if(!cpu ){ std::tie(cpu, vm) = f.create(isa_opt, clim["gdb-port"].as<unsigned>());
LOG(ERR) << "Could not create cpu for isa " << isa_opt << " and backend " <<clim["backend"].as<std::string>()<< std::endl; }
return 127; if(!cpu ){
} LOG(ERR) << "Could not create cpu for isa " << isa_opt << " and backend " <<clim["backend"].as<std::string>()<< std::endl;
if(!vm ){ return 127;
LOG(ERR) << "Could not create vm for isa " << isa_opt << " and backend " <<clim["backend"].as<std::string>()<< std::endl; }
return 127; if(!vm ){
} LOG(ERR) << "Could not create vm for isa " << isa_opt << " and backend " <<clim["backend"].as<std::string>()<< std::endl;
if (clim.count("plugin")) { return 127;
for (std::string const& opt_val : clim["plugin"].as<std::vector<std::string>>()) { }
std::string plugin_name=opt_val; if (clim.count("plugin")) {
std::string arg{""}; for (std::string const& opt_val : clim["plugin"].as<std::vector<std::string>>()) {
std::size_t found = opt_val.find('='); std::string plugin_name=opt_val;
if (found != std::string::npos) { std::string arg{""};
plugin_name = opt_val.substr(0, found); std::size_t found = opt_val.find('=');
arg = opt_val.substr(found + 1, opt_val.size()); if (found != std::string::npos) {
} plugin_name = opt_val.substr(0, found);
if (plugin_name == "ic") { arg = opt_val.substr(found + 1, opt_val.size());
auto *ic_plugin = new iss::plugin::instruction_count(arg); }
vm->register_plugin(*ic_plugin); #if defined(WITH_PLUGINS)
plugin_list.push_back(ic_plugin); if (plugin_name == "ic") {
} else if (plugin_name == "ce") { auto *ic_plugin = new iss::plugin::instruction_count(arg);
auto *ce_plugin = new iss::plugin::cycle_estimate(arg); vm->register_plugin(*ic_plugin);
vm->register_plugin(*ce_plugin); plugin_list.push_back(ic_plugin);
plugin_list.push_back(ce_plugin); } else if (plugin_name == "ce") {
}else { auto *ce_plugin = new iss::plugin::cycle_estimate(arg);
#ifndef WIN32 vm->register_plugin(*ce_plugin);
std::vector<char const*> a{}; plugin_list.push_back(ce_plugin);
if(arg.length()) } else
a.push_back({arg.c_str()}); #endif
iss::plugin::loader l(plugin_name, {{"initPlugin"}}); {
auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data()); #if !defined(WIN32)
if(plugin){ std::vector<char const*> a{};
vm->register_plugin(*plugin); if(arg.length())
plugin_list.push_back(plugin); a.push_back({arg.c_str()});
} else iss::plugin::loader l(plugin_name, {{"initPlugin"}});
#endif auto* plugin = l.call_function<iss::vm_plugin*>("initPlugin", a.size(), a.data());
{ if(plugin){
LOG(ERR) << "Unknown plugin name: " << plugin_name << ", valid names are 'ce', 'ic'" << std::endl; vm->register_plugin(*plugin);
return 127; plugin_list.push_back(plugin);
} } else
} #endif
} {
} LOG(ERR) << "Unknown plugin name: " << plugin_name << ", valid names are 'ce', 'ic'" << std::endl;
if (clim.count("disass")) { return 127;
vm->setDisassEnabled(true); }
LOGGER(disass)::reporting_level() = logging::INFO; }
LOGGER(disass)::print_time() = false; }
auto file_name = clim["disass"].as<std::string>(); }
if (file_name.length() > 0) { if (clim.count("disass")) {
LOG_OUTPUT(disass)::stream() = fopen(file_name.c_str(), "w"); vm->setDisassEnabled(true);
LOGGER(disass)::print_severity() = false; LOGGER(disass)::reporting_level() = logging::INFO;
} LOGGER(disass)::print_time() = false;
} auto file_name = clim["disass"].as<std::string>();
uint64_t start_address = 0; if (file_name.length() > 0) {
if (clim.count("mem")) LOG_OUTPUT(disass)::stream() = fopen(file_name.c_str(), "w");
vm->get_arch()->load_file(clim["mem"].as<std::string>()); LOGGER(disass)::print_severity() = false;
if (clim.count("elf")) }
for (std::string input : clim["elf"].as<std::vector<std::string>>()) { }
auto start_addr = vm->get_arch()->load_file(input); uint64_t start_address = 0;
if (start_addr.second) start_address = start_addr.first; if (clim.count("mem"))
} vm->get_arch()->load_file(clim["mem"].as<std::string>());
for (std::string input : args) { if (clim.count("elf"))
auto start_addr = vm->get_arch()->load_file(input); // treat remaining arguments as elf files for (std::string input : clim["elf"].as<std::vector<std::string>>()) {
if (start_addr.second) start_address = start_addr.first; auto start_addr = vm->get_arch()->load_file(input);
} if (start_addr.second) start_address = start_addr.first;
if (clim.count("reset")) { }
auto str = clim["reset"].as<std::string>(); for (std::string input : args) {
start_address = str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10); auto start_addr = vm->get_arch()->load_file(input); // treat remaining arguments as elf files
} if (start_addr.second) start_address = start_addr.first;
vm->reset(start_address); }
auto cycles = clim["instructions"].as<uint64_t>(); if (clim.count("reset")) {
res = vm->start(cycles, dump); auto str = clim["reset"].as<std::string>();
} catch (std::exception &e) { start_address = str.find("0x") == 0 ? std::stoull(str.substr(2), nullptr, 16) : std::stoull(str, nullptr, 10);
LOG(ERR) << "Unhandled Exception reached the top of main: " << e.what() << ", application will now exit" }
<< std::endl; vm->reset(start_address);
res = 2; auto cycles = clim["instructions"].as<uint64_t>();
} res = vm->start(cycles, dump);
// cleanup to let plugins report of needed } catch (std::exception &e) {
for (auto *p : plugin_list) { LOG(ERR) << "Unhandled Exception reached the top of main: " << e.what() << ", application will now exit"
delete p; << std::endl;
} res = 2;
return res; }
} // cleanup to let plugins report of needed
for (auto *p : plugin_list) {
delete p;
}
return res;
}

View File

@ -50,7 +50,6 @@
#include <array> #include <array>
#include <iss/plugin/cycle_estimate.h> #include <iss/plugin/cycle_estimate.h>
#include <iss/plugin/instruction_count.h> #include <iss/plugin/instruction_count.h>
#include <iss/plugin/pctrace.h>
// clang-format on // clang-format on
@ -283,10 +282,6 @@ void core_complex::before_end_of_elaboration() {
auto *plugin = new iss::plugin::cycle_estimate(filename); auto *plugin = new iss::plugin::cycle_estimate(filename);
cpu->vm->register_plugin(*plugin); cpu->vm->register_plugin(*plugin);
plugin_list.push_back(plugin); plugin_list.push_back(plugin);
} else if (plugin_name == "pctrace") {
auto *plugin = new iss::plugin::pctrace(filename);
cpu->vm->register_plugin(*plugin);
plugin_list.push_back(plugin);
} else { } else {
#ifndef WIN32 #ifndef WIN32
std::array<char const*, 1> a{{filename.c_str()}}; std::array<char const*, 1> a{{filename.c_str()}};

View File

@ -36,10 +36,11 @@
#include <iss/iss.h> #include <iss/iss.h>
#include <iss/interp/vm_base.h> #include <iss/interp/vm_base.h>
#include <util/logging.h> #include <util/logging.h>
#include <sstream>
#include <boost/coroutine2/all.hpp> #include <boost/coroutine2/all.hpp>
#include <functional> #include <functional>
#include <exception> #include <exception>
#include <vector>
#include <sstream>
#ifndef FMT_HEADER_ONLY #ifndef FMT_HEADER_ONLY
#define FMT_HEADER_ONLY #define FMT_HEADER_ONLY
@ -2522,8 +2523,7 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
// execute instruction // execute instruction
{ {
if(rs1 && rs1 < traits::RFS) { if(rs1 && rs1 < traits::RFS) {
uint32_t addr_mask = (uint32_t)- 2; *NEXT_PC = *(X+rs1 % traits::RFS) & ~ 0x1;
*NEXT_PC = *(X+rs1 % traits::RFS) & addr_mask;
this->core.reg.last_branch = 1; this->core.reg.last_branch = 1;
} }
else { else {
@ -2589,10 +2589,9 @@ typename vm_base<ARCH>::virt_addr_t vm_impl<ARCH>::execute_inst(finish_cond_e co
raise(0, 2); raise(0, 2);
} }
else { else {
uint32_t addr_mask = (uint32_t)- 2;
uint32_t new_pc = *(X+rs1); uint32_t new_pc = *(X+rs1);
*(X+1) = (uint32_t)(*PC + 2); *(X+1) = (uint32_t)(*PC + 2);
*NEXT_PC = new_pc & addr_mask; *NEXT_PC = new_pc & ~ 0x1;
this->core.reg.last_branch = 1; this->core.reg.last_branch = 1;
} }
} }

View File

@ -4549,13 +4549,13 @@ volatile std::array<bool, 2> dummy = {
auto* vm = new llvm::tgc5c::vm_impl<arch::tgc5c>(*cpu, false); auto* vm = new llvm::tgc5c::vm_impl<arch::tgc5c>(*cpu, false);
if (port != 0) debugger::server<debugger::gdb_session>::run_server(vm, port); if (port != 0) debugger::server<debugger::gdb_session>::run_server(vm, port);
return {cpu_ptr{cpu}, vm_ptr{vm}}; return {cpu_ptr{cpu}, vm_ptr{vm}};
}), })/*,
core_factory::instance().register_creator("tgc5c|mu_p|llvm", [](unsigned port, void*) -> std::tuple<cpu_ptr, vm_ptr>{ core_factory::instance().register_creator("tgc5c|mu_p|llvm", [](unsigned port, void*) -> std::tuple<cpu_ptr, vm_ptr>{
auto* cpu = new iss::arch::riscv_hart_mu_p<iss::arch::tgc5c>(); auto* cpu = new iss::arch::riscv_hart_mu_p<iss::arch::tgc5c>();
auto* vm = new llvm::tgc5c::vm_impl<arch::tgc5c>(*cpu, false); auto* vm = new llvm::tgc5c::vm_impl<arch::tgc5c>(*cpu, false);
if (port != 0) debugger::server<debugger::gdb_session>::run_server(vm, port); if (port != 0) debugger::server<debugger::gdb_session>::run_server(vm, port);
return {cpu_ptr{cpu}, vm_ptr{vm}}; return {cpu_ptr{cpu}, vm_ptr{vm}};
}) })*/
}; };
} }
} }

View File

@ -3303,12 +3303,12 @@ private:
pc=pc+ 2; pc=pc+ 2;
gen_set_pc(tu, pc, traits::NEXT_PC); gen_set_pc(tu, pc, traits::NEXT_PC);
tu.open_scope(); tu.open_scope();
if(rs1&&rs1<static_cast<uint32_t>(traits:: RFS)){ auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32); if(rs1&&rs1<static_cast<uint32_t>(traits:: RFS)) {
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and( auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(
tu.load(rs1%static_cast<uint32_t>(traits:: RFS)+ traits::X0, 0), tu.load(rs1%static_cast<uint32_t>(traits:: RFS)+ traits::X0, 0),
addr_mask),32); tu.constant(~ 0x1,8)),32);
tu.store(traits::NEXT_PC, PC_val_v); tu.store(traits::NEXT_PC, PC_val_v);
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2)); tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
} }
else{ else{
this->gen_raise_trap(tu, 0, 2); this->gen_raise_trap(tu, 0, 2);
@ -3401,13 +3401,12 @@ private:
this->gen_raise_trap(tu, 0, 2); this->gen_raise_trap(tu, 0, 2);
} }
else{ else{
auto addr_mask = tu.assignment(tu.constant((uint32_t)- 2,32),32);
auto new_pc = tu.assignment(tu.load(rs1+ traits::X0, 0),32); auto new_pc = tu.assignment(tu.load(rs1+ traits::X0, 0),32);
tu.store(1 + traits::X0, tu.store(1 + traits::X0,
tu.constant((uint32_t)(PC+ 2),32)); tu.constant((uint32_t)(PC+ 2),32));
auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and( auto PC_val_v = tu.assignment("PC_val", tu.bitwise_and(
new_pc, new_pc,
addr_mask),32); tu.constant(~ 0x1,8)),32);
tu.store(traits::NEXT_PC, PC_val_v); tu.store(traits::NEXT_PC, PC_val_v);
tu.store(traits::LAST_BRANCH, tu.constant(2U, 2)); tu.store(traits::LAST_BRANCH, tu.constant(2U, 2));
} }
@ -3433,7 +3432,7 @@ private:
gen_set_pc(tu, pc, traits::NEXT_PC); gen_set_pc(tu, pc, traits::NEXT_PC);
tu.open_scope(); tu.open_scope();
this->gen_raise_trap(tu, 0, 3); this->gen_raise_trap(tu, 0, 3);
auto returnValue = std::make_tuple(TRAP); auto returnValue = std::make_tuple(CONT);
tu.close_scope(); tu.close_scope();
gen_trap_check(tu); gen_trap_check(tu);
@ -3490,7 +3489,7 @@ private:
gen_set_pc(tu, pc, traits::NEXT_PC); gen_set_pc(tu, pc, traits::NEXT_PC);
tu.open_scope(); tu.open_scope();
this->gen_raise_trap(tu, 0, 2); this->gen_raise_trap(tu, 0, 2);
auto returnValue = std::make_tuple(TRAP); auto returnValue = std::make_tuple(CONT);
tu.close_scope(); tu.close_scope();
gen_trap_check(tu); gen_trap_check(tu);