34#include "debug/Decode.hh"
44 ISA *isa =
dynamic_cast<ISA*
>(
p.isa);
62 constexpr size_t max_bit =
sizeof(
machInst) * 8 - 1;
63 constexpr size_t mid_bit =
sizeof(
machInst) * 4 - 1;
66 DPRINTF(Decode,
"Requesting bytes 0x%08x from address %#x\n", inst,
73 emi.instBits =
bits(inst, mid_bit, 0);
78 assert(
bits(
emi.instBits, max_bit, mid_bit + 1) == 0);
84 emi.instBits =
bits(inst, max_bit, mid_bit + 1);
95 DPRINTF(Decode,
"Decoding instruction 0x%08x at address %#x\n",
96 mach_inst.instBits,
addr);
104 DPRINTF(Decode,
"Decode: Decoded %s instruction: %#x\n",
105 si->getName(), mach_inst);
119 next_pc.
npc(next_pc.instAddr() +
sizeof(
machInst) / 2);
120 next_pc.compressed(
true);
122 next_pc.npc(next_pc.instAddr() +
sizeof(
machInst));
123 next_pc.compressed(
false);
126 emi.vl = next_pc.vl();
127 emi.vtype8 = next_pc.vtype() & 0xff;
128 emi.vill = next_pc.vtype().vill;
129 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 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.