microprobe.target.Target

class Target(isa: ISA, env: Environment | None = None, uarch: Microarchitecture | None = None)[source]

Bases: Pickable

Class to represent a code generation target.

A target is defined by the architecture, the microarchitecture implementation and the generation environment. The Target object provides a common interface to all the architecture/microarchitecture/environment specific methods using a facade software design pattern. Therefore, all the references to target related properties should go through this object interface in order to minimize the coupling with the other modules (code generation, design space exploration, …).

__init__(isa: ISA, env: Environment | None = None, uarch: Microarchitecture | None = None)[source]

Create a Target object.

Parameters:
  • isa (ISA) – Architecture (i.e. Instruction Set Architecture)

  • env (Environment) – Environment (default: None)

  • uarch (Microarchitecture) – Microarchitecture (default: None)

Returns:

Target instance

Return type:

Target

Methods

__init__(isa[, env, uarch])

Create a Target object.

full_report()

Return a long description of the Target.

property_isa_map(prop_name)

Generate property to isa map.

set_env(env)

Set the environment of the Target.

set_isa(isa)

Set the ISA of the Target.

set_uarch(uarch)

Set the microarchitecture of the Target.

set_wrapper(wrapper)

Set the wrapper of the Target.

Attributes

description

Description of the Target (str).

environment

Environment of the Target (Environment).

isa

Architecture of the Target (ISA).

microarchitecture

Microarchitecture of the Target (Microarchitecture).

name

Name of the Target (str).

reserved_registers

Reserved registers of the Target (list of Register).

wrapper

Wrapper of the Target (Wrapper).




property name

Name of the Target (str).

property description

Description of the Target (str).

property environment

Environment of the Target (Environment).

property isa

Architecture of the Target (ISA).

property microarchitecture

Microarchitecture of the Target (Microarchitecture).

property reserved_registers

Reserved registers of the Target (list of Register).

property wrapper

Wrapper of the Target (Wrapper).

full_report()[source]

Return a long description of the Target.

Return type:

str

property_isa_map(prop_name)[source]

Generate property to isa map.

Return a dictionary mapping values of the property prop_name to the list of InstructionType that have that property value.

Parameters:

prop_name (str) – Property name

Returns:

Dictionary mapping value properties to instruction types

Return type:

dict mapping property values to list of InstructionType

Raises:

microprobe.exceptions.MicroprobeTargetDefinitionError – if the property is not found

set_env(env: Environment)[source]

Set the environment of the Target.

Parameters:

env (Environment) – Execution environment definition

set_isa(isa: ISA)[source]

Set the ISA of the Target.

Parameters:

isa (ISA) – Architecture (i.e. ISA)

set_uarch(uarch: Microarchitecture)[source]

Set the microarchitecture of the Target.

Parameters:

uarch (Microarchitecture) – Microarchitecture

set_wrapper(wrapper: Wrapper)[source]

Set the wrapper of the Target.

Parameters:

wrapper (Wrapper) – Wrapper