diff --git a/software/apps/barriers_test/benchmark.sh b/software/apps/barriers_test/benchmark.sh deleted file mode 100644 index a51100214..000000000 --- a/software/apps/barriers_test/benchmark.sh +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2022 ETH Zurich and University of Bologna. -# Licensed under the Apache License, Version 2.0, see LICENSE for details. -# SPDX-License-Identifier: Apache-2.0 - -# Author: Marco Bertuletti, ETH Zurich - -#!/bin/bash -# Benchmark shell script - -APP="barriers_test" -DIR=$(dirname $(realpath “${BASH_SOURCE:-$0}”)) -APP_DIR="$DIR/.." -HW_DIR="$DIR/../../../hardware" - -echo $APP_DIR -echo $HW_DIR - -N_CORES=256 -N_ITR=10 - - -for max_delay in 64 128 256 512 -do - - for (( c=1; c<=$N_ITR; c++ )) - do - echo "./data_barriers_test.py" -m ${max_delay} -n ${num_cores} - "./data_barriers_test.py" -m ${max_delay} -n ${num_cores} - make $APP -C $APP_DIR - app=$APP make buildpath=build_barriers_test simcvcs -C $HW_DIR - make buildpath=build_barriers_test resultpath=results_barriers_test trace -C $HW_DIR - done - -done diff --git a/software/apps/barriers_test/data_barriers_test.h b/software/apps/barriers_test/data_barriers_test.h deleted file mode 100644 index c5fa60839..000000000 --- a/software/apps/barriers_test/data_barriers_test.h +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright 2022 ETH Zurich and University of Bologna. -// Licensed under the Apache License, Version 2.0, see LICENSE for details. -// SPDX-License-Identifier: Apache-2.0 - -uint32_t core_delays[1024] = { - 381, 327, 268, 849, 487, 748, 878, 412, 860, 889, 338, 310, 90, - 479, 497, 422, 871, 834, 532, 785, 51, 824, 682, 137, 198, 183, - 981, 17, 946, 59, 1, 859, 774, 70, 25, 484, 19, 364, 628, - 172, 275, 24, 791, 67, 376, 621, 726, 994, 737, 279, 602, 461, - 891, 389, 1017, 757, 973, 61, 505, 825, 727, 565, 251, 524, 436, - 30, 63, 216, 520, 88, 157, 324, 553, 594, 746, 749, 419, 715, - 985, 305, 969, 619, 420, 58, 1010, 524, 801, 923, 352, 56, 762, - 905, 735, 583, 56, 175, 672, 540, 665, 316, 550, 43, 758, 114, - 198, 809, 891, 326, 200, 747, 381, 462, 615, 976, 335, 587, 207, - 873, 913, 826, 522, 722, 764, 118, 606, 105, 1011, 374, 284, 847, - 766, 824, 171, 653, 925, 822, 176, 665, 407, 40, 128, 483, 20, - 290, 863, 378, 25, 277, 485, 578, 297, 723, 334, 567, 82, 209, - 115, 451, 468, 272, 135, 98, 307, 632, 147, 693, 231, 415, 772, - 273, 350, 424, 837, 663, 170, 954, 654, 169, 845, 76, 152, 492, - 88, 169, 529, 257, 890, 672, 569, 118, 885, 586, 232, 108, 942, - 849, 134, 775, 857, 747, 778, 507, 468, 266, 491, 455, 1023, 812, - 580, 737, 416, 474, 896, 829, 136, 836, 926, 470, 567, 419, 543, - 928, 691, 270, 384, 567, 401, 222, 279, 482, 814, 401, 13, 172, - 263, 188, 706, 413, 671, 433, 574, 648, 283, 885, 287, 698, 165, - 274, 220, 329, 989, 708, 355, 697, 427, 432, 838, 838, 527, 697, - 218, 167, 230, 816, 775, 479, 158, 162, 925, 580, 781, 450, 690, - 476, 292, 793, 624, 112, 553, 410, 953, 707, 608, 365, 691, 939, - 196, 801, 699, 180, 758, 457, 485, 882, 278, 142, 988, 867, 593, - 500, 816, 656, 36, 659, 464, 57, 192, 399, 305, 162, 305, 253, - 181, 325, 523, 18, 821, 171, 932, 982, 253, 313, 545, 514, 466, - 943, 892, 618, 765, 710, 35, 539, 253, 853, 907, 871, 609, 200, - 20, 743, 780, 732, 5, 616, 285, 484, 786, 227, 842, 990, 688, - 731, 660, 578, 707, 9, 936, 248, 218, 421, 828, 567, 768, 527, - 836, 805, 853, 836, 218, 88, 511, 764, 874, 644, 396, 213, 870, - 769, 221, 232, 744, 950, 21, 275, 528, 919, 620, 529, 712, 799, - 0, 713, 30, 403, 841, 257, 342, 58, 794, 882, 1014, 8, 406, - 737, 556, 173, 498, 726, 429, 426, 343, 520, 731, 1021, 89, 487, - 533, 300, 347, 246, 328, 234, 279, 953, 911, 408, 651, 571, 48, - 166, 36, 577, 80, 136, 69, 730, 507, 442, 502, 565, 953, 858, - 507, 511, 334, 619, 367, 305, 608, 568, 166, 608, 249, 383, 24, - 785, 722, 633, 31, 229, 949, 582, 897, 147, 295, 390, 242, 220, - 294, 68, 893, 321, 374, 336, 919, 262, 910, 603, 956, 105, 650, - 237, 151, 624, 421, 250, 695, 565, 770, 765, 765, 372, 836, 850, - 207, 612, 124, 662, 716, 745, 720, 1018, 272, 209, 100, 685, 198, - 729, 849, 461, 142, 1005, 416, 752, 100, 754, 971, 298, 363, 308, - 64, 390, 888, 593, 599, 97, 388, 746, 259, 428, 745, 939, 124, - 853, 98, 825, 229, 254, 233, 103, 499, 270, 628, 161, 369, 140, - 33, 615, 33, 646, 52, 505, 529, 1023, 734, 940, 992, 396, 43, - 463, 27, 416, 760, 90, 145, 876, 343, 650, 971, 150, 827, 930, - 897, 419, 666, 83, 1019, 81, 553, 108, 513, 634, 839, 882, 692, - 485, 550, 995, 864, 243, 258, 461, 968, 257, 154, 211, 406, 414, - 198, 823, 570, 256, 490, 137, 1018, 321, 456, 269, 79, 986, 794, - 265, 454, 749, 36, 888, 758, 18, 890, 993, 831, 438, 320, 110, - 398, 253, 944, 986, 696, 315, 491, 46, 979, 808, 466, 985, 486, - 267, 117, 1021, 557, 856, 178, 326, 952, 391, 1, 670, 636, 992, - 773, 483, 366, 765, 344, 737, 194, 1011, 521, 947, 63, 526, 535, - 516, 216, 134, 938, 74, 345, 864, 880, 576, 584, 525, 797, 759, - 27, 467, 622, 741, 545, 225, 34, 908, 403, 244, 997, 827, 81, - 717, 436, 906, 264, 27, 400, 968, 532, 365, 554, 228, 271, 944, - 774, 202, 138, 491, 34, 807, 53, 323, 785, 157, 144, 261, 613, - 444, 148, 482, 76, 372, 493, 634, 428, 756, 885, 229, 436, 855, - 256, 811, 146, 23, 542, 575, 921, 778, 669, 154, 913, 396, 377, - 290, 325, 532, 518, 406, 861, 204, 594, 64, 261, 369, 925, 531, - 1007, 666, 94, 323, 253, 330, 853, 932, 651, 404, 310, 477, 353, - 903, 339, 573, 210, 423, 548, 563, 285, 417, 972, 437, 87, 720, - 502, 585, 585, 366, 224, 737, 293, 672, 385, 289, 657, 259, 302, - 830, 788, 512, 248, 997, 655, 119, 699, 573, 266, 688, 343, 67, - 906, 438, 49, 701, 480, 928, 954, 1, 239, 350, 924, 808, 547, - 278, 131, 754, 924, 13, 32, 645, 272, 304, 743, 517, 473, 1014, - 592, 616, 434, 50, 200, 103, 563, 680, 274, 535, 271, 726, 270, - 72, 237, 450, 929, 396, 82, 404, 868, 709, 497, 954, 400, 996, - 506, 626, 236, 713, 927, 385, 278, 399, 898, 230, 625, 749, 620, - 827, 908, 541, 523, 759, 143, 436, 152, 611, 693, 576, 893, 245, - 462, 396, 297, 566, 774, 176, 393, 948, 1, 173, 313, 577, 963, - 942, 748, 845, 261, 189, 443, 1005, 910, 786, 993, 256, 972, 509, - 387, 996, 13, 106, 348, 780, 323, 330, 454, 674, 51, 706, 135, - 49, 618, 77, 472, 70, 156, 228, 583, 557, 525, 123, 951, 515, - 573, 309, 509, 899, 935, 728, 744, 831, 83, 414, 319, 447, 825, - 194, 662, 213, 36, 94, 860, 776, 477, 275, 244, 765, 518, 748, - 318, 165, 132, 750, 885, 699, 807, 453, 824, 438, 305, 373, 645, - 1017, 276, 151, 538, 959, 285, 14, 798, 794, 770, 853, 234, 274, - 468, 107, 268, 1, 730, 464, 249, 980, 19, 162, 923, 936, 150, - 549, 976, 645, 438, 63, 440, 61, 106, 804, 808, 542, 353, 955, - 645, 210, 1015, 107, 171, 860, 784, 54, 745, 626, -}; diff --git a/software/apps/barriers_test/data_barriers_test.h.tpl b/software/data/data_barriers_test.h.tpl similarity index 100% rename from software/apps/barriers_test/data_barriers_test.h.tpl rename to software/data/data_barriers_test.h.tpl diff --git a/software/apps/barriers_test/data_barriers_test.py b/software/data/data_barriers_test.py similarity index 58% rename from software/apps/barriers_test/data_barriers_test.py rename to software/data/data_barriers_test.py index 190f03eea..d5b62550c 100755 --- a/software/apps/barriers_test/data_barriers_test.py +++ b/software/data/data_barriers_test.py @@ -32,7 +32,7 @@ def main(): "-o", "--outdir", type=pathlib.Path, - default=pathlib.Path.cwd(), + default=pathlib.Path(__file__).parent.absolute(), required=False, help='Select out directory of generated data files' ) @@ -41,7 +41,8 @@ def main(): "--tpl", type=pathlib.Path, required=False, - default=pathlib.Path.cwd() / "data_barriers_test.h.tpl", + default=pathlib.Path(__file__).parent.absolute() + / "data_barriers_test.h.tpl", help='Path to mako template' ) parser.add_argument( @@ -50,53 +51,27 @@ def main(): action='store_true', help='Set verbose' ) - parser.add_argument( - "-n", - "--num_cores", - type=int, - required=False, - default=1024, - help='Number of cores.' - ) - parser.add_argument( - "-a", - "--a_par", - type=float, - required=False, - default=0.5, - help='Number of cores.' - ) - parser.add_argument( - "-d", - "--d_par", - type=int, - required=False, - default=1, - help='Number of cores.' - ) - parser.add_argument( - "-m", - "--max", - type=int, - required=False, - default=1024, - help='Max delay.' - ) + parser.add_argument("delay_distribution", nargs='?', type=str, default='uniform') + parser.add_argument("-n", "--num_cores", type=int, required=False, default=1024, help='Number of cores.') + parser.add_argument("-a", type=float, required=False, default=0.5, help='Weybull a.') + parser.add_argument("-d", type=int, required=False, default=1, help='Weybull d.') + parser.add_argument("-m", "--max", type=int, required=False, default=1024, help='Max delay.') args = parser.parse_args() num_cores = args.num_cores - # Weybull distribution - # a = args.a_par - # D = args.d_par - # delays = D * np.random.weibull(a, size=num_cores) - # delays = np.asarray(delays, dtype = 'int') - - # Uniform - max_delay = args.max - delays = np.random.uniform(low=0.0, high=max_delay, size=num_cores) - delays = np.asarray(delays, dtype='int') + if args.delay_distribution == 'weybull': + # Weybull distribution + a = args.a_par + D = args.d_par + delays = D * np.random.weibull(a, size=num_cores) + delays = np.asarray(delays, dtype = 'int') + else: + # Uniform + max_delay = args.max + delays = np.random.uniform(low=0.0, high=max_delay, size=num_cores) + delays = np.asarray(delays, dtype='int') kwargs = { 'name': 'barriers_test', diff --git a/software/apps/barriers_test/main.c b/software/tests/baremetal/barriers_test/main.c similarity index 100% rename from software/apps/barriers_test/main.c rename to software/tests/baremetal/barriers_test/main.c diff --git a/software/apps/test_stride_wu/main.c b/software/tests/baremetal/test_stride_wu/main.c similarity index 100% rename from software/apps/test_stride_wu/main.c rename to software/tests/baremetal/test_stride_wu/main.c