Skip to content

Commit

Permalink
Minor improvements to benchmark files (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
chykon authored Mar 30, 2023
1 parent 58906cf commit 15404c5
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 76 deletions.
19 changes: 0 additions & 19 deletions benchmark/BENCHMARKING.md

This file was deleted.

19 changes: 19 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -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 <<max.korbel@intel.com>>
17 changes: 8 additions & 9 deletions benchmark/benchmark.dart
Original file line number Diff line number Diff line change
@@ -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 <max.korbel@intel.com>
///
// 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 <max.korbel@intel.com>

import 'byte_enable_benchmark.dart';
import 'logic_value_of_benchmark.dart';
Expand Down
26 changes: 11 additions & 15 deletions benchmark/byte_enable_benchmark.dart
Original file line number Diff line number Diff line change
@@ -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 <max.korbel@intel.com>
///
// 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 <max.korbel@intel.com>

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;

Expand All @@ -40,9 +39,6 @@ class ByteEnableBenchmark extends BenchmarkBase {
)).swizzle();
}

@override
void teardown() {}

@override
void run() {
vectors.forEach(select.put);
Expand Down
24 changes: 10 additions & 14 deletions benchmark/logic_value_of_benchmark.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
/// 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 <max.korbel@intel.com>
///
// 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 <max.korbel@intel.com>

import 'dart:math';

import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:rohd/rohd.dart';

class LogicValueOfBenchmark extends BenchmarkBase {
late List<LogicValue> toOf;
late final List<LogicValue> toOf;

LogicValueOfBenchmark() : super('LogicValueOf');

Expand All @@ -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();
}
19 changes: 9 additions & 10 deletions benchmark/pipeline_benchmark.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
/// 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 <max.korbel@intel.com>
///
// 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 <max.korbel@intel.com>

import 'package:benchmark_harness/benchmark_harness.dart';
import 'package:rohd/rohd.dart';
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');

Expand Down
17 changes: 8 additions & 9 deletions benchmark/wave_dump_benchmark.dart
Original file line number Diff line number Diff line change
@@ -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 <max.korbel@intel.com>
///
// 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 <max.korbel@intel.com>

import 'dart:io';

Expand Down

0 comments on commit 15404c5

Please sign in to comment.