Main Content

Create and Customize Requirements Traceability Reports

Create Requirements Traceability Report for Model

To create the default requirements report for a Simulink® model:

  1. Open the example model:

    openExample("slvnvdemo_fuelsys_officereq.slx")
  2. Make sure that your current working folder is writable.

  3. In the Apps tab, click Requirements Manager. In the Requirements tab, select Share > Generate Model Traceability Report.

    If your model is large and has many requirements links, it takes a few minutes to create the report.

A Web browser window opens with the contents of the report. The following graphic shows the Table of Contents for the slvnvdemo_fuelsys_officereq model.

Requirements report for the slvnvdemo_fuelsys_officereq Simulink model

A typical requirements report includes:

  • Table of contents

  • List of tables

  • Per-subsystem sections that include:

    • Tables that list objects with requirements and include links to associated requirements documents

    • Graphic images of objects with requirements

    • Lists of objects with no requirements

    • MATLAB® code lines with requirements in MATLAB Function blocks

For detailed information about requirements reports, see Customize Requirements Traceability Report for Model.

If Your Model Has Library Reference Blocks

To include requirements links associated with library reference blocks, you must select Include links in referenced libraries and data dictionaries under the Report tab of the Requirements Settings, as described in Customize Requirements Report.

If Your Model Has Model Reference Blocks

By default, requirements links within model reference blocks in your model are not included in requirements traceability reports. To generate a report that includes requirements information for referenced models, follow the steps in Report for Requirements in Model Blocks.

Customize Requirements Traceability Report for Model

Create Default Requirements Report

If you have a model that contains links to external requirements documents, you can create an HTML report that contains summarized and detailed information about those links. In addition, the report contains links that allow you to navigate to both the model and to the requirements documents.

You can generate a default report with information about all the requirements associated with a model and its objects.

Note

If the model for which you are creating a report contains Model blocks, see Report for Requirements in Model Blocks.

Before you generate the report, add a requirement to a Stateflow® chart to see information that the requirements report contains about Stateflow charts:

  1. Open the example model:

    openExample("slvnvdemo_fuelsys_officereq.slx")
  2. Open the fuel rate controller subsystem.

  3. Open the Microsoft® Word requirements document:

    openExample("slrequirements/" + ...
        "ManageReqsForFaultTolerantFuelCtrlSysMicrosoftOffice07Example", ...
        supportingFile="slvnvdemo_FuelSys_RequirementsSpecification.docx")
  4. Create a link from the control logic Stateflow chart to a location in this document.

  5. Keep the example model open, but close the requirements document.

To generate a default requirements report for the slvnvdemo_fuelsys_officereq model, in the Requirements tab, select Share > Generate Model Traceability Report.

The Requirements Management Interface (RMI) searches through all the blocks and subsystems in the model for associated requirements. Requirements Toolbox™ generates and displays a complete report in HTML format.

The report is saved with the default name, model_name_requirements.html. If you generate a subsequent report on the same model, the new report file overwrites any earlier report file.

The report contains the following content:

Table of Contents.  The Table of Contents lists the major sections of the report. There is one System section for the top-level model and one System section for each subsystem, Model block, or Stateflow chart.

Click a link to view information about a specific section of the model.

Table of contents listing the seven systems and one chart in the slvnvdemo_fuelsys_officereq Simulink model

List of Tables.  The List of Tables includes links to each table in the report.

List of the 13 tables in the requirements report for the slvnvdemo_fuelsys_officereq Simulink model

Model Information.  The Model Information contains general information about the model, such as when the model was created and when the model was last modified.

Model information chapter from the requirements report. The table shows the original model was created in 1998 and last modified in 2010.

Documents Summary.  The Documents Summary section lists all the requirements documents to which objects in the slvnvdemo_fuelsys_officereq model link, along with some additional information about each document.

Document summary chapter from the requirements report. A table lists four linked requirements.

  • ID — The ID. In this example, DOC1, DOC2, DOC3, and DOC4 are short names for the requirements documents linked from this model.

    Before you generate a report, in the Settings dialog box, on the Reports tab, if you select Use document IDs in requirements tables, links with these short names are included throughout the report when referring to a requirements document. When you click a short name link in a report, the requirements document associated with that document ID opens.

    When your requirements documents have long path names that can clutter the report, select the Use document IDs in requirements tables option. This option is disabled by default, as you can see in the examples in this section.

  • Document paths stored in the model — Click this link to open the requirements document in its native application.

  • Last modified — The date the requirements document was last modified.

  • # links — The total number of links to a requirements document.

System.  Each System section includes:

  • An image of the model or model object. The objects with requirements are highlighted.

    System chapter from the requirements report includes a static image of the model

  • A list of requirements associated with the model or model object. In this example, click the target document name to open the requirements document associated with the slvnvdemo_fuelsys_officereq model.

    Table that lists a Microsoft Word document that contains requirements linked to the model

  • A list of blocks in the top-level model that have requirements. In this example, only the MAP sensor block has a requirement at the top level. Click the link next to Target: to open the requirements document associated with the MAP sensor block.

    Table that lists the block in slvnv_demo_fuelsys_officereq that has associated requirements

    The preceding table does not include these blocks in the top-level model because:

    • The fuel rate controller and engine gas dynamics subsystems are in dedicated chapters of the report.

    • The report lists Signal Builder blocks separately, in this example, in Table 3.3.

  • A list of requirements associated with each signal group in any Signal Builder block, and a graphic of that signal group. In this example, the Test inputs Signal Builder block in the top-level model has one signal group that has a requirement link. Click the link under Target (document name and location ID) to open the requirements document associated with this signal group in the Test inputs block.

    Table that lists a test input and the linked requirement. The section also includes an image of the signal group.

Chart.  Each Chart section reports on requirements in Stateflow charts, and includes:

  • A graphic of the Stateflow chart that identifies each state.

  • A list of elements that have requirements.

    To navigate to the requirements document associated with a chart element, click the link next to Target.

    Table that lists the Stateflow objects and the linked requirements.

Report for Requirements in Model Blocks

If your model contains Model blocks that reference external models, the default report does not include information about requirements in the referenced models. To generate a report that includes requirements information for referenced models, you must have a license for the Simulink Report Generator™ software. The report includes the same information and graphics for referenced models as it does for the top-level model.

If you have a Simulink Report Generator license, before generating a requirements report, take the following steps:

  1. Open the model for which you want to create a requirements report. This workflow uses the example model slvnvdemo_fuelsys_officereq.

  2. To open the template for the default requirements report, at the MATLAB command prompt, enter:

    setedit requirements
  3. In the Simulink Report Generator software window, in the far-left pane, click the Model Loop component.

    Tree of report options tree in the Report Explorer window

  4. On the far-right pane, locate the Model reference field. If you cannot see the drop-down arrow for that field, expand the pane.

    Model Options pane in the Report Explorer window

  5. In the Model reference field drop-down list, select Follow all model reference blocks.

  6. To generate a requirements report for the open model that includes information about referenced models, click the Report icon .

Customize Requirements Report

The Requirements Management Interface (RMI) uses the Simulink Report Generator software to generate the requirements report. You can customize the requirements report using Requirements Toolbox or the Simulink Report Generator software:

Customize Requirements Report Using Requirements Toolbox Settings.  There are several options for customizing a requirements report using the Requirements Settings dialog box.

Requirement Settings dialog box. The Report tab is selected.

On the Report tab, select options that specify the contents that you want in the report.

Requirements Settings Report OptionDescription

Highlight the model before generating report

Enables highlighting of Simulink objects with requirements in the report graphics.

Include links in referenced libraries and data dictionaries

Includes requirements links in referenced libraries in the generated report.

Report objects with no links to requirements

Includes lists of model objects that have no requirements.

Show user keywords for each reported link

Lists the user keywords, if any, for each reported link.

Use document IDs in requirements tables

Uses a document ID, if available, instead of a path name in the tables of the requirements report. This capability prevents long path names to requirements documents from cluttering the report tables.

Include details from linked documents

Includes additional content from linked requirements. The following requirements documents are supported:

  • Microsoft Word

  • Microsoft Excel®

  • IBM® DOORS®

Include links to Simulink objects

Includes links from the report to objects in Simulink.

Use internal HTTP server to support navigation from system browsers

Specifies use of internal MATLAB HTTP server for navigation from generated report to documents and model objects. By selecting this setting, this navigation is available from system browsers as long as the MATLAB internal HTTP server is active on your local host. To start the internal HTTP server, at the MATLAB command prompt, type rmi('httpLink').

To see how these options affect the content of the report:

  1. Open the slvnvdemo_fuelsys_officereq model:

    openExample("slvnvdemo_fuelsys_officereq.slx")
  2. In the Apps tab, select Requirements Manager.

  3. In the Requirements pane, set the View drop-down menu to Links.

  4. In the Requirements tab, select Link Settings > Linking Options.

  5. In the Requirements Settings dialog box, click the Report tab.

  6. For this example, select Highlight the model before generating report.

    When you select this option, before generating the report, the graphics of the model that are included in the report are highlighted so that you can easily see which objects have requirements.

  7. To close the Requirements Settings dialog box, click Close.

  8. Generate a requirements report. In the Requirements tab, select S.

    The requirements report opens in a browser window so that you can review the content of the report.

  9. If you do not want to overwrite the current report when you regenerate the requirements report, rename the HTML file, for example, slvnvdemo_fuelsys_officereq_requirements_old.html.

    The default report file name is model_name_requirements.html.

  10. In the Requirements tab, select Share > Generate Model Traceability Report.

    • Show user keywords for each reported link — The report lists the user keywords (if any) associated with each requirement.

    • Include details from linked documents — The report includes additional details for requirements in the following types of requirements documents.

      Requirements Document FormatIncludes in the Report

      Microsoft Word

      Full text of the paragraph or subsection of the requirement, including tables.

      Microsoft Excel

      If the target requirement is a group of cells, the report includes all those cells as a table. If the target requirement is one cell, the report includes that cell and all the cells in that row to the right of the target cell.

      IBM DOORS

      By default, the report includes:

      • DOORS Object Heading

      • DOORS Object Text

      • All other attributes except Created Thru, attributes with empty string values, and system attributes that are false.

      Use the RptgenRMI.doorsAttribs function to include or exclude specific attributes or groups of attributes.

  11. Close the Requirements Settings dialog box.

  12. Generate a new requirements report. In the Requirements tab, select Share > Generate Model Traceability Report.

  13. Compare this new report to the report that you renamed in step 7:

    • User keywords associated with requirements links are included.

    • Details from the requirement content are included as specified in step 9.

  14. When you are done reviewing the report, close the report and the model.

Customize Requirements Report Using Simulink Report Generator.  If you have a license for the Simulink Report Generator software, you can further modify the default requirements report.

At the MATLAB command prompt, enter the following command:

setedit requirements

The Report Explorer GUI opens the requirements report template that Requirements Toolbox uses when generating a requirements report. The report template contains Simulink Report Generator components that define the structure of the requirements report.

If you click a component in the middle pane, the options that you can specify for that component appear in the right-hand pane. For detailed information about using a particular component to customize your report, click Help at the bottom of the right-hand pane.

In addition to the standard report components, Simulink Report Generator provides components specific to Requirements Toolbox in the Requirements Management Interface category.

Simulink Report Generator ComponentReport Information
Missing Requirements Block Loop (Simulink Report Generator)Applies all child components to blocks that have no requirements
Missing Requirements System Loop (Simulink Report Generator)Applies all child components to systems that have no requirements
Requirements Block Loop (Simulink Report Generator)Applies all child components to blocks that have requirements
Requirements Documents Table (Simulink Report Generator)Inserts a table that lists requirements documents
Requirements Signal Loop (Simulink Report Generator)Applies all child components to signal groups with requirements
Requirements Summary Table (Simulink Report Generator)Inserts a property table that lists requirements information for blocks with associated requirements
Requirements System Loop (Simulink Report Generator)Applies all child components to systems with requirements
Subsystem Requirements Table (Simulink Report Generator)Inserts a table that lists system and subsystem requirements
Data Dictionary Traceability Table (Simulink Report Generator)Inserts a table that links data dictionary information to requirements
MATLAB Code Traceability Table (Simulink Report Generator)Inserts a table that links MATLAB code to requirements
Simulink Test Suite Traceability Table (Simulink Report Generator)Inserts a table that links a Simulink test suite to requirements

To customize the requirements report, you can:

  • Add or delete components.

  • Move components up or down in the report hierarchy.

  • Customize components to specify how the report presents certain information.

For more information, see the Simulink Report Generator documentation.

Generate Requirements Reports Using Simulink

When you have a model open in Simulink, the Model Editor provides two options for creating requirements reports:

System Design Description Report.  The System Design Description report describes a system design represented by the current Simulink model.

You can use the System Design Description report to:

  • Review a system design without having the model open.

  • Generate summary and detailed descriptions of the design.

  • Assess compliance with design requirements.

  • Archive the system design in a format independent of the modeling environment.

  • Build a customized version of the report using the Simulink Report Generator software.

To generate a System Design Description report that includes requirements information:

  1. Open the model for which you want to create a report.

  2. In the Modeling tab, select Compare > System Design Description Report.

  3. In the Design Description dialog box, select Requirements traceability.

  4. Select any other options that you want for this report.

  5. Click Generate.

    As the software is generating the report, the status appears in the MATLAB command window.

The report name is the model name, followed by a numeral, followed by the extension that reflects the document type (.pdf, .html, etc.).

If your model has linked requirements, the report includes a chapter, Requirements Traceability, that includes:

  • Lists of model objects that have requirements with hyperlinks to display the objects

  • Images of each subsystem, highlighting model objects with requirements

Design Requirements Report.  In the Apps tab, click Requirements Manager. In the Requirements tab, click Share > Generate Model Traceability Report. This option creates a requirements report, as described in Create Default Requirements Report.

To specify options for the report, select Share > Report Options. Before generating the report, on the Report tab, set the options that you want. For detailed information about these options, see Customize Requirements Report.

See Also

Functions

Related Topics