Main Content

Requirements Table

Model formal requirements with input conditions

Since R2022a

  • Requirements Table block icon.

Libraries:
Requirements Toolbox

Description

The Requirements Table block models formal requirements. The block starts with evaluating conditions listed in the Precondition column. If the conditions are satisfied, you can check if other simulation data meet specified conditions in the Postcondition column, or execute desired actions, such as block outputs or functions, in the Action column. For more information, see Use a Requirements Table Block to Create Formal Requirements.

You can also constrain requirements based on physical limitations of your model by defining assumptions in the Assumptions tab. See Add Assumptions to Requirements.

You can configure this block only if you have Requirements Toolbox™.

Examples

Ports

Input

expand all

Input port that corresponds to the input data of the block. The block accepts real-valued scalar, vector, or matrix inputs. Each input data that you define has a corresponding input port.

Dependencies

To create input ports, open the block and create input data in the Symbols pane. See Define Data in Requirements Table Blocks.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | string | fixed point | enumerated | bus

Output

expand all

Output port, specified as a scalar, vector, or matrix. The block outputs real-valued scalar, vector, or matrix values. Each output data that you define has a corresponding output port.

Dependencies

To create output ports, open the block and create output data in the Symbols pane. See Define Data in Requirements Table Blocks.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | string | fixed point | enumerated | bus

Parameters

expand all

To edit the block parameters interactively:

  • Use the Property Inspector. From the Simulink Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

  • Use the Table Properties window. Open the block. Then, in the Simulation tab, in the Prepare section, click Table Properties.

Note

Requirements Table blocks also have Subsystem (Simulink) block parameters that you can access by right-clicking the block and clicking Block Parameters (Subsystem). However, updating these block parameters is not recommended.

Specify the method for activating the Requirements Table block as one of these values:

  • Inherited — Input from the Simulink model activates the Requirements Table block.

    If you define input data, the Requirements Table block samples at the rate of the fastest input data. If you do not define input data, the Requirements Table block samples at the rate defined by the execution behavior of the parent subsystem.

  • Discrete — Sample the Requirements Table block by using the rate you specify in the Sample time parameter of the Requirements Table block. The Requirements Table block generates an implicit event at regular time intervals that correspond to the specified rate. Other blocks in the model can have different sample times.

Specify the time interval at which the Requirements Table block activates during simulation. The default value indicates that the block inherits the sample time from Simulink. This property uses the same format that you use in Simulink. For more information on specifying sample time, see Specify Sample Time (Simulink).

Do not use the Sample Time parameter in the Subsystem block parameters. Instead, use the Table Properties window.

Dependencies

To enable this parameter, set the block parameter Update method to Discrete.

Specify whether the data in the Requirements Table block saturates on integer overflow as one of these values:

  • on — The block saturates an integer by setting it to the maximum positive or negative value allowed by the word size. This setting matches MATLAB® behavior.

  • off — The block wraps the value.

For more information, see Saturation and Wrapping (Fixed-Point Designer).

Specify whether the Requirements Table block supports input and output data that varies in dimension during simulation. When this parameter is on, you can define variable-size outputs by enabling the Variable size property on output data. For more information, see Variable size.

Specify whether the block can use data with Scope set to Output in preconditions. If you disable this parameter, the block highlights the cell and displays an alert icon in preconditions that use output data, unless the data is an input argument of getPrevious. However, if getPrevious attempts to return the value of the data at a time step when it is not defined, getPrevious returns undefined behavior.

Tips

Fixed-point properties

Specify the default fimath object properties for the Requirements Table block as one of these values:

  • Same as MATLAB — The block uses the same fimath object properties as the current default fimath object. The text box is dimmed and displays the current global fimath object in read-only form.

  • Specify other — Specify your own fimath object in the text box one of two ways:

    • Construct the fimath object inside the text box.

    • Construct the fimath object in the MATLAB or model workspace and then enter its variable name in the text box. If you use this option and plan to share your model with others, define the variable in the model workspace.

  • For more information on fimath objects, see fimath Object Construction (Fixed-Point Designer).

Tips

  • The fimath object of a Requirements Table block behaves as a globalfimath (Fixed-Point Designer) for the contents of the block. The block associates the fimath object properties in this parameter with the fixed-point and integer input signals to the block that you choose to treat as fi objects. Constructing fi objects in the Requirements Table block introduces additional considerations.

    • If no fimath object is associated with a fi object when it is constructed, then the fi constructor uses the default fimath object settings regardless of the properties in Requirements Table fimath. If you perform operations on the fi object after it is constructed, the object adopts the properties in Requirements Table fimath.

    • If you specify a fimath object in the fi constructor, then the fi constructor obeys that fimath object when quantizing the value. fimath settings not specified in the fi constructor use the specified properties in Requirements Table fimath.

Extended Capabilities

Version History

Introduced in R2022a

expand all