fixes htif behavior and instrumentation interface

This commit is contained in:
Eyck Jentzsch 2025-03-14 12:42:11 +01:00
parent 88475bfa55
commit 502f3e8df9

View File

@ -728,9 +728,9 @@ template <typename BASE, typename LOGCAT = logging::disass> struct riscv_hart_co
iss::status execute_htif(uint8_t const* data) {
reg_t cur_data = *reinterpret_cast<const reg_t*>(data);
// Extract Device (bits 63:56)
uint8_t device = traits<BASE>::XLEN == 32 ? *reinterpret_cast<uint32_t const*>(data) >> 24 : (cur_data >> 56) & 0xFF;
uint8_t device = traits<BASE>::XLEN == 32 ? 0 : (cur_data >> 56) & 0xFF;
// Extract Command (bits 55:48)
uint8_t command = traits<BASE>::XLEN == 32 ? *reinterpret_cast<uint32_t const*>(data) >> 16 : (cur_data >> 48) & 0xFF;
uint8_t command = traits<BASE>::XLEN == 32 ? 0 : (cur_data >> 48) & 0xFF;
// Extract payload (bits 47:0)
uint64_t payload_addr = cur_data & 0xFFFFFFFFFFFFULL;
if(payload_addr & 1) {
@ -828,6 +828,8 @@ protected:
friend struct riscv_instrumentation_if;
riscv_instrumentation_if instr_if;
instrumentation_if* get_instrumentation_if() override { return &instr_if; };
using csr_type = util::sparse_array<typename traits<BASE>::reg_t, 1ULL << 12, 12>;
using csr_page_type = typename csr_type::page_type;
csr_type csr;