microprobe.code.TraceSynthesizer¶
-
class
TraceSynthesizer(target, wrapper, **kwargs)[source]¶ Bases:
microprobe.code.SynthesizerTrace synthesizer.
The Trace Synthesizer objects are in charge of creating
Benchmarkobjects based on a set of passes that have been previously defined. They operate in a similar fashion asSynthesizerobjects 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 (
listof elements containing anameand avalueattributes (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[, thread_idx])Add a pass to the benchmark synthesizer. save(name[, bench])Save a benchmark to disk. set_current_thread(idx)synthesize()Synthesize a benchmark. Attributes
targetTarget attribute ( Target).wrapperWrapper attribute ( Wrapper).
-
add_pass(synth_pass, thread_idx=None)¶ 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:
-
set_current_thread(idx)¶
-
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