ScEpTIC.AST.transformations.virtual_memory package¶
Subpackages¶
- ScEpTIC.AST.transformations.virtual_memory.analysis package
- Submodules
- ScEpTIC.AST.transformations.virtual_memory.analysis.memory_instructions_indentifier module
- ScEpTIC.AST.transformations.virtual_memory.analysis.memory_usage module
- ScEpTIC.AST.transformations.virtual_memory.analysis.nvm_instructions_identifier module
- ScEpTIC.AST.transformations.virtual_memory.analysis.registers_usage module
- Module contents
- ScEpTIC.AST.transformations.virtual_memory.elements package
- Submodules
- ScEpTIC.AST.transformations.virtual_memory.elements.base_element module
- ScEpTIC.AST.transformations.virtual_memory.elements.basic_block module
- ScEpTIC.AST.transformations.virtual_memory.elements.conditional_block module
- ScEpTIC.AST.transformations.virtual_memory.elements.loop_block module
- ScEpTIC.AST.transformations.virtual_memory.elements.memory_access_metadata module
- Module contents
- ScEpTIC.AST.transformations.virtual_memory.normalizations package
- ScEpTIC.AST.transformations.virtual_memory.parsers package
Submodules¶
ScEpTIC.AST.transformations.virtual_memory.computation_intervals_manager module¶
-
class
ScEpTIC.AST.transformations.virtual_memory.computation_intervals_manager.
ComputationIntervalsManager
(parser, memory_tag_parser, checkpoint_function_name, n_min_function, main_function_name)¶ Bases:
object
-
address_uncertainty
()¶ Addresses the uncertainty of loops
-
adjust_dummy_writes
()¶ Removes from each computation interval all the dummy write operations whose master instruction target volatile memory
-
adjust_functions_stack
()¶ Sets the memory target (volatile/non-volatile) of call and ret instructions
-
apply_virtual_memory_transformations
(memory_optimization_enabled)¶ Applies the implicit save and restore transformations. Then, it consolidates memory read instructions by evaluating multiple strategies for creating volatile copies of memory locations. It skips the transformation for single computation interval functions, as they need to target volatile memory
-
create_checkpoint
()¶ Creates and returns a custom checkpoint function call
-
static
get_name_from_computation_interval_id
(name)¶ Returns the function name from the computation interval id
-
get_ordered_computation_interval
(computation_interval)¶ Returns the basic blocks of the computation interval, ordered by basic block id
-
get_ordered_flatten_computation_interval
(computation_interval)¶ Flattens a computation interval, preserving the correct order of instructions
-
normalize_boundaries
()¶ Normalizes checkpoints to fix computation interval boundaries
-
parse_structures
(parse_loops=True)¶ Parses the AST structures of computation intervals
-
populate_call_trees
()¶ Creates a dictionary that maps to each function the functions it calls
-
populate_functions_parsing_order
()¶ Identifies the correct parsing order of functions We need to parse each caller before its callee. For example, we start from the main, then we parse the functions called in the main, then the functions called by such functions.
-
print_computation_interval
(name)¶ Prints the content of a given computation interval
-
print_computation_intervals
()¶ Prints the content of all the computation intervals
-
split_computation_intervals
()¶ Splits the functions into computation intervals Each computation interval contains a sequence of basic blocks
-
synchronize_to_ast
()¶ Synchronizes all the computation intervals with the AST structure
-
ScEpTIC.AST.transformations.virtual_memory.virtual_memory_transformations module¶
-
class
ScEpTIC.AST.transformations.virtual_memory.virtual_memory_transformations.
VirtualMemoryTransformations
¶ Bases:
object
-
static
address_war_hazards
(basic_blocks, flatten_function, dummy_write_create)¶
-
static
apply
(basic_blocks, flatten_function, write_whitelist, read_blacklist, memory_tags_name_function, n_min_function, dummy_write_create)¶ Applies all the virtual memory transformations: implicit save, implicit restore, and consolidate reads. :param write_whitelist a set of the memory tags that need to be preserved (if None -> all) :param read_blacklist a set of memory tags that need not to be read from NVM :param memory_tags_name_function the naming function for identifying a memory tag :param n_min_function function to calculate the n_min parameter of the consolidate reads transforamtion :param dummy_write_create function to create dummy writes
-
static
apply_implicit_restore
(basic_blocks, read_blacklist, memory_tags_name_function)¶ Applies the transformation to implicitly restore the memory content :param read_blacklist a set of the memory tags that need not to be restored :param memory_tags_name_function the naming function for identifying a memory tag
-
static
apply_implicit_save
(basic_blocks, write_whitelist, memory_tags_name_function)¶ Applies the transformation to implicitly save the memory content to a sequence of basic blocks :param write_whitelist a set of the memory tags that need to be preserved (if None -> all) :param memory_tags_name_function the naming function for identifying a memory tag
-
static
consolidate_memory_operations
(basic_blocks, n_min_function)¶ Applies the transformation that creates volatile copies of frequently-accessed memory locations
-
static
reset_builtin_mapping
(functions)¶ Resets the memory mapping of builtin/input functions
-
static
reset_mapping
(basic_blocks)¶ Reverts the effects of virtual memory transformations
-
static