microprobe.code.benchmark.MultiThreadedBenchmark
- class MultiThreadedBenchmark(num_threads: int = 1)[source]
Bases:
Benchmark
Methods
__init__
([num_threads])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[, prepend])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.
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)set_var_displacement
(displacement)Attributes
Returns the benchmark control flow graph.
Return benchmark's size
Return benchmark's context
Finalization instructions (
list
ofInstruction
)List of information messages of the building block (
list
ofstr
)Initialization instructions
Return the a list of the current defined labels and symbols
List of information pass messages of the building block (
list
ofstr
)List of requirement messages of the building block (
list
ofstr
)List of warnings of the building block
- add_fini(finis: List[Instruction])
Appends the specified list of instructions to the finalization list
- Parameters:
finis (
list
ofInstruction
) – List of instructions to be added
- add_info(message: str)
Add an information message to the building block.
- Parameters:
message (
str
) – Information message
- add_init(inits: List[Instruction], prepend: bool = False)
Appends the specified list of instructions to initialization list
- Parameters:
inits (
list
ofInstruction
) – List of instructions to be added
- add_instructions(instrs: List[Instruction], after: Instruction | None = None, before: Instruction | None = None)
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 (
list
ofInstruction
) – Instruction to addafter (
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)
- add_pass_info(message: str)
Add an pass information message to the building block.
- Parameters:
message (
str
) – Information pass message
- add_requirement(message: str)
Add an requirement message to the building block.
- Parameters:
message (
str
) – Requirement message
- add_warning(message: str)
Add a warning message to the building block.
- Parameters:
message (
str
) – Warning message
- property cfg
Returns the benchmark control flow graph.
- property code_size
Return benchmark’s size
- property context
Return benchmark’s context
- property fini
Finalization instructions (
list
ofInstruction
)
- property init
Initialization instructions
Initialization instructions (
list
ofInstruction
)
- property labels
Return the a list of the current defined labels and symbols
- register_var(var: Variable, context: Context)
Registers the given variable as a global variable.
- Parameters:
var (
Variable
) – Variable to register
- registered_global_vars()
Returns the list of registered global variables.
- rm_init(inits: List[Instruction])
Removes from the initialization list the specified instructions.
- Parameters:
inits (
list
ofInstruction
) – List of instructions to be removed
- set_cfg(cfg: Cfg)
Sets the benchmarks control flow graph.
- Parameters:
cfg (
Cfg
) – Control flow graph