microprobe.code.benchmark.Benchmark¶
-
class
Benchmark[source]¶ Bases:
microprobe.code.benchmark.BuildingBlockClass to represent a benchmark (highest level building block).
Methods
__init__()add_fini(finis)Appends the specified list of instructions to the finalization list add_info(message)Add an information message to the building block. add_init(inits)Appends the specified list of instructions to initialization list add_instructions(instrs[, after, before])Adds the given instruction to the building block. add_pass_info(message)Add an pass information message to the building block. add_requirement(message)Add an requirement message to the building block. add_warning(message)Add a warning message to the building block. register_var(var, context)Registers the given variable as a global variable. registered_global_vars()Returns the list of registered global variables. rm_init(inits)Removes from the initialization list the specified instructions. set_cfg(cfg)Sets the benchmarks control flow graph. set_context(context)Set the execution context of the building block. set_current_thread(idx)Attributes
cfgReturns the benchmark control flow graph. code_sizeReturn benchmark’s size contextReturn benchmark’s context finiFinalization instructions ( listofInstruction)infoList of information messages of the building block ( listofstr)initInitialization instructions labelsReturn the a list of the current defined labels and symbols pass_infoList of information pass messages of the building block ( listofstr)requirementsList of requirement messages of the building block ( listofstr)warningsList of warnings of the building block
-
init¶ Initialization instructions
Initialization instructions (
listofInstruction)
-
add_init(inits)[source]¶ Appends the specified list of instructions to initialization list
Parameters: inits ( listofInstruction) – List of instructions to be added
-
rm_init(inits)[source]¶ Removes from the initialization list the specified instructions.
Parameters: inits ( listofInstruction) – List of instructions to be removed
-
add_fini(finis)[source]¶ Appends the specified list of instructions to the finalization list
Parameters: finis ( listofInstruction) – List of instructions to be added
-
fini¶ Finalization instructions (
listofInstruction)
-
cfg¶ Returns the benchmark control flow graph.
-
set_cfg(cfg)[source]¶ Sets the benchmarks control flow graph.
Parameters: cfg ( Cfg) – Control flow graph
-
register_var(var, context)[source]¶ Registers the given variable as a global variable.
Parameters: var ( Variable) – Variable to register
-
set_context(context)[source]¶ Set the execution context of the building block.
Parameters: context ( Context) – Execution context
-
context¶ Return benchmark’s context
-
add_instructions(instrs, after=None, before=None)[source]¶ Adds the given instruction to the building block.
Adds the given instructions right after the specified instruction and before the specified one. If the condition can not be fulfilled an specification exception is raised.
Parameters: - instrs (
listofInstruction) – Instruction to add - after (
Instruction) – Instruction after which to add the new instruction (Default value = None) - before (
Instruction) – Instruction before which to add the new instruction (Default value = None)
- instrs (
-
code_size¶ Return benchmark’s size
-
labels¶ Return the a list of the current defined labels and symbols
-
add_info(message)¶ Add an information message to the building block.
Parameters: message ( str) – Information message
-
add_pass_info(message)¶ Add an pass information message to the building block.
Parameters: message ( str) – Information pass message
-
add_requirement(message)¶ Add an requirement message to the building block.
Parameters: message ( str) – Requirement message
-