m2isar.transforms.encode_instructions.operands
Operands used in parsing the instructions
Attributes
Classes
A Operand with a list of bitwidths and signs. |
|
A simple operand used in the Instruction Class |
Functions
|
Converts a dict of operands to dict of metamodel references of those operands |
|
returns a subset of the given operands that are immediates |
|
returns a list of immediates with their name; (name, operand) |
|
returns an ordered list of register names |
|
Simplifying the operands, returns a list where |
|
Create every possible combination of the supplied operands |
Module Contents
- class ComplexOperand(width: int | str | List[int | str], sign: str | List[str], immediate: bool = False)[source]
A Operand with a list of bitwidths and signs.
- class Operand[source]
A simple operand used in the Instruction Class
- to_metamodel_ref(name: str, cast: bool = True) MetamodelRef[source]
Returns either: - IndexedReference if the operand is a register - NamedReference if the operand is an immediate - Or a TypeConv, explained below
Return Value gets wrapped in a TypeConv if its smaller than XLEN or signed, This can be turned off by passing “cast=False”
- to_simd_slices(name: str) List[m2isar.metamodel.behav.SliceOperation][source]
Returns a list of SliceOperations on register[‘name’]
- to_metamodel_operands(operands: Dict[str, Operand]) Dict[str, MetamodelRef][source]
Converts a dict of operands to dict of metamodel references of those operands
- get_immediates(operands: Dict[str, Operand]) List[Operand][source]
returns a subset of the given operands that are immediates
- get_immediates_with_name(operands: Dict[str, Operand]) List[Tuple[str, Operand]][source]
returns a list of immediates with their name; (name, operand)
- get_register_names(operands: Dict[str, Operand]) List[Tuple[str, Operand]][source]
returns an ordered list of register names
- simplify_operands(operands: Dict[str, ComplexOperand]) Dict[str, List[Operand]][source]
Simplifying the operands, returns a list where the ComplexOperands have been turned into simple Operands with only 1 sign and width Width or sign references need to be resolved once the operands are put into groups