[rtems-central commit] spec: Test CPU performance
Sebastian Huber
sebh at rtems.org
Thu Oct 12 14:23:57 UTC 2023
Module: rtems-central
Branch: master
Commit: 33c6f3378dbbf5274e0c7f006e85933b20625d9e
Changeset: http://git.rtems.org/rtems-central/commit/?id=33c6f3378dbbf5274e0c7f006e85933b20625d9e
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Sep 29 21:57:52 2023 +0200
spec: Test CPU performance
Measure the runtime of 1000 no-operation instructions. This may help to
investigate runtime measurement variations which do not result from code
generation or source code changes.
The runtime measurement of a function which does nothing and just
returns gives an estimate of the measurement overhead.
---
spec/score/cpu/req/perf-empty.yml | 37 +++++++++++++++++++++++++
spec/score/cpu/req/perf-nops.yml | 55 +++++++++++++++++++++++++++++++++++++
spec/score/cpu/req/perf-runtime.yml | 16 +++++++++++
spec/score/cpu/val/perf.yml | 26 ++++++++++++++++++
4 files changed, 134 insertions(+)
diff --git a/spec/score/cpu/req/perf-empty.yml b/spec/score/cpu/req/perf-empty.yml
new file mode 100644
index 00000000..d8707edf
--- /dev/null
+++ b/spec/score/cpu/req/perf-empty.yml
@@ -0,0 +1,37 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2023 embedded brains GmbH & Co. KG
+enabled-by: true
+links:
+- role: requirement-refinement
+ uid: perf-runtime
+- role: runtime-measurement-request
+ uid: ../val/perf
+non-functional-type: performance-runtime
+params: {}
+rationale: |
+ The runtime measurement of a function which does nothing and just returns
+ gives an estimate of the measurement overhead.
+references: []
+requirement-type: non-functional
+test-body:
+ brief: |
+ Do nothing and just return.
+ code: |
+ /* No code */
+ description: null
+test-cleanup: null
+test-prepare: null
+test-setup: null
+test-teardown:
+ brief: |
+ Discard samples interrupted by a clock tick.
+ code: |
+ return tic == toc;
+ description: null
+text: |
+ While the execution environment is ${.:/environment}, while the measurement
+ sample is a function which just returns and does nothing else, when exactly
+ ${../val/perf:/params/sample-count} samples are collected, the
+ ${.:/limit-kind} shall be ${.:/limit-condition}.
+type: requirement
diff --git a/spec/score/cpu/req/perf-nops.yml b/spec/score/cpu/req/perf-nops.yml
new file mode 100644
index 00000000..8cecf5e2
--- /dev/null
+++ b/spec/score/cpu/req/perf-nops.yml
@@ -0,0 +1,55 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2023 embedded brains GmbH & Co. KG
+enabled-by: true
+links:
+- role: requirement-refinement
+ uid: perf-runtime
+- role: runtime-measurement-request
+ uid: ../val/perf
+non-functional-type: performance-runtime
+params: {}
+rationale: |
+ The runtime measurement of a fixed number of no-operation instructions may
+ help to investigate runtime measurement variations which do not result from
+ code generation or source code changes.
+references: []
+requirement-type: non-functional
+test-body:
+ brief: |
+ Execute exactly 1000 no-operation instructions.
+ code: |
+ #define NOPS_10 \
+ _CPU_Instruction_no_operation(); _CPU_Instruction_no_operation(); \
+ _CPU_Instruction_no_operation(); _CPU_Instruction_no_operation(); \
+ _CPU_Instruction_no_operation(); _CPU_Instruction_no_operation(); \
+ _CPU_Instruction_no_operation(); _CPU_Instruction_no_operation(); \
+ _CPU_Instruction_no_operation(); _CPU_Instruction_no_operation();
+ #define NOPS_100 NOPS_10 NOPS_10 NOPS_10 NOPS_10 NOPS_10 NOPS_10 NOPS_10 \
+ NOPS_10 NOPS_10 NOPS_10
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ NOPS_100
+ description: null
+test-cleanup: null
+test-prepare: null
+test-setup: null
+test-teardown:
+ brief: |
+ Discard samples interrupted by a clock tick.
+ code: |
+ return tic == toc;
+ description: null
+text: |
+ While the execution environment is ${.:/environment}, while the measurement
+ sample is the runtime of exactly 1000 no-operation instructions, when exactly
+ ${../val/perf:/params/sample-count} samples are collected, the
+ ${.:/limit-kind} shall be ${.:/limit-condition}.
+type: requirement
diff --git a/spec/score/cpu/req/perf-runtime.yml b/spec/score/cpu/req/perf-runtime.yml
new file mode 100644
index 00000000..7046881a
--- /dev/null
+++ b/spec/score/cpu/req/perf-runtime.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2023 embedded brains GmbH & Co. KG
+enabled-by: true
+links:
+- role: requirement-refinement
+ uid: /req/perf-runtime
+- role: requirement-refinement
+ uid: ../if/group
+non-functional-type: performance
+rationale: null
+references: []
+requirement-type: non-functional
+text: |
+ The runtime of CPU port interfaces shall be measured.
+type: requirement
diff --git a/spec/score/cpu/val/perf.yml b/spec/score/cpu/val/perf.yml
new file mode 100644
index 00000000..c42f0b0f
--- /dev/null
+++ b/spec/score/cpu/val/perf.yml
@@ -0,0 +1,26 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2023 embedded brains GmbH & Co. KG
+enabled-by: true
+links:
+- role: validation
+ uid: /req/perf-runtime
+params:
+ sample-count: 100
+test-brief: |
+ This test case provides a context to run CPU port performance tests.
+test-cleanup: null
+test-context: []
+test-context-support: null
+test-description: null
+test-includes:
+- rtems/score/cpuimpl.h
+test-local-includes:
+- tx-support.h
+test-prepare: null
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-cpu-performance.c
+test-teardown: null
+type: runtime-measurement-test
More information about the vc
mailing list