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:
Methods
__init__
(isa[, env, uarch])Create a Target object.
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 of the Target (
str
).Environment of the Target (
Environment
).Architecture of the Target (
ISA
).Microarchitecture of the Target (
Microarchitecture
).Name of the Target (
str
).Wrapper of the Target (
Wrapper
).
- property environment
Environment of the Target (
Environment
).
- property microarchitecture
Microarchitecture of the Target (
Microarchitecture
).
- 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 tolist
ofInstructionType
- 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