diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-09-29 21:57:52 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2023-10-12 16:49:15 +0200 |
commit | 33c6f3378dbbf5274e0c7f006e85933b20625d9e (patch) | |
tree | 366e73f675b6b40fb72d29eb2be078d503bed6eb /spec | |
parent | a4161d2ca25c68c3a63aaa91259706d2a4c49235 (diff) |
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.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/score/cpu/req/perf-empty.yml | 37 | ||||
-rw-r--r-- | spec/score/cpu/req/perf-nops.yml | 55 | ||||
-rw-r--r-- | spec/score/cpu/req/perf-runtime.yml | 16 | ||||
-rw-r--r-- | spec/score/cpu/val/perf.yml | 26 |
4 files changed, 134 insertions, 0 deletions
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 |