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()
contentsDynamic 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 targetwrapper (
Wrapper
) – Wrapper object defining the output formatvalue (
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
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, pad])Save a benchmark to disk.
set_current_thread
(idx)Synthesize a benchmark.
Attributes
Target attribute (
Target
).Wrapper 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, pad=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.
- 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