replaces unordered_map with flat_hash_map
This commit is contained in:
parent
dd937710a7
commit
071cb4fdac
@ -12,6 +12,7 @@ include(flink)
|
||||
find_package(elfio QUIET)
|
||||
find_package(jsoncpp)
|
||||
find_package(Boost COMPONENTS coroutine REQUIRED)
|
||||
find_package(absl REQUIRED)
|
||||
|
||||
add_subdirectory(softfloat)
|
||||
|
||||
@ -104,7 +105,7 @@ if(NOT(DBT_CORE_DEFS STREQUAL DBT_CORE_DEFS-NOTFOUND))
|
||||
target_compile_definitions(${PROJECT_NAME} INTERFACE ${DBT_CORE_DEFS})
|
||||
endif()
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC elfio::elfio softfloat scc-util Boost::coroutine)
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC elfio::elfio softfloat scc-util Boost::coroutine abseil::abseil)
|
||||
|
||||
if(TARGET yaml-cpp::yaml-cpp)
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC WITH_PLUGINS)
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "mstatus.h"
|
||||
#include "util/delegate.h"
|
||||
#include <absl/container/flat_hash_map.h>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <elfio/elfio.hpp>
|
||||
@ -259,8 +260,8 @@ template <typename WORD_TYPE> struct priv_if {
|
||||
std::function<iss::status(unsigned, WORD_TYPE)> write_csr;
|
||||
std::function<iss::status(uint8_t const*)> exec_htif;
|
||||
std::function<void(uint16_t, uint16_t, WORD_TYPE)> raise_trap; // trap_id, cause, fault_data
|
||||
std::unordered_map<unsigned, rd_csr_f>& csr_rd_cb;
|
||||
std::unordered_map<unsigned, wr_csr_f>& csr_wr_cb;
|
||||
absl::flat_hash_map<unsigned, rd_csr_f>& csr_rd_cb;
|
||||
absl::flat_hash_map<unsigned, wr_csr_f>& csr_wr_cb;
|
||||
hart_state<WORD_TYPE>& state;
|
||||
uint8_t& PRIV;
|
||||
WORD_TYPE& PC;
|
||||
@ -775,7 +776,7 @@ template <typename BASE, typename LOGCAT = logging::disass> struct riscv_hart_co
|
||||
this->fault_data = fault_data;
|
||||
},
|
||||
.csr_rd_cb{this->csr_rd_cb},
|
||||
.csr_wr_cb{csr_wr_cb},
|
||||
.csr_wr_cb{this->csr_wr_cb},
|
||||
.state{this->state},
|
||||
.PRIV{this->reg.PRIV},
|
||||
.PC{this->reg.PC},
|
||||
@ -893,8 +894,8 @@ protected:
|
||||
using csr_page_type = typename csr_type::page_type;
|
||||
csr_type csr;
|
||||
|
||||
std::unordered_map<unsigned, rd_csr_f> csr_rd_cb;
|
||||
std::unordered_map<unsigned, wr_csr_f> csr_wr_cb;
|
||||
absl::flat_hash_map<unsigned, rd_csr_f> csr_rd_cb;
|
||||
absl::flat_hash_map<unsigned, wr_csr_f> csr_wr_cb;
|
||||
|
||||
reg_t mhartid_reg{0x0};
|
||||
uint64_t mcycle_csr{0};
|
||||
|
@ -134,7 +134,7 @@ protected:
|
||||
|
||||
hart_state<reg_t> state;
|
||||
|
||||
std::unordered_map<uint64_t, uint8_t> atomic_reservation;
|
||||
absl::flat_hash_map<uint64_t, uint8_t> atomic_reservation;
|
||||
|
||||
iss::status read_status(unsigned addr, reg_t& val);
|
||||
iss::status write_status(unsigned addr, reg_t val);
|
||||
|
@ -48,9 +48,9 @@
|
||||
#ifndef FMT_HEADER_ONLY
|
||||
#define FMT_HEADER_ONLY
|
||||
#endif
|
||||
#include <fmt/format.h>
|
||||
#include <iss/mem/memory_with_htif.h>
|
||||
#include <iss/mem/mmu.h>
|
||||
#include <fmt/format.h>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
|
||||
@ -150,7 +150,7 @@ protected:
|
||||
|
||||
hart_state<reg_t> state;
|
||||
|
||||
std::unordered_map<uint64_t, uint8_t> atomic_reservation;
|
||||
absl::flat_hash_map<uint64_t, uint8_t> atomic_reservation;
|
||||
|
||||
iss::status read_status(unsigned addr, reg_t& val);
|
||||
iss::status write_status(unsigned addr, reg_t val);
|
||||
|
@ -160,7 +160,7 @@ protected:
|
||||
|
||||
hart_state<reg_t> state;
|
||||
|
||||
std::unordered_map<uint64_t, uint8_t> atomic_reservation;
|
||||
absl::flat_hash_map<uint64_t, uint8_t> atomic_reservation;
|
||||
|
||||
iss::status read_status(unsigned addr, reg_t& val);
|
||||
iss::status write_status(unsigned addr, reg_t val);
|
||||
|
@ -32,9 +32,9 @@
|
||||
* eyck@minres.com - initial implementation
|
||||
******************************************************************************/
|
||||
|
||||
#include "memory_if.h"
|
||||
#include "iss/arch/riscv_hart_common.h"
|
||||
#include "iss/vm_types.h"
|
||||
#include "memory_if.h"
|
||||
#include <util/logging.h>
|
||||
|
||||
namespace iss {
|
||||
@ -238,7 +238,7 @@ private:
|
||||
|
||||
protected:
|
||||
reg_t satp;
|
||||
std::unordered_map<reg_t, uint64_t> ptw;
|
||||
absl::flat_hash_map<reg_t, uint64_t> ptw;
|
||||
std::array<vm_info, 2> vmt;
|
||||
std::array<address_type, 4> addr_mode;
|
||||
|
||||
|
@ -48,7 +48,7 @@
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <iss/instruction_decoder.h>
|
||||
|
||||
#include <absl/container/flat_hash_map.h>
|
||||
|
||||
#ifndef FMT_HEADER_ONLY
|
||||
#define FMT_HEADER_ONLY
|
||||
@ -262,7 +262,7 @@ private:
|
||||
struct translation_buffer {
|
||||
std::vector<std::tuple<opcode_e, uint64_t, uint32_t>> entries;
|
||||
} tb;
|
||||
std::unordered_map<uint64_t, translation_buffer> tb_lut;
|
||||
absl::flat_hash_map<uint64_t, translation_buffer> tb_lut;
|
||||
};
|
||||
|
||||
template <typename CODE_WORD> void debug_fn(CODE_WORD insn) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user