Skip to content

Commit

Permalink
Get SynthDADynamicDispatch working
Browse files Browse the repository at this point in the history
  • Loading branch information
danjujan committed Nov 8, 2023
1 parent f35bbbe commit 0438383
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion my_case_studies/SynthDADynamicDispatch_0.case_study
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ version: 0
...
---
config_type: PlainCommandlineConfiguration
0: '[]'
0: '["--brut-force"]'
1: '["--sorting"]'
2: '["--hashing"]'
...
4 changes: 2 additions & 2 deletions my_case_studies/SynthDARecursion_0.case_study
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ version: 0
config_type: PlainCommandlineConfiguration
0: '[]'
1: '["--rev"]'
2: '["--limit 5"]'
3: '["--limit 5", "--rev"]'
2: '["--limit 0"]'
3: '["--limit 0", "--rev"]'
...
2 changes: 1 addition & 1 deletion varats/varats/experiments/vara/llvm_coverage_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def analyze(self, tmp_dir: Path) -> actions.StepResult: # pylint: disable=too-m
model_name = tmp_dir / "coverage_report-vara-feature_model.xml"
copy(self.__feature_model, model_name)

opt_command = opt["-enable-new-pm=0", "-vara-PTFDD",
opt_command = opt["-enable-new-pm=0", "-vara-PTFDD", "-vara-FBFD",
"-vara-export-feature-dbg",
#"-vara-view-IRegions",
f"-vara-report-outfile={ptfdd_report_name}", "-S",
Expand Down
31 changes: 31 additions & 0 deletions varats/varats/plots/llvm_coverage_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,34 @@
function="struct decompress_t",
filename="projects/SynthIPRuntime/main.cpp"
),
#SynthDARecursion,
CodeRegion(
start=RegionStart(line=20, column=1),
end=RegionEnd(line=30, column=3),
count=-1,
kind=CodeRegionKind.FILE_ROOT,
function="checkPalindrome",
filename="projects/SynthDARecursion/main.cpp"
),
# SynthDADynamicDispatch
CodeRegion(
start=RegionStart(line=140, column=1),
end=RegionEnd(line=146, column=4),
count=-1,
kind=CodeRegionKind.FILE_ROOT,
function="parsing-code",
filename="projects/SynthDADynamicDispatch/main.cpp"
),
]

# Workaround BDD displaying equivalent but negated formula.
EXCLUDED_OPTIONS = {
# SynthDADynamicDispatch
"brut-force": ["hashing", "sorting"],
"hashing": ["brut-force", "sorting"],
"sorting": ["hashing", "brut-force"],
}


def _init_process() -> None:
from signal import SIGTERM # pylint: disable=import-outside-toplevel
Expand Down Expand Up @@ -526,6 +552,11 @@ def _annotate_covered(
options = feature_option_mapping[features[0]]
if len(options) > 1:
continue
if option in EXCLUDED_OPTIONS:
# Check if other excluded options are set.
if set(EXCLUDED_OPTIONS[option]
).intersection(set(get_option_names(configuration))):
continue
configuration.set_config_option(option, False)

report.annotate_covered(_config_to_func(configuration))
Expand Down

0 comments on commit 0438383

Please sign in to comment.