maat::ir::CPU class

The CPU is responsible for processing most IR instructions when executing code

❱   Base classes

class maat::serial::Serializable
Virtual interface that serializable classes must implement.

❱   Constructors, destructors, conversion operators

CPU(int nb_regs = 0)
Constructor.

❱   Public functions

auto pre_process_inst(const ir::Inst& inst, event::Action& action, MaatEngine& engine) -> ProcessedInst&
Compute the values of the various parameters of the IR instruction inst and return them as a ProcessedInst. ir::Param::Type::ADDR parameters are not resolved by this function but will be by the engine itself, since it requires interacting with the memory engine.
For more information about the exact values contained in the returned ProcessedInst depending on the input IR instruction type, refer to the ::ProcessedInst class documentation.
WARNING: for performance reasons, the reference returned points to a member of the CPU class. If pre_process_inst() is called again, any previously returned reference will then point to invalid data and can no longer be used (more precisely, it will point to the parameter values of the lastest processed instruction)

auto post_process_inst(const ir::Inst& inst, ProcessedInst& pinst) -> ProcessedInst&
Compute the value to be assigned to the output register of an instruction. This method expects that pinst holds the correct values for current input and output parameters (especially, Param::Type::ADDR parameters are expected to have been resolved already by the engine, with the original addresses expressions now residing in the auxilliary field of the ::ProcessedInst::Param parameters)
The method returns a reference to pinst

auto apply_semantics(const ir::Inst& inst, const ProcessedInst& pinst, MaatEngine& engine) -> event::Action
Apply the semantics specified by pinst for instruction inst to the current CPU context.

auto ctx() -> CPUContext&
Get the current CPU context.

void reset_temporaries()
Reset the temporary registers.

auto class_uid() const -> serial::uid_t virtual
Return the class uid (see ClassId enum)

void dump(serial::Serializer&) const virtual
Dump the object contents in a serializer stream.

void load(serial::Deserializer&) virtual
Restore an object from a deserializer stream.