diff --git a/src/iss/arch/riscv_hart_m_p.h b/src/iss/arch/riscv_hart_m_p.h index dfbef36..ca6e73e 100644 --- a/src/iss/arch/riscv_hart_m_p.h +++ b/src/iss/arch/riscv_hart_m_p.h @@ -605,7 +605,8 @@ template std::pair riscv_hart_m for(const auto pseg : reader.segments) { const auto fsize = pseg->get_file_size(); // 0x42c/0x0 const auto seg_data = pseg->get_data(); - if(fsize > 0) { + const auto type = pseg->get_type(); + if(type==1 && fsize > 0) { auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, pseg->get_physical_address(), fsize, reinterpret_cast(seg_data)); if(res != iss::Ok) diff --git a/src/iss/arch/riscv_hart_msu_vp.h b/src/iss/arch/riscv_hart_msu_vp.h index 1a350b8..c9f4318 100644 --- a/src/iss/arch/riscv_hart_msu_vp.h +++ b/src/iss/arch/riscv_hart_msu_vp.h @@ -589,7 +589,8 @@ template std::pair riscv_hart_msu_vp::load for(const auto pseg : reader.segments) { const auto fsize = pseg->get_file_size(); // 0x42c/0x0 const auto seg_data = pseg->get_data(); - if(fsize > 0) { + const auto type = pseg->get_type(); + if(type==1 && fsize > 0) { auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, pseg->get_physical_address(), fsize, reinterpret_cast(seg_data)); if(res != iss::Ok) diff --git a/src/iss/arch/riscv_hart_mu_p.h b/src/iss/arch/riscv_hart_mu_p.h index 5928d4e..cba22b6 100644 --- a/src/iss/arch/riscv_hart_mu_p.h +++ b/src/iss/arch/riscv_hart_mu_p.h @@ -676,7 +676,8 @@ template std::pair riscv_hart_m for(const auto pseg : reader.segments) { const auto fsize = pseg->get_file_size(); // 0x42c/0x0 const auto seg_data = pseg->get_data(); - if(fsize > 0) { + const auto type = pseg->get_type(); + if(type==1 && fsize > 0) { auto res = this->write(iss::address_type::PHYSICAL, iss::access_type::DEBUG_WRITE, traits::MEM, pseg->get_physical_address(), fsize, reinterpret_cast(seg_data)); if(res != iss::Ok)