1 | SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause |
---|
2 | copyrights: |
---|
3 | - Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de) |
---|
4 | enabled-by: RTEMS_SMP |
---|
5 | limits: {} |
---|
6 | links: |
---|
7 | - role: requirement-refinement |
---|
8 | uid: perf-runtime |
---|
9 | - role: runtime-measurement-request |
---|
10 | uid: ../val/perf |
---|
11 | non-functional-type: performance-runtime |
---|
12 | params: {} |
---|
13 | rationale: null |
---|
14 | references: [] |
---|
15 | requirement-type: non-functional |
---|
16 | test-body: |
---|
17 | brief: | |
---|
18 | Automatically release the barrier. |
---|
19 | code: | |
---|
20 | ctx->begin = T_tick(); |
---|
21 | ctx->status = rtems_barrier_wait( ctx->barrier_id, RTEMS_NO_TIMEOUT ); |
---|
22 | description: null |
---|
23 | test-cleanup: |
---|
24 | brief: | |
---|
25 | Delete the barrier and the worker. |
---|
26 | code: | |
---|
27 | rtems_status_code sc; |
---|
28 | |
---|
29 | DeleteTask( ctx->worker_id ); |
---|
30 | |
---|
31 | sc = rtems_barrier_delete( ctx->barrier_id ); |
---|
32 | T_rsc_success( sc ); |
---|
33 | description: null |
---|
34 | test-prepare: |
---|
35 | brief: | |
---|
36 | Create an automatic release barrier. Create and start a worker task. |
---|
37 | code: | |
---|
38 | rtems_status_code sc; |
---|
39 | |
---|
40 | sc = rtems_barrier_create( |
---|
41 | OBJECT_NAME, |
---|
42 | RTEMS_BARRIER_AUTOMATIC_RELEASE, |
---|
43 | 2, |
---|
44 | &ctx->barrier_id |
---|
45 | ); |
---|
46 | T_rsc_success( sc ); |
---|
47 | |
---|
48 | ctx->worker_id = CreateTask( "WORK", PRIO_NORMAL ); |
---|
49 | SetScheduler( ctx->worker_id, SCHEDULER_B_ID, PRIO_NORMAL ); |
---|
50 | StartTask( ctx->worker_id, BarrierWaitWorker, ctx ); |
---|
51 | WaitForNextTask( 1, ctx->worker_id ); |
---|
52 | description: null |
---|
53 | test-setup: null |
---|
54 | test-teardown: |
---|
55 | brief: | |
---|
56 | Make sure the worker waits for the next event. Set the measured runtime. |
---|
57 | Discard samples interrupted by a clock tick. |
---|
58 | code: | |
---|
59 | T_quiet_rsc_success( ctx->status ); |
---|
60 | |
---|
61 | WaitForNextTask( 1, ctx->worker_id ); |
---|
62 | *delta = ctx->end - ctx->begin; |
---|
63 | |
---|
64 | return tic == toc; |
---|
65 | description: null |
---|
66 | text: | |
---|
67 | Let ``U` and `V`` be two tasks with distinct home schedulers. Let :math:`B` |
---|
68 | be a time point measured by ``U`` right before a call to ${../if/wait:/name} |
---|
69 | which automaticall releases the barrier. Let :math:`E` be a time point |
---|
70 | measured by ``V`` right after a call to ${../if/wait:/name} returns |
---|
71 | successfully due to the ${../if/wait:/name} call associated with :math:`B`. |
---|
72 | While the execution environment is ${.:/environment}, while the barrier is an |
---|
73 | automatic release barrier, while the measurement sample is :math:`E - B`, |
---|
74 | when exactly ${../val/perf:/params/sample-count} samples are collected, the |
---|
75 | ${.:/limit-kind} shall be ${.:/limit-condition}. |
---|
76 | type: requirement |
---|