microprobe.code.TraceSynthesizer¶
-
class
TraceSynthesizer
(target, wrapper, **kwargs)[source]¶ Bases:
microprobe.code.Synthesizer
Trace synthesizer.
The Trace Synthesizer objects are in charge of creating
Benchmark
objects based on a set of passes that have been previously defined. They operate in a similar fashion asSynthesizer
objects but differ on how the benchmark object is dumped. In this case a dynamic execution trace is dumped (i.e. an execution trace). Required dynamic information should be provided by the registered passes.The default structure of the benchmarks being synthesized is as follows:
wrapper.headers()
contents- Dynamic execution trace from:
- <benchmark initialization code>
- <benchmark building blocks>
- <benchmark finalization code>
-
__init__
(target, wrapper, **kwargs)[source]¶ Create a Synthesizer object.
Parameters: - target (
Target
) – Benchmark target - wrapper (
Wrapper
) – Wrapper object defining the output format - value (
int
) – Default immediate value used for non-initialized immediates (Default: random) - no_scratch (
bool
) – Disable automatic declaration of scratch variables required for code generation support (Default: False) - extra_raw (
list
of elements containing aname
and avalue
attributes (Default: [])) – List of extra raw strings to be embedded in the final output
Returns: A Synthesizer instance
Return type: - target (
Methods
__init__
(target, wrapper, **kwargs)Create a Synthesizer object. add_pass
(synth_pass)Add a pass to the benchmark synthesizer. save
(name[, bench])Save a benchmark to disk. synthesize
()Synthesize a benchmark. Attributes
target
Target attribute ( Target
).wrapper
Wrapper attribute ( Wrapper
).
-
add_pass
(synth_pass)¶ Add a pass to the benchmark synthesizer.
Parameters: synth_pass ( Pass
) – New pass to add.
-
save
(name, bench=None)¶ Save a benchmark to disk.
Save a synthesized benchmark to disk. If bench is not specified a benchmark is automatically synthesized using the
synthesize()
method.Parameters:
-
synthesize
()¶ Synthesize a benchmark.
Synthesize a benchmark based on the set of passes that have been added using the
add_pass()
method.Returns: A new synthesized benchmark Return type: Benchmark