[rtems-central commit] spec: Specify SMP system initialization

Sebastian Huber sebh at rtems.org
Fri Aug 6 12:21:44 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    022af245fff77e2f09655388a535b6ec76095ce6
Changeset: http://git.rtems.org/rtems-central/commit/?id=022af245fff77e2f09655388a535b6ec76095ce6

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Aug  4 07:51:25 2021 +0200

spec: Specify SMP system initialization

---

 .../fatal-start-of-mandatory-processor-failed.yml  |  6 +--
 spec/score/smp/req/processor-online.yml            | 14 ++++++
 ...start-of-optional-processor-failed-continue.yml | 16 +++++++
 .../req/start-of-processor-failed-not-online.yml   | 14 ++++++
 .../smp/val/start-of-optional-processor-failed.yml | 51 ++++++++++++++++++++++
 ...tion-smp-only.yml => validation-smp-only-0.yml} |  4 +-
 spec/testsuites/validation-smp-only-1.yml          | 41 +++++++++++++++++
 spec/testsuites/validation-smp-only-2.yml          | 49 +++++++++++++++++++++
 8 files changed, 190 insertions(+), 5 deletions(-)

diff --git a/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml b/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml
index 45522e6..ad8e5d2 100644
--- a/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml
+++ b/spec/score/smp/req/fatal-start-of-mandatory-processor-failed.yml
@@ -12,8 +12,8 @@ rationale: null
 references: []
 requirement-type: functional
 text: |
-  While the system is initialized, if the processor receives an SMP shutdown
-  request message, then the system shall terminate with the
-  ${/score/interr/if/source-smp:/name} fatal source and the
+  While the system is initialized, if the start of a mandatory processor
+  defined by the application configuration fails, then the system shall
+  terminate with the ${/score/interr/if/source-smp:/name} fatal source and the
   ${../if/fatal-start-of-mandatory-processor-failed:/name} fatal code.
 type: requirement
diff --git a/spec/score/smp/req/processor-online.yml b/spec/score/smp/req/processor-online.yml
new file mode 100644
index 0000000..6df540f
--- /dev/null
+++ b/spec/score/smp/req/processor-online.yml
@@ -0,0 +1,14 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Processors which were successfully started shall be marked as online.
+type: requirement
diff --git a/spec/score/smp/req/start-of-optional-processor-failed-continue.yml b/spec/score/smp/req/start-of-optional-processor-failed-continue.yml
new file mode 100644
index 0000000..623dd12
--- /dev/null
+++ b/spec/score/smp/req/start-of-optional-processor-failed-continue.yml
@@ -0,0 +1,16 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  While the system is initialized, if the start of an optional processor
+  defined by the application configuration fails, then the system
+  initialization shall continue.
+type: requirement
diff --git a/spec/score/smp/req/start-of-processor-failed-not-online.yml b/spec/score/smp/req/start-of-processor-failed-not-online.yml
new file mode 100644
index 0000000..5b7019d
--- /dev/null
+++ b/spec/score/smp/req/start-of-processor-failed-not-online.yml
@@ -0,0 +1,14 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: ../if/group
+functional-type: function
+rationale: null
+references: []
+requirement-type: functional
+text: |
+  Processors which failed to start shall not be marked as online.
+type: requirement
diff --git a/spec/score/smp/val/start-of-optional-processor-failed.yml b/spec/score/smp/val/start-of-optional-processor-failed.yml
new file mode 100644
index 0000000..fad48b9
--- /dev/null
+++ b/spec/score/smp/val/start-of-optional-processor-failed.yml
@@ -0,0 +1,51 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links: []
+test-actions:
+- action-brief: |
+    The test action was carried by the system initialization.  If we execute
+    this test case, then the failed start of an optional processor did not
+    abort the system initialization.
+  action-code: |
+    /* Nothing to do */
+  checks:
+  - brief: |
+      Check that the boot processor is online.
+    code: |
+      T_step_true(
+        ${step},
+        _Per_CPU_Is_processor_online( _Per_CPU_Get_by_index( 0 ) )
+      );
+    links:
+    - role: validation
+      uid: ../req/processor-online
+  - brief: |
+      Check that the optional processor which failed to start is not online.
+    code: |
+      T_step_false(
+        ${step},
+        _Per_CPU_Is_processor_online( _Per_CPU_Get_by_index( 1 ) )
+      );
+    links:
+    - role: validation
+      uid: ../req/start-of-processor-failed-not-online
+  links:
+  - role: validation
+    uid: ../req/start-of-optional-processor-failed-continue
+test-brief: |
+  Tests the state of an optional processor which failed to start.
+test-context: []
+test-context-support: null
+test-description: null
+test-header: null
+test-includes:
+- rtems/score/percpu.h
+test-local-includes: []
+test-setup: null
+test-stop: null
+test-support: null
+test-target: testsuites/validation/tc-start-of-optional-processor-failed.c
+test-teardown: null
+type: test-case
diff --git a/spec/testsuites/validation-smp-only.yml b/spec/testsuites/validation-smp-only-0.yml
similarity index 87%
rename from spec/testsuites/validation-smp-only.yml
rename to spec/testsuites/validation-smp-only-0.yml
index a0faf2f..6d74490 100644
--- a/spec/testsuites/validation-smp-only.yml
+++ b/spec/testsuites/validation-smp-only-0.yml
@@ -19,6 +19,6 @@ test-description: |
   using up to four processors.
 test-includes: []
 test-local-includes: []
-test-suite-name: ValidationSMPOnly
-test-target: testsuites/validation/ts-validation-smp-only.c
+test-suite-name: ValidationSMPOnly0
+test-target: testsuites/validation/ts-validation-smp-only-0.c
 type: test-suite
diff --git a/spec/testsuites/validation-smp-only-1.yml b/spec/testsuites/validation-smp-only-1.yml
new file mode 100644
index 0000000..3f8645e
--- /dev/null
+++ b/spec/testsuites/validation-smp-only-1.yml
@@ -0,0 +1,41 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+- role: validation
+  uid: /acfg/if/scheduler-assignments
+test-brief: |
+  This SMP-only test suite validates the clustered scheduler configuration
+  through an application configuration with a processor maximum of two,
+  however, only the first processor has a scheduler assigned.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN_NO_SCHEDULER
+
+  #include "ts-default.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- ts-config.h
+test-suite-name: ValidationSMPOnly1
+test-target: testsuites/validation/ts-validation-smp-only-1.c
+type: test-suite
diff --git a/spec/testsuites/validation-smp-only-2.yml b/spec/testsuites/validation-smp-only-2.yml
new file mode 100644
index 0000000..ebcdc35
--- /dev/null
+++ b/spec/testsuites/validation-smp-only-2.yml
@@ -0,0 +1,49 @@
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
+enabled-by: RTEMS_SMP
+links:
+- role: requirement-refinement
+  uid: /req/test-suites
+- role: validation
+  uid: /acfg/if/scheduler-assignments
+test-brief: |
+  This SMP-only test suite validates the clustered scheduler configuration
+  through an application configuration with a processor maximum of two.  The
+  second processor has a optional scheduler assigned and fails to start.
+test-code: |
+  const char rtems_test_name[] = "${.:/test-suite-name}";
+
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index );
+
+  bool __wrap__CPU_SMP_Start_processor( uint32_t cpu_index )
+  {
+    (void) cpu_index;
+    return false;
+  }
+
+  #define CONFIGURE_MAXIMUM_PROCESSORS 2
+
+  #include <rtems/score/scheduleredfsmp.h>
+
+  #define CONFIGURE_SCHEDULER_EDF_SMP
+
+  #include <rtems/scheduler.h>
+
+  RTEMS_SCHEDULER_EDF_SMP( a );
+
+  #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
+    RTEMS_SCHEDULER_TABLE_EDF_SMP( a, TEST_SCHEDULER_A_NAME )
+
+  #define CONFIGURE_SCHEDULER_ASSIGNMENTS \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_MANDATORY ), \
+    RTEMS_SCHEDULER_ASSIGN( 0, RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL )
+
+  #include "ts-default.h"
+test-description: null
+test-includes: []
+test-local-includes:
+- ts-config.h
+test-suite-name: ValidationSMPOnly2
+test-target: testsuites/validation/ts-validation-smp-only-2.c
+type: test-suite



More information about the vc mailing list