P4C
The P4 Compiler
Loading...
Searching...
No Matches
PHV::Slicing::IteratorConfig Struct Reference

Public Member Functions

 IteratorConfig (bool minimal_packing_mode, bool loose_action_packing_check_mode, bool smart_backtracking_mode, bool smart_slicing, bool same_slices, int max_search_steps, int max_search_steps_per_solution)
 

Public Attributes

bool disable_packing_check = false
 
bool homogeneous_slicing = false
 Do not examine split decisions rejected by previous slicings.
 
bool loose_action_packing_check_mode = false
 
int max_search_steps = (1 << 25)
 the total number of steps that the search can take.
 
int max_search_steps_per_solution = (1 << 16)
 
bool minimal_packing_mode = false
 
bool smart_backtracking_mode = false
 
bool smart_slicing = true
 

Member Data Documentation

◆ disable_packing_check

bool PHV::Slicing::IteratorConfig::disable_packing_check = false

Disable packing checks during slicing. This should only be used for diagnose, so it is default to false and not shown in any constructor.

◆ loose_action_packing_check_mode

bool PHV::Slicing::IteratorConfig::loose_action_packing_check_mode = false

loose_action_packing_check mode allows iterator to return super clusters that, without further slicing, action might not be synthesizable because: (1) unwritten bytes in destination container might be corrupted. But it will still try to make sure that with some more proper splitting, the cluster can be allocated.

◆ max_search_steps_per_solution

int PHV::Slicing::IteratorConfig::max_search_steps_per_solution = (1 << 16)

the maximum number of steps that the search can take for finding one valid solution. Once this number is reached, iterator may stop or try apply some optimization then search again. Currently, search (1 << 16) times will take ~50 seconds on Intel(R) Core(TM) i7-8665U. For p4 program with more complicated actions, the duration will be longer.

◆ minimal_packing_mode

bool PHV::Slicing::IteratorConfig::minimal_packing_mode = false

minimal_packing_mode sets the slicing preference to create minimal packing of fieldslices. Slicing result that has less packing of fieldslices will be iterated before others.

◆ smart_backtracking_mode

bool PHV::Slicing::IteratorConfig::smart_backtracking_mode = false

smartly backtrack to the frame that made the invalid packing decision, by leveraging the invalid packing info from packing validator. TODO: prefer to enable but still alt-phv-alloc only because of regression.

◆ smart_slicing

bool PHV::Slicing::IteratorConfig::smart_slicing = true

Misc improvements that are almost necessary for slicing but cannot be enabled because of regression on other part of compiler on master. (1) when choosing the next slice list, prefer the one what the size of its head byte has been decided, for exact containers only. (2) split out the tail if the size of the tail byte have been decided, recursively. TODO: prefer to enable but still alt-phv-alloc only because of regression.