diff --git a/src/analyzer.py b/src/analyzer.py index 24b8666f..f559b5ca 100644 --- a/src/analyzer.py +++ b/src/analyzer.py @@ -297,6 +297,7 @@ def create_dag(self): return num_edges_reduced = len(self.dag.edges_reduced) + # Checking num_basis_paths = num_edges - num_nodes + 2 self.path_dimension = self.dag.num_edges - self.dag.num_nodes + 2 if num_edges_reduced != self.path_dimension: err_msg = ("The number of non-special edges is different from the dimension of the path.") @@ -631,7 +632,9 @@ def on_exit(start_time, infeasible): logger.info("Candidate path found.") candidate_path_edges = Dag.get_edges(candidate_path_nodes) + print("candidate_path_edges: ", candidate_path_edges) compressed_path = self._compress_path(candidate_path_edges) + print("compressed_path: ", compressed_path) # Temporarily replace the row in the basis matrix to calculate the new determinant. prev_matrix_row = self.basis_matrix[current_row].copy() diff --git a/src/cli.py b/src/cli.py index e55ef4c8..46e8de31 100644 --- a/src/cli.py +++ b/src/cli.py @@ -20,6 +20,7 @@ from analyzer import Analyzer from defaults import logger from gametime_error import GameTimeError +from nx_helper import write_dag_to_dot_file def find_config_file(path: str) -> Optional[str]: @@ -51,7 +52,7 @@ def find_config_file(path: str) -> Optional[str]: return None -def run_gametime(config_path: str, clean_temp: bool = True, backend: str = None) -> int: +def run_gametime(config_path: str, clean_temp: bool = True, backend: str = None, visualize_weights: bool = False) -> int: """ Run GameTime analysis on the specified configuration. @@ -151,6 +152,49 @@ def run_gametime(config_path: str, clean_temp: bool = True, backend: str = None) logger.info(f"WCET Path: {max_path}") logger.info("="*60) + + # Visualize weighted graph if requested + if visualize_weights: + logger.info("\n" + "="*60) + logger.info("GENERATING WEIGHTED GRAPH DOT FILE") + logger.info("="*60) + + # Estimate edge weights + logger.info("Estimating edge weights...") + analyzer.estimate_edge_weights() + + # Create output directory for visualizations + # Use the project root's visualizations directory (similar to test file) + config_dir = os.path.dirname(os.path.abspath(config_path)) + # Go up to project root and use visualizations directory there + # This matches the test file's approach: ../../visualizations from test location + output_dir = os.path.join(config_dir, '..', '..', 'visualizations') + output_dir = os.path.abspath(output_dir) + os.makedirs(output_dir, exist_ok=True) + + # Generate filename based on function name and backend + func_name = project_config.func.replace(' ', '_').lower() + backend_name = project_config.backend if project_config.backend else 'default' + dot_filename = f'{func_name}_{backend_name}_weighted_graph.dot' + dot_path = os.path.join(output_dir, dot_filename) + + # Create edge labels with weights + edge_labels = {} + edge_list = list(analyzer.dag.all_edges) + for i in range(len(analyzer.dag.edge_weights)): + if i < len(edge_list): + edge = edge_list[i] + weight = analyzer.dag.edge_weights[i] + if abs(weight) > 0.01: # Only label non-zero weights + edge_labels[edge] = f'{weight:.2f}' + else: # Add zero weights too to avoid KeyError + edge_labels[edge] = '0.00' + + logger.info(f"Creating weighted graph DOT file...") + write_dag_to_dot_file(analyzer.dag, dot_path, edges_to_labels=edge_labels) + logger.info(f"DOT file saved to: {dot_path}") + logger.info("="*60) + logger.info("\nAnalysis completed successfully!") return 0 @@ -183,6 +227,9 @@ def main(): # Run analysis without cleaning temporary files gametime /path/to/test/folder --no-clean + + # Run analysis and generate weighted graph visualization + gametime /path/to/test/folder --visualize-weights """ ) @@ -209,6 +256,12 @@ def main(): version='GameTime 0.1.0' ) + parser.add_argument( + '--visualize-weights', + action='store_true', + help='Generate a DOT file visualizing the weighted graph with estimated edge weights' + ) + args = parser.parse_args() # Validate the path @@ -227,7 +280,8 @@ def main(): exit_code = run_gametime( config_path, clean_temp=not args.no_clean, - backend=args.backend + backend=args.backend, + visualize_weights=args.visualize_weights ) return exit_code diff --git a/test/tacle_test/programs/binarysearch/binarysearch.c b/test/binarysearch/binarysearch.c similarity index 100% rename from test/tacle_test/programs/binarysearch/binarysearch.c rename to test/binarysearch/binarysearch.c diff --git a/test/tacle_test/programs/binarysearch/config.yaml b/test/binarysearch/config.yaml similarity index 100% rename from test/tacle_test/programs/binarysearch/config.yaml rename to test/binarysearch/config.yaml diff --git a/test/tacle_test/programs/bitcount/bitcnt_2.c b/test/bitcount/bitcnt_2.c similarity index 100% rename from test/tacle_test/programs/bitcount/bitcnt_2.c rename to test/bitcount/bitcnt_2.c diff --git a/test/tacle_test/programs/bitcount/config.yaml b/test/bitcount/config.yaml similarity index 100% rename from test/tacle_test/programs/bitcount/config.yaml rename to test/bitcount/config.yaml diff --git a/test/tacle_test/gametime_examples/bitmask/bitmask.c b/test/bitmask/bitmask.c similarity index 100% rename from test/tacle_test/gametime_examples/bitmask/bitmask.c rename to test/bitmask/bitmask.c diff --git a/test/tacle_test/gametime_examples/bitmask/config.yaml b/test/bitmask/config.yaml similarity index 100% rename from test/tacle_test/gametime_examples/bitmask/config.yaml rename to test/bitmask/config.yaml diff --git a/test/tacle_test/programs/bsort/bsort.c b/test/bsort/bsort.c similarity index 100% rename from test/tacle_test/programs/bsort/bsort.c rename to test/bsort/bsort.c diff --git a/test/tacle_test/programs/bsort/config.yaml b/test/bsort/config.yaml similarity index 100% rename from test/tacle_test/programs/bsort/config.yaml rename to test/bsort/config.yaml diff --git a/test/tacle_test/programs/countnegative/config.yaml b/test/countnegative/config.yaml similarity index 100% rename from test/tacle_test/programs/countnegative/config.yaml rename to test/countnegative/config.yaml diff --git a/test/tacle_test/programs/countnegative/countnegative.c b/test/countnegative/countnegative.c similarity index 100% rename from test/tacle_test/programs/countnegative/countnegative.c rename to test/countnegative/countnegative.c diff --git a/test/tacle_test/programs/deg2rad/config.yaml b/test/deg2rad/config.yaml similarity index 100% rename from test/tacle_test/programs/deg2rad/config.yaml rename to test/deg2rad/config.yaml diff --git a/test/tacle_test/programs/deg2rad/deg2rad.c b/test/deg2rad/deg2rad.c similarity index 100% rename from test/tacle_test/programs/deg2rad/deg2rad.c rename to test/deg2rad/deg2rad.c diff --git a/test/tacle_test/programs/ext_func/c_lib_test/c_lib_test.c b/test/ext_func/c_lib_test/c_lib_test.c similarity index 100% rename from test/tacle_test/programs/ext_func/c_lib_test/c_lib_test.c rename to test/ext_func/c_lib_test/c_lib_test.c diff --git a/test/tacle_test/programs/ext_func/config.yaml b/test/ext_func/config.yaml similarity index 100% rename from test/tacle_test/programs/ext_func/config.yaml rename to test/ext_func/config.yaml diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/ext_func.c b/test/ext_func/ext_lib_test/ext_func.c similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/ext_func.c rename to test/ext_func/ext_lib_test/ext_func.c diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/helper.c b/test/ext_func/ext_lib_test/helper.c similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/helper.c rename to test/ext_func/ext_lib_test/helper.c diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/helper.h b/test/ext_func/ext_lib_test/helper.h similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/helper.h rename to test/ext_func/ext_lib_test/helper.h diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/inline.py b/test/ext_func/ext_lib_test/inline.py similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/inline.py rename to test/ext_func/ext_lib_test/inline.py diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/inline_functions.cpp b/test/ext_func/ext_lib_test/inline_functions.cpp similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/inline_functions.cpp rename to test/ext_func/ext_lib_test/inline_functions.cpp diff --git a/test/tacle_test/programs/ext_func/ext_lib_test/modify_llvm_ir.py b/test/ext_func/ext_lib_test/modify_llvm_ir.py similarity index 100% rename from test/tacle_test/programs/ext_func/ext_lib_test/modify_llvm_ir.py rename to test/ext_func/ext_lib_test/modify_llvm_ir.py diff --git a/test/flexpret_test/flexpret_test.py b/test/flexpret_test/flexpret_test.py deleted file mode 100644 index 5784d23b..00000000 --- a/test/flexpret_test/flexpret_test.py +++ /dev/null @@ -1,39 +0,0 @@ -import unittest - -import clang_helper -import shutil - -from path_analyzer import PathAnalyzer -from project_configuration import ProjectConfiguration -from project_configuration_parser import YAMLConfigurationParser -from backend.flexpret_backend import flexpret_backend -from analyzer import Analyzer -import os -from smt_solver.extract_labels import find_labels -from smt_solver.smt import run_smt - -class TestFlexpret(unittest.TestCase): - def setUp(self): - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("./programs/add/config.yaml") - shutil.rmtree(self.project_config.location_temp_dir) - - def test_measure_basis_path(self): - analyzer = Analyzer(self.project_config) - analyzer.create_dag() - paths = analyzer.generate_basis_paths() - - self.assertIsNotNone(paths[0], "no paths were found") - output_dir = os.path.join(self.project_config.location_temp_dir, "output") - os.mkdir(output_dir) - labels = [] - for path in paths: - bitcode = [] - for node in path.nodes: - bitcode.append(analyzer.dag.get_node_label(analyzer.dag.nodes_indices[node])) - labels_file = find_labels("".join(bitcode), output_dir) - run_smt(self.project_config, labels_file, output_dir) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/flexpret_test/flexpret_wcet_test.py b/test/flexpret_test/flexpret_wcet_test.py deleted file mode 100644 index 677bbc30..00000000 --- a/test/flexpret_test/flexpret_wcet_test.py +++ /dev/null @@ -1,298 +0,0 @@ -import os.path -import unittest - -from path import Path -from path_analyzer import PathAnalyzer -from project_configuration import ProjectConfiguration -from project_configuration_parser import YAMLConfigurationParser -from simulator.flexpret_simulator import flexpret_simulator -from analyzer import Analyzer -from histogram import write_histogram_to_file - -class FlexpretTest(unittest.TestCase): - - def run_wcet_path_analyzer(self): - analyzer = Analyzer(self.project_config) - analyzer.create_dag() - - basis_paths = analyzer.generate_basis_paths() - self.assertIsNotNone(basis_paths[0], "no paths were found") - analyzer.measure_basis_paths() - - generated_paths = analyzer.generate_paths() - results = [] - fp_simulator = flexpret_simulator.FlexpretSimulator(self.project_config) - - for i in range(len(generated_paths)): - output_name: str = f'path{i}' - p: Path = generated_paths[i] - path_analyzer = PathAnalyzer(analyzer.preprocessed_path, analyzer.project_config, analyzer.dag, p, output_name) - value = path_analyzer.measure_path(fp_simulator) - p.set_measured_value(value) - results.append(value) - print(results) - - def run_wcet_analyzer(self): - analyzer = Analyzer(self.project_config) - analyzer.create_dag() - - basis_paths = analyzer.generate_basis_paths() - self.assertIsNotNone(basis_paths[0], "no paths were found") - analyzer.measure_basis_paths() - - generated_paths = analyzer.generate_paths() - results = [] - - for i in range(len(generated_paths)): - output_name: str = f'path{i}' - p: Path = generated_paths[i] - value = analyzer.measure_path(p, output_name) - results.append(value) - print(results) - - def run_basis_path_compute_histogram(self): - analyzer = Analyzer(self.project_config) - analyzer.create_dag() - - basis_paths = analyzer.generate_basis_paths() - self.assertIsNotNone(basis_paths[0], "no paths were found") - analyzer.measure_basis_paths() - - location = os.path.join(analyzer.project_config.location_temp_dir, "basis_path_histogram") - write_histogram_to_file(location=location, paths=basis_paths, measured=True) - - def run_generated_path_compute_histogram(self): - analyzer = Analyzer(self.project_config) - analyzer.create_dag() - - basis_paths = analyzer.generate_basis_paths() - self.assertIsNotNone(basis_paths[0], "no paths were found") - analyzer.measure_basis_paths() - - generated_paths = analyzer.generate_paths() - analyzer.measure_paths(generated_paths, "path") - - location = os.path.join(analyzer.project_config.location_temp_dir, "generated_path_histogram") - write_histogram_to_file(location=location, paths=generated_paths, measured=True) - - - -class TestAdd(FlexpretTest): - def setUp(self): - print("setup test add") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/add/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestCalloc(FlexpretTest): - def setUp(self): - print("setup test calloc") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/calloc/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestFactorial(FlexpretTest): - def setUp(self): - print("setup test factorial") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/factorial/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestFib(FlexpretTest): - def setUp(self): - print("setup test fib") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/fib/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestGlobal(FlexpretTest): - def setUp(self): - print("setup test global") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/global/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestGpio(FlexpretTest): - def setUp(self): - print("setup test gpio") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/gpio/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestHwlock(FlexpretTest): - def setUp(self): - print("setup test hwlock") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/hwlock/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestLbu(FlexpretTest): - def setUp(self): - print("setup test lbu") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/lbu/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestMalloc(FlexpretTest): # cycle issue - def setUp(self): - print("setup test malloc") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/malloc/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestRealloc(FlexpretTest): - def setUp(self): - print("setup test realloc") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/realloc/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestSyscall(FlexpretTest): - def setUp(self): - print("setup test syscall") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/syscall/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - -class TestTime(FlexpretTest): - def setUp(self): - print("setup test time") - self.project_config: ProjectConfiguration = \ - YAMLConfigurationParser.parse("test_flexpret_simulator/programs/time/config.yaml") - - def test_run_wcet_path_analyzer(self): - self.run_wcet_path_analyzer() - - def test_run_wcet_analyzer(self): - self.run_wcet_analyzer() - - def test_run_basis_path_compute_histogram(self): - self.run_basis_path_compute_histogram() - - def test_run_generated_path_compute_histogram(self): - self.run_wcet_analyzer() - - -if __name__ == '__main__': - unittest.main() \ No newline at end of file diff --git a/test/flexpret_test/programs/add/add.c b/test/flexpret_test/programs/add/add.c deleted file mode 100644 index 75f07dc9..00000000 --- a/test/flexpret_test/programs/add/add.c +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include "flexpret.h" - -uint32_t add(uint32_t a, uint32_t b) { - return a + b; -} - -int main() { - - uint32_t x = 1; - printf("x is %i\n", x); - uint32_t y = 2; - printf("y is %i\n", y); - - uint32_t z = add(x, y); - printf("z is %i\n", z); - assert(z == 3, "1 + 2 =/= 3"); - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/add/config.yaml b/test/flexpret_test/programs/add/config.yaml deleted file mode 100644 index 7a2ed182..00000000 --- a/test/flexpret_test/programs/add/config.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: add.c - #Function to analyze. - analysis-function: add - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - diff --git a/test/flexpret_test/programs/calloc/calloc.c b/test/flexpret_test/programs/calloc/calloc.c deleted file mode 100644 index df17f3a6..00000000 --- a/test/flexpret_test/programs/calloc/calloc.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include -#include "flexpret.h" - -int main() { - // Allocate an array - int length = 10; - uint32_t *arr = calloc(length, sizeof(uint32_t)); - - assert(arr, "Array allocation unsucessful"); - - // Check that array was initialized to zero - for (uint32_t i = 0; i < length; i++) { - assert(arr[i] == 0, "Array not initialized to zeros"); - } - - for (uint32_t i = 0; i < length; i++) { - arr[i] = i; - } - - for (uint32_t i = 0; i < length; i++) { - assert(arr[i] == i, "Array element not set"); - printf("arr[%i] = %i\n", i, arr[i]); - } - - // Free the memory. - free(arr); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/calloc/config.yaml b/test/flexpret_test/programs/calloc/config.yaml deleted file mode 100644 index 5603347f..00000000 --- a/test/flexpret_test/programs/calloc/config.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: calloc.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - diff --git a/test/flexpret_test/programs/factorial/config.yaml b/test/flexpret_test/programs/factorial/config.yaml deleted file mode 100644 index a66968d6..00000000 --- a/test/flexpret_test/programs/factorial/config.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: factorial.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - diff --git a/test/flexpret_test/programs/factorial/factorial.c b/test/flexpret_test/programs/factorial/factorial.c deleted file mode 100644 index 010c413e..00000000 --- a/test/flexpret_test/programs/factorial/factorial.c +++ /dev/null @@ -1,15 +0,0 @@ -#include - -int factorial(int n) { - //base case - if(n == 0) { - return 1; - } else { - return n * factorial(n-1); - } -} - -int main() { - int n = 5; - factorial(n); -} \ No newline at end of file diff --git a/test/flexpret_test/programs/fib/config.yaml b/test/flexpret_test/programs/fib/config.yaml deleted file mode 100644 index 31762bf2..00000000 --- a/test/flexpret_test/programs/fib/config.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: fib.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - diff --git a/test/flexpret_test/programs/fib/fib.c b/test/flexpret_test/programs/fib/fib.c deleted file mode 100644 index 42210fc4..00000000 --- a/test/flexpret_test/programs/fib/fib.c +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -// A humble Fibonacci function. -uint32_t fib(uint32_t n) { - if (n == 0) return 0; - n--; - uint32_t a = 0; - uint32_t b = 1; - while(n > 0) { - uint32_t new_b = a + b; - a = b; - b = new_b; - n--; - } - return b; -} - -int main() { - uint32_t x = fib(16); - printf("fib(16) is %i\n", x); - - // Correct value - assert(x == 987, "Incorrect value for fib(16)"); - - x = fib(20); - printf("fib(20) is %i\n", x); - - // Correct value - assert(x == 6765, "Incorrect value for fib(20)"); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/global/config.yaml b/test/flexpret_test/programs/global/config.yaml deleted file mode 100644 index 2d57e103..00000000 --- a/test/flexpret_test/programs/global/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: global.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/global/global.c b/test/flexpret_test/programs/global/global.c deleted file mode 100644 index 17f56cc4..00000000 --- a/test/flexpret_test/programs/global/global.c +++ /dev/null @@ -1,16 +0,0 @@ -// This test checks if global variables are properly initialized. -#include -#include - -int x = 1; -int y = 2; - -int main() { - printf("global variable x is %i\n", x); - printf("global variable y is %i\n", y); - - assert(x == 1, "x not properly set"); - assert(y == 2, "y not properly set"); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/gpio/config.yaml b/test/flexpret_test/programs/gpio/config.yaml deleted file mode 100644 index 29846df3..00000000 --- a/test/flexpret_test/programs/gpio/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: gpio.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/gpio/gpio.c b/test/flexpret_test/programs/gpio/gpio.c deleted file mode 100644 index 77081e2b..00000000 --- a/test/flexpret_test/programs/gpio/gpio.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -static inline bool write_and_readback(const uint32_t val) { - printf("Write gpio: 0x%x\n", val); - gpo_write_0(val); - const uint32_t readback = gpo_read_0(); - printf("Read gpio: 0x%x\n", readback); - return val == readback; -} - -int main() { - printf("--- Check initial value is zero\n"); - uint32_t x = gpo_read_0(); - printf("Read gpio: 0x%x\n", x); // Expect 0. - assert(x == 0, "Read incorrect value"); - - printf("--- Check write and readback\n"); - assert(write_and_readback(0x01) == true, "write and readback test failed"); - assert(write_and_readback(0x00) == true, "write and readback test failed"); - assert(write_and_readback(0x03) == true, "write and readback test failed"); - assert(write_and_readback(0x02) == true, "write and readback test failed"); - - printf("--- Check individual set and clear\n"); - uint32_t set = 0x01; - printf("Set gpio: 0x%x\n", set); - - gpo_set_0(set); // Set the 1st bit. - uint32_t read = gpo_read_0(); // Expect 3. - - printf("Read gpio: 0x%x\n", read); - assert(read == 0x03, "Read incorrect value"); - - uint32_t clear = 0x2; - printf("Clear gpio: 0x%x\n", clear); - - gpo_clear_0(clear); // Clear the 2nd bit. - read = gpo_read_0(); - - printf("Read gpio: 0x%x\n", read); - assert(read == 0x01, "Read incorrect value"); // Expect 1. - - printf("--- Check set invalid bit\n"); - gpo_set_0(0b100); // Set the 3rd bit, - // but couldn't because - // a GPO only has 2 bits. - assert(gpo_read_0() == 0x01, "Read incorrect value"); // Expect 1. - - printf("Set invalid bit has no effect\n"); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/hwlock/config.yaml b/test/flexpret_test/programs/hwlock/config.yaml deleted file mode 100644 index 274815aa..00000000 --- a/test/flexpret_test/programs/hwlock/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: hwlock.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/hwlock/hwlock.c b/test/flexpret_test/programs/hwlock/hwlock.c deleted file mode 100644 index a3d92601..00000000 --- a/test/flexpret_test/programs/hwlock/hwlock.c +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include -#include - -int main() { - - // Print the hardware thread id. - printf("HW thread id: %i\n", read_hartid()); - - // Acquire the lock. - hwlock_acquire(); - - // Release the lock. - hwlock_release(); - - printf("HW lock sucessfully acquired and released\n"); - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/lbu/config.yaml b/test/flexpret_test/programs/lbu/config.yaml deleted file mode 100644 index 4a135654..00000000 --- a/test/flexpret_test/programs/lbu/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: lbu.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/lbu/lbu.c b/test/flexpret_test/programs/lbu/lbu.c deleted file mode 100644 index 185273cf..00000000 --- a/test/flexpret_test/programs/lbu/lbu.c +++ /dev/null @@ -1,55 +0,0 @@ -#include -#include - -#define X_INIT 0x10E0 -#define Y_INIT 2 - -int main() { - - uint32_t x = X_INIT; // x = 4320 - uint32_t y = Y_INIT; - printf("x is %i\n", x); - printf("y is %i\n", y); - - // Check if basic inline assembly works. - asm volatile ( - "add %0, %0, %1" - : "+r"(y) - : "r"(x) - ); - - printf("Ran inline assembly that adds places x + y in y\n"); - printf("y is %i\n", y); - assert(y == (X_INIT + Y_INIT), "Inline assembly add got incorrect value"); - - void *p = (void*)0x20004000; - - // Store word - uint32_t z; - asm volatile ( - "sw %1, 0(%2)\n\t" - "lw %0, 0(%2)" - : "=r"(z) - : "r"(x), "r"(p) - ); - - printf("Ran inline assembly that stores x and loads it into z\n"); - printf("z is %i\n", z); - assert(z == x, "Inline assembly store and load got incorrect value"); - - // Check lbu implementation. - asm volatile ( - "check_lbu: \n\t" - "lbu %0, 0(%1)" - : "=r"(z) - : "r"(p) - ); - - printf("Ran inline assembly that loads the first byte of x into z\n"); - printf("x = 0x%x\n", x); - printf("z = 0x%x\n", z); - - assert(z == (X_INIT & 0xFF), "Inline assembly load one byte got incorrect value"); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/malloc/config.yaml b/test/flexpret_test/programs/malloc/config.yaml deleted file mode 100644 index faf50e54..00000000 --- a/test/flexpret_test/programs/malloc/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: malloc.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/malloc/malloc.c b/test/flexpret_test/programs/malloc/malloc.c deleted file mode 100644 index 585998e7..00000000 --- a/test/flexpret_test/programs/malloc/malloc.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include - -#define A_INIT 100 -#define B_INIT 200 -#define C_INIT 300 - -int main() { - - uint32_t* a = malloc(sizeof(uint32_t)); - uint32_t* b = malloc(sizeof(uint32_t)); - uint32_t* c = malloc(sizeof(uint32_t)); - uint32_t* d = malloc(sizeof(uint32_t)); - - assert(a && b && c && d, "Variable malloc failed"); - - *a = A_INIT; - *b = B_INIT; - *c = C_INIT; - *d = *a + *b + *c; - - assert(*a == A_INIT, "Incorrect value for a"); - assert(*b == B_INIT, "Incorrect value for b"); - assert(*c == C_INIT, "Incorrect value for c"); - assert(*d == (A_INIT + B_INIT + C_INIT), "Incorrect value for d"); - - printf("a has address %p with value %i\n", a, *a); - printf("b has address %p with value %i\n", b, *b); - printf("c has address %p with value %i\n", c, *c); - printf("d has address %p with value %i\n", d, *d); - - free(a); - free(b); - free(c); - free(d); - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/realloc/config.yaml b/test/flexpret_test/programs/realloc/config.yaml deleted file mode 100644 index f1b427a9..00000000 --- a/test/flexpret_test/programs/realloc/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: realloc.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/realloc/realloc.c b/test/flexpret_test/programs/realloc/realloc.c deleted file mode 100644 index 5d63a99a..00000000 --- a/test/flexpret_test/programs/realloc/realloc.c +++ /dev/null @@ -1,23 +0,0 @@ -// Example from https://www.geeksforgeeks.org/g-fact-66/ -#include -#include -#include -#include - -int main() { - int *ptr = (int *)malloc(sizeof(int)*2); - int i; - int *ptr_new; - - *ptr = 1; - *(ptr + 1) = 2; - - ptr_new = (int *)realloc(ptr, sizeof(int)*3); - *(ptr_new + 2) = 3; - for(i = 0; i < 3; i++) { - printf("realloced[%i] is %i\n", i, *(ptr_new + i)); - assert(*(ptr_new + i) == (i + 1), "Incorrect value"); - } - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/sections/config.yaml b/test/flexpret_test/programs/sections/config.yaml deleted file mode 100644 index 06b16e24..00000000 --- a/test/flexpret_test/programs/sections/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: sections.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/sections/sections.c b/test/flexpret_test/programs/sections/sections.c deleted file mode 100644 index 95fdd124..00000000 --- a/test/flexpret_test/programs/sections/sections.c +++ /dev/null @@ -1,102 +0,0 @@ -/** - * @file sections.c - * @author Magnus Mæhlum (magnusmaehlum@outlook.com) - * - * This test checks that data put in the different sections work as expected. - * It both prints the addresses and values of the data put in the sections. - * - * Notably, data put in the .text section stays in the instruction memory, - * which is not byte addressible. - * - */ - -#include "flexpret.h" -#include -#include - -#define TEXTDATA_INIT_VAL (41) -#define RODATA_INIT_VAL (42) -#define SRODATA_INIT_VAL (43) -#define ARRAY_INIT_VAL { 0x11, 0x22, 0x33, 0x44 } - -// Adding '#' after the sections removes an assembler warning; see -// https://stackoverflow.com/questions/58455300/assembler-warning-with-gcc-warning-when-placing-data-in-text -const int32_t c_textdata __attribute__((section(".text.c#"))) = TEXTDATA_INIT_VAL; -const int32_t c_rodata __attribute__((section(".rodata.c#"))) = RODATA_INIT_VAL; -const int32_t c_srodata __attribute__((section(".srodata.c#"))) = SRODATA_INIT_VAL; - -static int32_t d_textdata __attribute__((section(".text.d#"))) = TEXTDATA_INIT_VAL; -static int32_t d_rodata __attribute__((section(".rodata.d#"))) = RODATA_INIT_VAL; -static int32_t d_srodata __attribute__((section(".srodata.d#"))) = SRODATA_INIT_VAL; - -int32_t textdata __attribute__((section(".text.i#"))) = TEXTDATA_INIT_VAL; -int32_t rodata __attribute__((section(".rodata.i#"))) = RODATA_INIT_VAL; -int32_t srodata __attribute__((section(".srodata.i#"))) = SRODATA_INIT_VAL; - -// A byte array in .text is a bad idea, since the instruction memory (IMEM) is not -// byte adressable. We should expect that indexing this array yields the same -// word for all four indicies. -uint8_t arraytext[4] __attribute__((section(".text.a#"))) = ARRAY_INIT_VAL; - -// If the linker script is set up properly, .rodata and .srodata should be placed -// in .data, i.e., the data memory (DMEM) and therefore be byte addressable. -uint8_t arrayrodata[4] __attribute__((section(".rodata.a#"))) = ARRAY_INIT_VAL; -uint8_t arraysrodata[4] __attribute__((section(".srodata.a#"))) = ARRAY_INIT_VAL; - - -// Pass-by-value will copy it, losing the address -static inline void _print_addr_val(const int32_t *val) -{ - printf("word has address %p and value %i\n", val, *val); -} - -int main() { - _print_addr_val(&c_textdata); - _print_addr_val(&c_rodata); - _print_addr_val(&c_srodata); - - _print_addr_val(&d_textdata); - _print_addr_val(&d_rodata); - _print_addr_val(&d_srodata); - - _print_addr_val(&textdata); - _print_addr_val(&rodata); - _print_addr_val(&srodata); - - assert(c_textdata == TEXTDATA_INIT_VAL, "Const value not properly set"); - assert(c_rodata == RODATA_INIT_VAL, "Const value not properly set"); - assert(c_srodata == SRODATA_INIT_VAL, "Const value not properly set"); - - assert(d_textdata == TEXTDATA_INIT_VAL, "Static value not properly set"); - assert(d_rodata == RODATA_INIT_VAL, "Static value not properly set"); - assert(d_srodata == SRODATA_INIT_VAL, "Static value not properly set"); - - assert(textdata == TEXTDATA_INIT_VAL, "Value not properly set"); - assert(rodata == RODATA_INIT_VAL, "Value not properly set"); - assert(srodata == SRODATA_INIT_VAL, "Value not properly set"); - - const uint8_t array[4] = ARRAY_INIT_VAL; - - for (int i = 0; i < sizeof(arraytext); i++) { - // Expect the array to have the same value for all indicies; see earlier - // for explanation - assert( - arraytext[i] == ( - (array[0] << 0) | - (array[1] << 8) | - (array[2] << 16) | - (array[3] << 24) - ), "Array in .text not word indexed as expected" - ); - } - - for (int i = 0; i < sizeof(arrayrodata); i++) { - assert(arrayrodata[i] == array[i], "Array in .rodata incorrect"); - } - - for (int i = 0; i < sizeof(arraysrodata); i++) { - assert(arraysrodata[i] == array[i], "Array in .srodata incorrect"); - } - - return 0; -} \ No newline at end of file diff --git a/test/flexpret_test/programs/syscall/config.yaml b/test/flexpret_test/programs/syscall/config.yaml deleted file mode 100644 index d377ed94..00000000 --- a/test/flexpret_test/programs/syscall/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: syscall.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/syscall/syscall.c b/test/flexpret_test/programs/syscall/syscall.c deleted file mode 100644 index ba2fd400..00000000 --- a/test/flexpret_test/programs/syscall/syscall.c +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file syscall.c - * @author Magnus Mæhlum (magnusmaehlum@outlook.com) - * - * This test checks both that the system calls in ../../lib/syscalls/syscalls.c - * work as expected. It also checks that the errno variable works as expected. - * - */ - -#include -#include -#include -#include - -#include -#include - -int main() { - int ret; - - ret = close(28); - assert(ret == -1, "Return value not as expected"); - assert(errno == ENOSYS, "Errno not as expected"); - - ret = getpid(); - assert(ret == -1, "Return value not as expected"); - assert(errno == ENOSYS, "Errno not as expected"); - - struct timeval tv; - ret = gettimeofday(&tv, NULL); - assert(ret == 0, "Return value not as expected"); - assert(errno == 0, "Errno not as expected"); - - printf("tv.tv_sec is %i\n", tv.tv_sec); - printf("tv.tv_usec is %i\n", tv.tv_usec); - - exit(1); - - // Should never reach this - assert(0, "Unreachable code reached"); -} \ No newline at end of file diff --git a/test/flexpret_test/programs/time/config.yaml b/test/flexpret_test/programs/time/config.yaml deleted file mode 100644 index 165362fa..00000000 --- a/test/flexpret_test/programs/time/config.yaml +++ /dev/null @@ -1,60 +0,0 @@ ---- -# This is the YAML file that configures GameTime for a specific project. -gametime-project: - # Information about the function to analyze. - file: - #Location of the file containing the function to analyze. - #This location can be either absolute or relative: - #if relative, the location is resolved with respect to - #the directory that contains this YAML file. - location: time.c - #Function to analyze. - analysis-function: main - #Label in the function to start analysis from. - #If left empty, GameTime will start analysis of the function - #Sfrom its beginning. - start-label: null - #Label in the function to end analysis at. - #If left empty, GameTime will end analysis of the function - #at its end. - end-label: null - - #GametimeConfiguration options for preprocessing the file using - #source-to-source transformations before analysis. - preprocess: - #Locations of directories that contain other files that need to be - #compiled and linked, but not preprocessed, with the file - #that contains the function to be analyzed, such as header files. - #More than one directory can be specified, and the names must be - #separated by either whitespaces or commas. The locations can be - #either absolute or relative: if relative, a location is resolved - #with respect to the directory that contains this YAML file. - include: null - #Locations of other files to be merged and preprocessed with - #the file that contains the function to be analyzed. More than one - #file can be specified, and the names must be separated by - #either whitespaces or commas. Unix-style globs are also permitted. - #The locations can be either absolute or relative: if relative, - #a location is resolved with respect to the directory that contains - #this YAML file. - merge: null - #Functions to inline, if any. More than one function - #can be specified, and the names must be a string array. - inline: yes - #Bool for whether or not to unroll loops - #uncomment to unroll loops - unroll-loops: Yes - - analysis: - maximum-error-scale-factor: 10 - determinant-threshold: 0.001 - max-infeasible-paths: 100 - ilp-solver: glpk - # gametime-flexpret-path: ../../flexpret/ # default path when running on docker - # gametime-path: .. # default path when tests from the test folder - # gametime-file-path: ../../../.. # default path when tests from the test folder - gametime-flexpret-path: ../flexpret/ # default path when running locally - gametime-path: ../../ # default path when tests locally - gametime-file-path: ../../../.. # default path when tests locally - - diff --git a/test/flexpret_test/programs/time/time.c b/test/flexpret_test/programs/time/time.c deleted file mode 100644 index e8086202..00000000 --- a/test/flexpret_test/programs/time/time.c +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include "flexpret.h" - - -int main() { - uint32_t t1 = rdtime(); - printf("First rdtime() call: %i\n", t1); - - uint32_t t2 = rdtime(); - printf("Second rdtime() call: %i\n", t2); - - assert(t1 < t2, "Second call to rdtime() had smaller time value"); - - uint64_t t3 = rdtime64(); - printf("First rdtime64() call:\n\t[63-32]: %i\n\t[31- 0]: %i\n", t3, t3 >> 32); - - uint64_t t4 = rdtime64(); - printf("Second rdtime64() call:\n\t[63-32]: %i\n\t[31- 0]: %i\n", t4, t4 >> 32); - - assert(t3 < t4, "Second call to rdtime64() had smaller value"); -} \ No newline at end of file diff --git a/test/tacle_test/programs/if_elif_else/config.yaml b/test/if_elif_else/config.yaml similarity index 100% rename from test/tacle_test/programs/if_elif_else/config.yaml rename to test/if_elif_else/config.yaml diff --git a/test/tacle_test/programs/if_elif_else/helper.c b/test/if_elif_else/helper.c similarity index 100% rename from test/tacle_test/programs/if_elif_else/helper.c rename to test/if_elif_else/helper.c diff --git a/test/tacle_test/programs/if_elif_else/helper.h b/test/if_elif_else/helper.h similarity index 100% rename from test/tacle_test/programs/if_elif_else/helper.h rename to test/if_elif_else/helper.h diff --git a/test/tacle_test/programs/if_elif_else/if_elif_else.c b/test/if_elif_else/if_elif_else.c similarity index 60% rename from test/tacle_test/programs/if_elif_else/if_elif_else.c rename to test/if_elif_else/if_elif_else.c index f607420e..1f26f4e8 100644 --- a/test/tacle_test/programs/if_elif_else/if_elif_else.c +++ b/test/if_elif_else/if_elif_else.c @@ -5,14 +5,18 @@ int abs(int x); int test(int x){ - if (abs(x) == 4) { - return 0; - } else { + if (x == 4) { + int a = 1; + int b = a * 2; + int c = a * b; + } + if (x == 4) { int a = 1; int b = a * 2; int c = a * b; return c; } + return 0; } diff --git a/test/tacle_test/programs/insertsort/config.yaml b/test/insertsort/config.yaml similarity index 100% rename from test/tacle_test/programs/insertsort/config.yaml rename to test/insertsort/config.yaml diff --git a/test/tacle_test/programs/insertsort/insertsort.c b/test/insertsort/insertsort.c similarity index 100% rename from test/tacle_test/programs/insertsort/insertsort.c rename to test/insertsort/insertsort.c diff --git a/test/tacle_test/programs/loops/convert.py b/test/loops/convert.py similarity index 100% rename from test/tacle_test/programs/loops/convert.py rename to test/loops/convert.py diff --git a/test/tacle_test/programs/loops/loop.c b/test/loops/loop.c similarity index 100% rename from test/tacle_test/programs/loops/loop.c rename to test/loops/loop.c diff --git a/test/tacle_test/programs/modexp/config.yaml b/test/modexp/config.yaml similarity index 100% rename from test/tacle_test/programs/modexp/config.yaml rename to test/modexp/config.yaml diff --git a/test/tacle_test/programs/modexp/modexp.c b/test/modexp/modexp.c similarity index 100% rename from test/tacle_test/programs/modexp/modexp.c rename to test/modexp/modexp.c diff --git a/test/tacle_test/programs/prime/config.yaml b/test/prime/config.yaml similarity index 100% rename from test/tacle_test/programs/prime/config.yaml rename to test/prime/config.yaml diff --git a/test/tacle_test/programs/prime/prime.c b/test/prime/prime.c similarity index 100% rename from test/tacle_test/programs/prime/prime.c rename to test/prime/prime.c diff --git a/test/tacle_test/wcet_test.py b/test/tacle_test/wcet_test.py deleted file mode 100644 index 88493425..00000000 --- a/test/tacle_test/wcet_test.py +++ /dev/null @@ -1,157 +0,0 @@ -import unittest - -import clang_helper -import shutil - -from project_configuration import ProjectConfiguration -from project_configuration_parser import YAMLConfigurationParser -from analyzer import Analyzer -from pulp_helper import generate_and_solve_core_problem -import os - -class BaseTest(unittest.TestCase): - config_path = None - backend_value = None - - def setUp(self): - if not self.config_path: - raise ValueError("Configuration path must be set in subclass") - self.project_config = YAMLConfigurationParser.parse(self.config_path) - shutil.rmtree(self.project_config.location_temp_dir) - - if self.backend_value: - self.project_config.backend = self.backend_value - - def create_analyzer(self): - return Analyzer(self.project_config) - - # def test_measure_basis_path(self): - # analyzer = self.create_analyzer() - # analyzer.create_dag() - # paths = analyzer.generate_basis_paths() - - # self.assertIsNotNone(paths[0], "no paths were found") - # analyzer.measure_basis_paths() - # for p in paths: - # print(p.get_measured_value()) - - def test_wcet_analyzer(self): - analyzer = self.create_analyzer() - analyzer.create_dag() - - basis_paths = analyzer.generate_basis_paths() - self.assertIsNotNone(basis_paths[0], "no paths were found") - # analyzer.measure_basis_paths() - - generated_paths = analyzer.generate_paths() - results = [] - - for i in range(len(generated_paths)): - output_name: str = f'path{i}' - p = generated_paths[i] - value = analyzer.measure_path(p, output_name) - results.append(f"{p.name}: {value}") - - for p in basis_paths: - print(f"basis path: {p.name} {p.get_measured_value()}") - - print(results) - -##### Backend classes -class TestFlexpretBackend(BaseTest): - backend_value = "flexpret" -class TestX86Backend(BaseTest): - backend_value = "x86" -class TestARMBackend(BaseTest): - backend_value = "arm" - - -#### Benchmarks -class TestIfElifElseFlexpret(TestFlexpretBackend): - config_path = "./programs/if_elif_else/config.yaml" -class TestIfElifElseX86(TestX86Backend): - config_path = "./programs/if_elif_else/config.yaml" -class TestIfElifElseARM(TestARMBackend): - config_path = "./programs/if_elif_else/config.yaml" - - - -class TestBitcnt2Flexpret(TestFlexpretBackend): - config_path = "./programs/bitcount/config.yaml" -class TestBitcnt2X86(TestX86Backend): - config_path = "./programs/bitcount/config.yaml" -class TestBitcnt2ARM(TestARMBackend): - config_path = "./programs/bitcount/config.yaml" - - - -class TestPrimeFlexpret(TestFlexpretBackend): - config_path = "./programs/prime/config.yaml" -class TestPrimeX86(TestX86Backend): - config_path = "./programs/prime/config.yaml" -class TestPrimeARM(TestARMBackend): - config_path = "./programs/prime/config.yaml" - - - -class TestModexpFlexpret(TestFlexpretBackend): - config_path = "./programs/modexp/config.yaml" -class TestModexpX86(TestX86Backend): - config_path = "./programs/modexp/config.yaml" -class TestModexpARM(TestARMBackend): - config_path = "./programs/modexp/config.yaml" - - -class TestBinarysearchFlexpret(TestFlexpretBackend): - config_path = "./programs/binarysearch/config.yaml" -class TestBinarysearchX86(TestX86Backend): - config_path = "./programs/binarysearch/config.yaml" -class TestBinarysearchARM(TestARMBackend): - config_path = "./programs/binarysearch/config.yaml" - - -class TestCountNegativeFlexpret(TestFlexpretBackend): - config_path = "./programs/countnegative/config.yaml" -class TestCountNegativeX86(TestX86Backend): - config_path = "./programs/countnegative/config.yaml" -class TestCountNegativeARM(TestARMBackend): - config_path = "./programs/countnegative/config.yaml" - -class TestInsertSortFlexpret(TestFlexpretBackend): - config_path = "./programs/insertsort/config.yaml" -class TestInsertSortX86(TestX86Backend): - config_path = "./programs/insertsort/config.yaml" -class TestInsertSortARM(TestARMBackend): - config_path = "./programs/insertsort/config.yaml" - -class TestBSortFlexpret(TestFlexpretBackend): - config_path = "./programs/bsort/config.yaml" - -class TestDeg2RadFlexpret(TestFlexpretBackend): - config_path = "./programs/deg2rad/config.yaml" - - - - - -if __name__ == '__main__': - loader = unittest.TestLoader() - suite = unittest.TestSuite() - - #Programs - suite.addTests(loader.loadTestsFromTestCase(TestIfElifElseFlexpret)) - - # suite.addTests(loader.loadTestsFromTestCase(TestBinarysearchFlexpret)) - # suite.addTests(loader.loadTestsFromTestCase(TestBitcnt2Flexpret)) - # suite.addTests(loader.loadTestsFromTestCase(TestPrimeFlexpret)) - # suite.addTests(loader.loadTestsFromTestCase(TestIfElifElseX86)) - # suite.addTests(loader.loadTestsFromTestCase(TestBinarysearchARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestIfElifElseARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestBitcnt2ARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestPrimeARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestCountNegativeARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestModexpARM)) - # suite.addTests(loader.loadTestsFromTestCase(TestInsertSortARM)) - - runner = unittest.TextTestRunner() - runner.run(suite)