33#include "debug/Decode.hh"
53 constexpr size_t max_bit =
sizeof(
machInst) * 8 - 1;
54 constexpr size_t mid_bit =
sizeof(
machInst) * 4 - 1;
57 DPRINTF(Decode,
"Requesting bytes 0x%08x from address %#x\n", inst,
64 emi.instBits =
bits(inst, mid_bit, 0);
69 assert(
bits(
emi.instBits, max_bit, mid_bit + 1) == 0);
75 emi.instBits =
bits(inst, max_bit, mid_bit + 1);
86 DPRINTF(Decode,
"Decoding instruction 0x%08x at address %#x\n",
87 mach_inst.instBits,
addr);
93 DPRINTF(Decode,
"Decode: Decoded %s instruction: %#x\n",
94 si->getName(), mach_inst);
108 next_pc.
npc(next_pc.instAddr() +
sizeof(
machInst) / 2);
109 next_pc.compressed(
true);
111 next_pc.npc(next_pc.instAddr() +
sizeof(
machInst));
112 next_pc.compressed(
false);
115 emi.rv_type =
static_cast<int>(next_pc.rvType());
StaticInstPtr decodeInst(ExtMachInst mach_inst)
void moreBytes(const PCStateBase &pc, Addr fetchPC) override
Feed data to the decoder.
StaticInstPtr decode(ExtMachInst mach_inst, Addr addr)
Decode a machine instruction.
decode_cache::InstMap< ExtMachInst > instMap
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
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.