[Sim, SemaGen, CMake] Added cached-interp. Changed sema_gen to cpp_gen. Added cmake.#14
[Sim, SemaGen, CMake] Added cached-interp. Changed sema_gen to cpp_gen. Added cmake.#14egorshamshura wants to merge 14 commits intoProteusLab:masterfrom
Conversation
675a727 to
f406ae7
Compare
0be8c14 to
4f82916
Compare
685c386 to
89010af
Compare
89010af to
a5fa241
Compare
cmake/CompilerOptions.cmake
Outdated
| @@ -0,0 +1,4 @@ | |||
| set(CMAKE_CXX_STANDARD 23) | |||
There was a problem hiding this comment.
Consider using per target properties
There was a problem hiding this comment.
Moved to target properties
| "CMAKE_BUILD_TYPE": "Debug" | ||
| } | ||
| } | ||
| ] |
There was a problem hiding this comment.
Consider adding build presets also
.github/workflows/build.yml
Outdated
| jobs: | ||
| formatting-check: | ||
| name: Formatting check | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
Fix particular ubuntu version
There was a problem hiding this comment.
started to use ubuntu-22.04
cmake/Bundler.cmake
Outdated
| set(BUNDLE_PATH "bundle") | ||
| endif() | ||
|
|
||
| add_custom_target(bundle_install ALL |
There was a problem hiding this comment.
Don't forget to check ruby version & executable via FindRuby cmake package https://cmake.org/cmake/help/latest/module/FindRuby.html
There was a problem hiding this comment.
I guess it's better to be done on configure, not at build stage
sim_gen/CMakeLists.txt
Outdated
|
|
||
| target_include_directories(sim PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${protea_simlib_SOURCE_DIR}) | ||
| target_link_libraries(sim elfio CLI11 fmt) | ||
| set_property(TARGET sim PROPERTY CXX_STANDARD 23) |
There was a problem hiding this comment.
| set_property(TARGET sim PROPERTY CXX_STANDARD 23) | |
| target_compile_features(sim PRIVATE cxx_std_23) |
Moreover, it should be done via interface target, which also provides all required compile options
| add_custom_target(${PROJECT_NAME} ALL DEPENDS ${PROTEA_SIMGEN_OUTPUT_FILES}) | ||
| add_dependencies(${PROJECT_NAME} protea_irgen) | ||
|
|
||
| add_executable(sim ${PROTEA_SIMGEN_OUTPUT_SOURCES} |
sim_gen/MemoryModels/memory.rb
Outdated
There was a problem hiding this comment.
This file should not be generated
sim_lib/base_jit.cc
Outdated
| auto bytes = cpu.m_memory->read<isa::Word>(curAddr); | ||
| auto inst = decode(bytes); | ||
| if (!inst.has_value()) { | ||
| throw std::runtime_error{"Cannot decode bytes"}; | ||
| } | ||
|
|
||
| bb.insns.push_back(*inst); | ||
| if (isa::isTerminator(inst->m_opc)) { | ||
| break; | ||
| } | ||
| curAddr += getILen(inst->m_opc); |
There was a problem hiding this comment.
It seems like you already know exact instruction size while reading isa::Word from memory
There was a problem hiding this comment.
It seems like you already know exact instruction size while reading isa::Word from memory
It is not true for x86, so I need to add length of the instruction.
There was a problem hiding this comment.
In this case you should not read the whole word from memory
There was a problem hiding this comment.
fixed, currently support only fixed-length instruction size
No description provided.