diff --git a/src/iss/arch/riscv_hart_common.h b/src/iss/arch/riscv_hart_common.h index 471566a..110681a 100644 --- a/src/iss/arch/riscv_hart_common.h +++ b/src/iss/arch/riscv_hart_common.h @@ -355,7 +355,7 @@ struct riscv_hart_common { unsigned char other = 0; for(auto i = 0U; i < sym_no; ++i) { symbols.get_symbol(i, name, value, size, bind, type, section, other); - if(type==0 && name != "") { + if(name != "") { this->symbol_table[name] = value; #ifndef NDEBUG CPPLOG(DEBUG) << "Found Symbol " << name; diff --git a/src/iss/arch/riscv_hart_m_p.h b/src/iss/arch/riscv_hart_m_p.h index cc2dcd2..71a167a 100644 --- a/src/iss/arch/riscv_hart_m_p.h +++ b/src/iss/arch/riscv_hart_m_p.h @@ -572,12 +572,11 @@ riscv_hart_m_p::riscv_hart_m_p(feature_config cfg) template std::pair riscv_hart_m_p::load_file(std::string name, int type) { - if(read_elf_file(name,sizeof(reg_t)==4?ELFCLASS32:ELFCLASS64, - [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { - return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, - addr, size, data); - - })) { + if(read_elf_file(name, sizeof(reg_t) == 4 ? ELFCLASS32 : ELFCLASS64, + [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { + return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, addr, size, + data); + })) { return std::make_pair(entry_address, true); } return std::make_pair(entry_address, false); @@ -1327,8 +1326,7 @@ uint64_t riscv_hart_m_p::enter_trap(uint64_t flags, uint64_t #endif if((flags & 0xffffffff) != 0xffffffff) NSCLOG(INFO, LOGCAT) << (trap_id ? "Interrupt" : "Trap") << " with cause '" << (trap_id ? irq_str[cause] : trap_str[cause]) << "' (" - << cause << ")" - << " at address " << buffer.data() << " occurred"; + << cause << ")" << " at address " << buffer.data() << " occurred"; return this->reg.NEXT_PC; } diff --git a/src/iss/arch/riscv_hart_msu_vp.h b/src/iss/arch/riscv_hart_msu_vp.h index fc79aa6..5d18008 100644 --- a/src/iss/arch/riscv_hart_msu_vp.h +++ b/src/iss/arch/riscv_hart_msu_vp.h @@ -555,12 +555,11 @@ riscv_hart_msu_vp::riscv_hart_msu_vp() } template std::pair riscv_hart_msu_vp::load_file(std::string name, int type) { - if(read_elf_file(name,sizeof(reg_t)==4?ELFCLASS32:ELFCLASS64, - [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { - return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, - addr, size, data); - - })) { + if(read_elf_file(name, sizeof(reg_t) == 4 ? ELFCLASS32 : ELFCLASS64, + [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { + return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, addr, size, + data); + })) { return std::make_pair(entry_address, true); } return std::make_pair(entry_address, false); @@ -1338,9 +1337,8 @@ template uint64_t riscv_hart_msu_vp::enter_trap(uint64_t f sprintf(buffer.data(), "0x%016lx", addr); if((flags & 0xffffffff) != 0xffffffff) CLOG(INFO, disass) << (trap_id ? "Interrupt" : "Trap") << " with cause '" << (trap_id ? irq_str[cause] : trap_str[cause]) << "' (" - << cause << ")" - << " at address " << buffer.data() << " occurred, changing privilege level from " << lvl[cur_priv] << " to " - << lvl[new_priv]; + << cause << ")" << " at address " << buffer.data() << " occurred, changing privilege level from " + << lvl[cur_priv] << " to " << lvl[new_priv]; // reset trap state this->reg.PRIV = new_priv; this->reg.trap_state = 0; diff --git a/src/iss/arch/riscv_hart_mu_p.h b/src/iss/arch/riscv_hart_mu_p.h index e0774e8..017db84 100644 --- a/src/iss/arch/riscv_hart_mu_p.h +++ b/src/iss/arch/riscv_hart_mu_p.h @@ -649,12 +649,11 @@ riscv_hart_mu_p::riscv_hart_mu_p(feature_config cfg) template std::pair riscv_hart_mu_p::load_file(std::string name, int type) { - if(read_elf_file(name,sizeof(reg_t)==4?ELFCLASS32:ELFCLASS64, - [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { - return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, - addr, size, data); - - })) { + if(read_elf_file(name, sizeof(reg_t) == 4 ? ELFCLASS32 : ELFCLASS64, + [this](uint64_t addr, uint64_t size, const uint8_t* const data) -> iss::status { + return this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, addr, size, + data); + })) { return std::make_pair(entry_address, true); } return std::make_pair(entry_address, false); @@ -1566,9 +1565,8 @@ uint64_t riscv_hart_mu_p::enter_trap(uint64_t flags, uint64_ #endif if((flags & 0xffffffff) != 0xffffffff) CLOG(INFO, disass) << (trap_id ? "Interrupt" : "Trap") << " with cause '" << (trap_id ? irq_str[cause] : trap_str[cause]) << "' (" - << cause << ")" - << " at address " << buffer.data() << " occurred, changing privilege level from " << lvl[this->reg.PRIV] - << " to " << lvl[new_priv]; + << cause << ")" << " at address " << buffer.data() << " occurred, changing privilege level from " + << lvl[this->reg.PRIV] << " to " << lvl[new_priv]; // reset trap state this->reg.PRIV = new_priv; this->reg.trap_state = 0;