Supported Instructions

In the Ember core, the set of supported instructions is ultimately defined by:

  • Including an RvInstGroup within EmberParams

  • Including an EmberMopGroup within EmberParams

  • A decoder module that maps each RvInst to an EmberMop

  • One or more modules that decompose EmberMop into micro-ops

Defining RISC-V Instructions

RISC-V instructions are described by an RvInst, which is used to generate a bitmask for uniquely identifying the instruction. A set of RISC-V instructions is organized into a RvInstGroup.

Defining Macro-Ops

In the Ember core, each RvInst must be associated with a “macro-op” (EmberMop) which describes a set of control signals that will be carried down the instruction pipeline until dispatch.

The set of all macro-ops supported by the core is defined by an EmberMopGroup, and must match the associated RvInstGroup.

After dispatch, macro-ops are converted into a “micro-op” representation which is specific to a particular pipeline in the backend.

Defining Micro-Ops

Warning

TODO


class ember.riscv.inst.RvInstMatch

Container for the string representation of a bitmask used to uniquely identify a RISC-V instruction.

as_string()

Return the string representation of the bitmask.

num_effective_bits()

Return the number of effective bits in the mask.

add_match_value(start: int, size: int, val: int)

Define some bits in the mask at the provided location.

class ember.riscv.inst.RvInst(fmt: RvFormat, opcode: RvOpcode, f3=None, f7=None, f12=None, rd=None, rs1=None)

Definition of a RISC-V instruction.

match()

Return the RvInstMatch associated with this instruction.

class ember.riscv.inst.RvInstGroup(enum_name='RvInstId', members={})

A group of supported RISC-V instructions.

as_enum()

Return the Enum type for this group.

get_inst_by_name(mnemonic: str)

Return the RvInst for the given mnemonic.

get_inst_id_by_name(mnemonic: str)

Return the RvInstId value for the given mnemonic.

add_group(other)

Append another group to this group.

items()

Return tuples representing items in this group.

items_by_specificity()

Return a list of members sorted by mask specificity.