Skip to content

Commit

Permalink
Disable spdlog, use fmt::print to bypass errors
Browse files Browse the repository at this point in the history
spdlog::info seems to cause error which I'll investigate later
  • Loading branch information
ssayin committed Jul 27, 2024
1 parent 8b7a7d9 commit 10b8f0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions riscv32-sim/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ int run(options &opt) {
while ((opt.fstep && std::cin.get() == 'q') || !model.done()) {
model.step();
auto &state = model.cur_state;
fmt::print("{}", state.dec);
auto log_changes = [](const auto &changes) {
std::for_each(changes.begin(), changes.end(),
[](const auto &change) { spdlog::info("{}", change); });
};
log_changes(state.gpr_staged);
log_changes(state.csr_staged);
// fmt::print("{}", state.dec);
// auto log_changes = [](const auto &changes) {
// std::for_each(changes.begin(), changes.end(),
// [](const auto &change) { spdlog::info("{}", change); });
// };
// log_changes(state.gpr_staged);
// log_changes(state.csr_staged);
if (!opt.disas_output.empty()) {
static std::ofstream out(opt.disas_output);
out << state;
Expand All @@ -150,8 +150,9 @@ int run(options &opt) {
std::ofstream state_file(opt.json_output);
state_file << state_export.dump();
}
spdlog::info("{} Exited with 0x{:X} ({})", opt.target, model.tohost(),
static_cast<int32_t>(model.tohost()));
fmt::print("{} Exited with 0x{:X} ({})", opt.target, model.tohost(),
static_cast<int32_t>(model.tohost()));
// spdlog::info(");

return 0;
}
2 changes: 1 addition & 1 deletion tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cmake -B $BUILD_DIR -GNinja \
-DENABLE_TCP=ON \
-DBUILD_RUNTIME=ON \
-DTEST_EXPORT_JSON_HART_STATE=ON \
-DENABLE_UBENCHMARKS=ON
-DENABLE_UBENCHMARKS=OFF
#-DBUILD_TESTING=OFF

ninja -v -C $BUILD_DIR
Expand Down

0 comments on commit 10b8f0d

Please sign in to comment.