Skip to content

Commit

Permalink
[cosim] less verbose logging
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL committed May 6, 2024
1 parent 7c83cfa commit 3176f8f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 1 addition & 2 deletions ipemu/csrc/elf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ simple_sim::load_elf_result_t simple_sim::load_elf32_little_endian(const std::st
.with("phdr_offset", fmt::format("{:08X}", phdr.p_offset))
.with("paddr_range", fmt::format("{:08X}-{:08X}", phdr.p_paddr,
phdr.p_paddr + phdr.p_memsz))
.warn();
.info();
}
}

Expand All @@ -86,7 +86,6 @@ simple_sim::load_elf_result_t simple_sim::load_elf32_little_endian(const std::st
auto shdr = read_from_fs<Elf32_Shdr>(fs, shoff + i * shentsize);
if (from_le(shdr.sh_type) == SHT_STRTAB &&
std::string(&section_string_table[from_le(shdr.sh_name)]) == ".strtab") {
Log("size").with("size", shdr.sh_size).warn();
string_table.resize(from_le(shdr.sh_size));
copy_from_fs(fs, from_le(shdr.sh_offset), from_le(shdr.sh_size), string_table.data());
}
Expand Down
15 changes: 9 additions & 6 deletions ipemu/csrc/spdlog_ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ static std::set<std::string> get_set_from_env(const char *env_name, const char d

ConsoleSink::ConsoleSink() {
whitelist = get_set_from_env("EMULATOR_LOG_WHITELIST", ',');
whitelist.insert("DPIInitCosim");
whitelist.insert("SpikeStep");
whitelist.insert("FunctionCall");
whitelist.insert("SimulationExit");
whitelist.insert("DPIPeekIssue");
whitelist.insert("DPIPokeInst");
if (whitelist.empty()) {
// default set of whitelist
whitelist.insert("DPIInitCosim");
whitelist.insert("SpikeStep");
whitelist.insert("FunctionCall");
whitelist.insert("SimulationExit");
whitelist.insert("DPIPeekIssue");
whitelist.insert("DPIPokeInst");
}

// putting it in JsonLogger::JsonLogger will not work. not knowing why
this->set_level(get_level_from_env("EMULATOR_CONSOLE_LOG_LEVEL", spdlog::level::info));
Expand Down
2 changes: 1 addition & 1 deletion ipemu/csrc/vbridge_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ void VBridgeImpl::receive_tl_req(const VTlInterface &tl) {
Log("ReceiveTLReq")
.with("addr", fmt::format("{:08X}", addr))
.with("insn", se->jsonify_insn())
.warn("send falsy data 0xDE for accessing unexpected memory");
.info("send falsy data 0xDE for accessing unexpected memory");
actual_data[offset] = 0xDE; // falsy data
}
}
Expand Down

0 comments on commit 3176f8f

Please sign in to comment.