Changeset 87a9478 in rtems-docs


Ignore:
Timestamp:
Jun 17, 2020, 7:06:37 AM (3 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
a517a09
Parents:
db3892b
git-author:
Sebastian Huber <sebastian.huber@…> (06/17/20 07:06:37)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/17/20 07:10:52)
Message:

eng: Clarify action requirement specification

Update #3715.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • eng/req/items.rst

    rdb3892b r87a9478  
    16531653performs a step in a finite state machine.  An action is implemented through a
    16541654function or a macro.  The action is performed through a call of the function or
    1655 an execution of the code of an macro expansion by an actor.  The actor is for
     1655an execution of the code of a macro expansion by an actor.  The actor is for
    16561656example a task or an interrupt service routine.
    16571657
    1658 There shall be exactly one link with the
    1659 :ref:`SpecTypeInterfaceFunctionLinkRole` to the interface of the action.
     1658For action requirements which specify the function of an interface, there
     1659shall be exactly one link with the :ref:`SpecTypeInterfaceFunctionLinkRole`
     1660to the interface of the action.
    16601661
    16611662The action requirements are specified by
     
    17361737    The attribute value shall be a list. Each list element shall be an
    17371738    :ref:`SpecTypeActionRequirementTransition`.
     1739
     1740Please have a look at the following example:
     1741
     1742.. code-block:: yaml
     1743
     1744    SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
     1745    copyrights:
     1746    - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
     1747    enabled-by: true
     1748    functional-type: action
     1749    links: []
     1750    post-conditions:
     1751    - name: Status
     1752      states:
     1753      - name: Success
     1754        test-code: |
     1755          /* Check that the status is SUCCESS */
     1756        text: |
     1757          The status shall be SUCCESS.
     1758      - name: Error
     1759        test-code: |
     1760          /* Check that the status is ERROR */
     1761        text: |
     1762          The status shall be ERROR.
     1763      test-epilogue: null
     1764      test-prologue: null
     1765    - name: Data
     1766      states:
     1767      - name: Unchanged
     1768        test-code: |
     1769          /* Check that the data is unchanged */
     1770        text: |
     1771          The data shall be unchanged by the action.
     1772      - name: Red
     1773        test-code: |
     1774          /* Check that the data is red */
     1775        text: |
     1776          The data shall be red.
     1777      - name: Green
     1778        test-code: |
     1779          /* Check that the data is green */
     1780        text: |
     1781          The data shall be green.
     1782      test-epilogue: null
     1783      test-prologue: null
     1784    pre-conditions:
     1785    - name: Data
     1786      states:
     1787      - name: NullPtr
     1788        test-code: |
     1789          /* Set data pointer to NULL */
     1790        text: |
     1791          The data pointer shall be NULL.
     1792      - name: Valid
     1793        test-code: |
     1794          /* Set data pointer to reference a valid data buffer */
     1795        text: |
     1796          The data pointer shall reference a valid data buffer.
     1797      test-epilogue: null
     1798      test-prologue: null
     1799    - name: Option
     1800      states:
     1801      - name: Red
     1802        test-code: |
     1803          /* Set option to RED */
     1804        text: |
     1805          The option shall be RED.
     1806      - name: Green
     1807        test-code: |
     1808          /* Set option to GREEN */
     1809        text: |
     1810          The option shall be GREEN.
     1811      test-epilogue: null
     1812      test-prologue: null
     1813    requirement-type: functional
     1814    test-action: |
     1815      /* Call the function of the action */
     1816    test-brief: null
     1817    test-context:
     1818    - brief: null
     1819      description: null
     1820      member: void *data
     1821    - brief: null
     1822      description: null
     1823      member: option_type option
     1824    test-description: null
     1825    test-header: null
     1826    test-includes: []
     1827    test-local-includes: []
     1828    test-name: RedGreenData
     1829    test-setup: null
     1830    test-stop: null
     1831    test-support: null
     1832    test-target: tc-red-green-data.c
     1833    test-teardown: null
     1834    transition-map:
     1835    - enabled-by: true
     1836      post-conditions:
     1837        Status: Error
     1838        Data: Unchanged
     1839      pre-conditions:
     1840        Data: NullPtr
     1841        Option: all
     1842    - enabled-by: true
     1843      post-conditions:
     1844        Status: Success
     1845        Data: Red
     1846      pre-conditions:
     1847        Data: Valid
     1848        Option: Red
     1849    - enabled-by: true
     1850      post-conditions:
     1851        Status: Success
     1852        Data: Green
     1853      pre-conditions:
     1854        Data: Valid
     1855        Option: Green
     1856    rationale: null
     1857    references: []
     1858    text: |
     1859      ${.:/text-template}
     1860    type: requirement
    17381861
    17391862.. _SpecTypeGenericFunctionalRequirementItemType:
     
    22442367^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    22452368
    2246 This set of attributes defines the transition from all state variations of the
    2247 set of pre-conditions to states of post-conditions through an action in an
    2248 action requirement. All explicit attributes shall be specified. The explicit
     2369This set of attributes defines the transition from multiple sets of states of
     2370pre-conditions to a set of states of post-conditions through an action in an
     2371action requirement.  The ability to specify multiple sets of states of
     2372pre-conditions which result in a common set of post-conditions may allow a more
     2373compact specification of the transition map.  For example, let us suppose you
     2374want to specify the action of a function with a pointer parameter.  The
     2375function performs an early check that the pointer is NULL and in this case
     2376returns an error code.  The pointer condition dominates the action outcome if
     2377the pointer is NULL.  Other pre-condition states can be simply set to ``all``
     2378for this transition. All explicit attributes shall be specified. The explicit
    22492379attributes for this type are:
    22502380
Note: See TracChangeset for help on using the changeset viewer.