microprobe.target.isa.instruction_format.InstructionFormat

class InstructionFormat(fname: str, descr: str)[source]

Bases: ABC

Abstract class to represent an instruction format

__init__(fname: str, descr: str)[source]
Parameters:
  • fname

  • descr

Methods

__init__(fname, descr)

param fname:

flip_fields(fname1, fname2)

Interchanges the position of the fields with name fname1 and fname2.

full_report([tabs])

get_field(fname)

Returns a the InstructionField with name fname.

get_field_props(fname)

Returns extra properties of field with name fname.

get_fields()

Returns a list of the InstructionField

get_findex(fname)

Returns the index of the field fname within the instruction format

get_operands()

Returns a list of tuple() of three elements.

set_fields(fields[, reset])

Sets the fields of the instruction format.

Attributes

assembly_format

description

fields

name




property name
property description
property fields: List[InstructionField]
property assembly_format: str
get_operands()[source]

Returns a list of tuple() of three elements. The first is a Operand object, the second is a bool indicating if the operand is an input operand and the third is a bool indicating if the operand is an output operand.

get_fields() List[InstructionField][source]

Returns a list of the InstructionField

get_field(fname: str) InstructionField[source]

Returns a the InstructionField with name fname.

Parameters:

fname

get_field_props(fname: str)[source]

Returns extra properties of field with name fname.

Parameters:

fname (str) – Field name.

get_findex(fname: str)[source]

Returns the index of the field fname within the instruction format

Parameters:

fname (str) – Field name.

flip_fields(fname1: str, fname2: str)[source]

Interchanges the position of the fields with name fname1 and fname2.

Parameters:
  • fname1 (str) – Field 1 name.

  • fname2 (str.) – Field 2 name.

set_fields(fields: List[InstructionField], reset: bool = True)[source]

Sets the fields of the instruction format. If reset is True the properties and the flip records of the fields are removed.

Parameters:
  • fields (list of InstructionField) – List of fields.

  • reset (bool) – Flag indicating if a full reset is needed (Default value = True)

full_report(tabs=0)[source]