From 15404c5c8e2f40f0116b800e70b5f33cc2e128ba Mon Sep 17 00:00:00 2001 From: Chykon <82272369+chykon@users.noreply.github.com> Date: Thu, 30 Mar 2023 03:42:06 +0300 Subject: [PATCH] Minor improvements to benchmark files (#325) --- benchmark/BENCHMARKING.md | 19 ------------------ benchmark/README.md | 19 ++++++++++++++++++ benchmark/benchmark.dart | 17 ++++++++-------- benchmark/byte_enable_benchmark.dart | 26 +++++++++++-------------- benchmark/logic_value_of_benchmark.dart | 24 ++++++++++------------- benchmark/pipeline_benchmark.dart | 19 +++++++++--------- benchmark/wave_dump_benchmark.dart | 17 ++++++++-------- 7 files changed, 65 insertions(+), 76 deletions(-) delete mode 100644 benchmark/BENCHMARKING.md create mode 100644 benchmark/README.md diff --git a/benchmark/BENCHMARKING.md b/benchmark/BENCHMARKING.md deleted file mode 100644 index 52fe5fa12..000000000 --- a/benchmark/BENCHMARKING.md +++ /dev/null @@ -1,19 +0,0 @@ -Benchmarking in ROHD -==================== - -This folder contains some benchmarking related code for estimating relative performance of certain ROHD features. It can be used to help judge the relative performance impact with and without a change in ROHD. Benchmarks can be microbenchmarks for a specific feature, larger benchmarks for estimating performance on more realistic designs, or comparison benchmarks for similar applications relative to other frameworks and simulators. - -To run all benchmarks, execute the below command: - -```shell -dart run benchmark/benchmark.dart -``` - -You can run this command (or specific benchmarks) before and after a change to get a feel if any performance covered by these benchmarks has been impacted. - ----------------- -2022 September 28 -Author: Max Korbel <> - -Copyright (C) 2022 Intel Corporation -SPDX-License-Identifier: BSD-3-Clause diff --git a/benchmark/README.md b/benchmark/README.md new file mode 100644 index 000000000..28507734f --- /dev/null +++ b/benchmark/README.md @@ -0,0 +1,19 @@ +Benchmarking in ROHD +==================== + +This folder contains some benchmarking related code for estimating relative performance of certain ROHD features. It can be used to help judge the relative performance impact with and without a change in ROHD. Benchmarks can be microbenchmarks for a specific feature, larger benchmarks for estimating performance on more realistic designs, or comparison benchmarks for similar applications relative to other frameworks and simulators. + +To run all benchmarks, execute the below command: + +```shell +dart run benchmark/benchmark.dart +``` + +You can run this command (or specific benchmarks) before and after a change to get a feel if any performance covered by these benchmarks has been impacted. + +----------------------------------------- +Copyright (C) 2022-2023 Intel Corporation \ +SPDX-License-Identifier: BSD-3-Clause + +2022 September 28 \ +Author: Max Korbel <> diff --git a/benchmark/benchmark.dart b/benchmark/benchmark.dart index d1877d11e..c451d236f 100644 --- a/benchmark/benchmark.dart +++ b/benchmark/benchmark.dart @@ -1,12 +1,11 @@ -/// Copyright (C) 2022 Intel Corporation -/// SPDX-License-Identifier: BSD-3-Clause -/// -/// benchmark.dart -/// Runs benchmarks and prints values. -/// -/// 2022 September 28 -/// Author: Max Korbel -/// +// Copyright (C) 2022-2023 Intel Corporation +// SPDX-License-Identifier: BSD-3-Clause +// +// benchmark.dart +// Runs benchmarks and prints values. +// +// 2022 September 28 +// Author: Max Korbel import 'byte_enable_benchmark.dart'; import 'logic_value_of_benchmark.dart'; diff --git a/benchmark/byte_enable_benchmark.dart b/benchmark/byte_enable_benchmark.dart index 10a2c85bf..6869730d0 100644 --- a/benchmark/byte_enable_benchmark.dart +++ b/benchmark/byte_enable_benchmark.dart @@ -1,20 +1,19 @@ -/// Copyright (C) 2022 Intel Corporation -/// SPDX-License-Identifier: BSD-3-Clause -/// -/// byte_enable_benchmark.dart -/// Benchmarking for simple byte enable hardware -/// -/// 2022 December 2 -/// Author: Max Korbel -/// +// Copyright (C) 2022-2023 Intel Corporation +// SPDX-License-Identifier: BSD-3-Clause +// +// byte_enable_benchmark.dart +// Benchmarking for simple byte enable hardware +// +// 2022 December 2 +// Author: Max Korbel import 'package:benchmark_harness/benchmark_harness.dart'; import 'package:rohd/rohd.dart'; class ByteEnableBenchmark extends BenchmarkBase { - late Logic result; - late Logic select; - late Logic original; + late final Logic result; + late final Logic select; + late final Logic original; static const int numBytes = 128; @@ -40,9 +39,6 @@ class ByteEnableBenchmark extends BenchmarkBase { )).swizzle(); } - @override - void teardown() {} - @override void run() { vectors.forEach(select.put); diff --git a/benchmark/logic_value_of_benchmark.dart b/benchmark/logic_value_of_benchmark.dart index 9d7e57e14..8041ce075 100644 --- a/benchmark/logic_value_of_benchmark.dart +++ b/benchmark/logic_value_of_benchmark.dart @@ -1,12 +1,11 @@ -/// Copyright (C) 2022 Intel Corporation -/// SPDX-License-Identifier: BSD-3-Clause -/// -/// logic_value_of_benchmark.dart -/// Benchmarking for concatenation of values together into one. -/// -/// 2022 December 1 -/// Author: Max Korbel -/// +// Copyright (C) 2022-2023 Intel Corporation +// SPDX-License-Identifier: BSD-3-Clause +// +// logic_value_of_benchmark.dart +// Benchmarking for concatenation of values together into one. +// +// 2022 December 1 +// Author: Max Korbel import 'dart:math'; @@ -14,7 +13,7 @@ import 'package:benchmark_harness/benchmark_harness.dart'; import 'package:rohd/rohd.dart'; class LogicValueOfBenchmark extends BenchmarkBase { - late List toOf; + late final List toOf; LogicValueOfBenchmark() : super('LogicValueOf'); @@ -32,15 +31,12 @@ class LogicValueOfBenchmark extends BenchmarkBase { .join())); } - @override - void teardown() {} - @override void run() { LogicValue.of(toOf); } } -void main() async { +void main() { LogicValueOfBenchmark().report(); } diff --git a/benchmark/pipeline_benchmark.dart b/benchmark/pipeline_benchmark.dart index 457e9a29b..fc7fe9f8d 100644 --- a/benchmark/pipeline_benchmark.dart +++ b/benchmark/pipeline_benchmark.dart @@ -1,12 +1,11 @@ -/// Copyright (C) 2022 Intel Corporation -/// SPDX-License-Identifier: BSD-3-Clause -/// -/// pipeline_benchmark.dart -/// Benchmarking for pipeline simulation performance -/// -/// 2022 September 28 -/// Author: Max Korbel -/// +// Copyright (C) 2022-2023 Intel Corporation +// SPDX-License-Identifier: BSD-3-Clause +// +// pipeline_benchmark.dart +// Benchmarking for pipeline simulation performance +// +// 2022 September 28 +// Author: Max Korbel import 'package:benchmark_harness/benchmark_harness.dart'; import 'package:rohd/rohd.dart'; @@ -14,7 +13,7 @@ import 'package:rohd/src/utilities/simcompare.dart'; import '../test/pipeline_test.dart'; class PipelineBenchmark extends AsyncBenchmarkBase { - late RVPipelineModule _rvPipelineModule; + late final RVPipelineModule _rvPipelineModule; PipelineBenchmark() : super('Pipeline'); diff --git a/benchmark/wave_dump_benchmark.dart b/benchmark/wave_dump_benchmark.dart index 2d646f283..777b42eb0 100644 --- a/benchmark/wave_dump_benchmark.dart +++ b/benchmark/wave_dump_benchmark.dart @@ -1,12 +1,11 @@ -/// Copyright (C) 2023 Intel Corporation -/// SPDX-License-Identifier: BSD-3-Clause -/// -/// wave_dump_benchmark.dart -/// Benchmarking for wave dumping -/// -/// 2023 January 5 -/// Author: Max Korbel -/// +// Copyright (C) 2023 Intel Corporation +// SPDX-License-Identifier: BSD-3-Clause +// +// wave_dump_benchmark.dart +// Benchmarking for wave dumping +// +// 2023 January 5 +// Author: Max Korbel import 'dart:io';