34#include "debug/Decode.hh"
44 ISA *isa =
dynamic_cast<ISA*
>(
p.isa);
63 constexpr size_t max_bit =
sizeof(
machInst) * 8 - 1;
64 constexpr size_t mid_bit =
sizeof(
machInst) * 4 - 1;
67 DPRINTF(Decode,
"Requesting bytes 0x%08x from address %#x\n", inst,
74 emi.instBits =
bits(inst, mid_bit, 0);
79 assert(
bits(
emi.instBits, max_bit, mid_bit + 1) == 0);
85 emi.instBits =
bits(inst, max_bit, mid_bit + 1);
96 DPRINTF(Decode,
"Decoding instruction 0x%08x at address %#x\n",
97 mach_inst.instBits,
addr);
105 DPRINTF(Decode,
"Decode: Decoded %s instruction: %#x\n",
106 si->getName(), mach_inst);
120 next_pc.
npc(next_pc.instAddr() +
sizeof(
machInst) / 2);
121 next_pc.compressed(
true);
123 next_pc.npc(next_pc.instAddr() +
sizeof(
machInst));
124 next_pc.compressed(
false);
127 emi.vl = next_pc.vl();
128 emi.vtype8 = next_pc.vtype() & 0xff;
129 emi.vill = next_pc.vtype().vill;
130 emi.rv_type =
static_cast<int>(next_pc.rvType());
void moreBytes(const PCStateBase &pc, Addr fetchPC) override
Feed data to the decoder.
StaticInstPtr decode(ExtMachInst mach_inst, Addr addr)
Decode a machine instruction.
virtual StaticInstPtr decodeInst(ExtMachInst mach_inst)
Decoder(const RiscvDecoderParams &p)
decode_cache::InstMap< ExtMachInst > instMap
unsigned getVecElemLenInBits()
unsigned getVecLenInBits()
Methods for getting VLEN, VLENB and ELEN values.
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Bitfield< 61 > compressed
Copyright (c) 2024 Arm Limited All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.