MATLAB SIMULINK VERIFICATION AND VALIDATION - S Guide de l'utilisateur

Naviguer en ligne ou télécharger Guide de l'utilisateur pour Logiciel MATLAB SIMULINK VERIFICATION AND VALIDATION - S. MATLAB SIMULINK VERIFICATION AND VALIDATION - S User`s guide Manuel d'utilisatio

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 674
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 0
Simulink
®
Verification and Validation™
User's Guide
R2015a
Vue de la page 0
1 2 3 4 5 6 ... 673 674

Résumé du contenu

Page 1 - User's Guide

Simulink® Verification and Validation™User's GuideR2015a

Page 2 - How to Contact MathWorks

x ContentsAdvantages of Synchronizing Your Model with aSurrogate Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4Synchronize a Sim

Page 3 - Revision History

3 How Is Requirements Link Information Stored?3-8Move Externally Stored Requirements Links to the Model FileIf you have a model with requirements link

Page 4

4Reviewing Requirements• “Highlight Model Objects with Requirements” on page 4-2• “Navigate to Requirements from Model” on page 4-5• “Customize Requir

Page 5 - Contents

4 Reviewing Requirements4-2Highlight Model Objects with RequirementsYou can highlight a model to see which objects in the model have links to requirem

Page 6

Highlight Model Objects with Requirements4-3Objects that do not have requirements are colored gray.3To remove the highlighting from the model, select

Page 7

4 Reviewing Requirements4-41Open the example model:slvnvdemo_fuelsys_officereq2Select View > Model Explorer.3To highlight all model objects with r

Page 8

Navigate to Requirements from Model4-5Navigate to Requirements from ModelIn this section...“Navigate from Model Object” on page 4-5“Navigate from Sys

Page 9 - Synchronization

4 Reviewing Requirements4-61Open the example model:slvnvdemo_fuelsys_officereq2In the Simulink Editor, select Analysis > Requirements Traceability

Page 10

Customize Requirements Traceability Report for Model4-7Customize Requirements Traceability Report for ModelIn this section...“Create Default Requirem

Page 11 - MATLAB Code Traceability

4 Reviewing Requirements4-81Select Analysis > Requirements Traceability > Generate Report.The Requirements Management Interface (RMI) searches t

Page 12

Customize Requirements Traceability Report for Model4-9List of TablesThe List of Tables includes links to each table in the report.

Page 13 - Model Component Testing

xiMicrosoft Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10Why Add Navigation Objects to Microsoft OfficeRequirements? . .

Page 14 - Verification Manager

4 Reviewing Requirements4-10Model InformationThe Model Information contains general information about the model, such as whenthe model was created and

Page 15 - Model Coverage Definition

Customize Requirements Traceability Report for Model4-11• ID — The ID. In this example, DOC1, DOC2, DOC3, and DOC4 are short names forthe requirement

Page 16

4 Reviewing Requirements4-12• A list of requirements associated with the model or model object. In this example,click the target document name to open

Page 17

Customize Requirements Traceability Report for Model4-13• A list of blocks in the top-level model that have requirements. In this example, onlythe MA

Page 18 - Results Review

4 Reviewing Requirements4-14ChartEach Chart section reports on requirements in Stateflow charts, and includes:• A graphic of the Stateflow chart that

Page 19

Customize Requirements Traceability Report for Model4-15Report for Requirements in Model BlocksIf your model contains Model blocks that reference ext

Page 20

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

Page 21

Customize Requirements Traceability Report for Model4-17Customize Requirements ReportThe Requirements Management Interface (RMI) uses the Simulink Re

Page 22 - Create Model Advisor Checks

4 Reviewing Requirements4-18On the Report tab, select options that specify the contents that you want in the report.Requirements Settings Report Optio

Page 23

Customize Requirements Traceability Report for Model4-19Requirements Settings Report Option Descriptionprevents long path names to requirementsdocume

Page 24 - Checks and Folders

xii ContentsCustom Types of Requirements Documents9Why Create a Custom Link Type? . . . . . . . . . . . . . . . . . . 9-2Implement Custom Link Types .

Page 25 - Deploy Custom Configurations

4 Reviewing Requirements4-205To close the Requirements Settings dialog box, click Close.6Generate a requirements report by selecting Analysis > Req

Page 26

Customize Requirements Traceability Report for Model4-21Requirements Document Format Includes in the ReportUse the RptgenRMI.doorsAttribs functionto

Page 27 - Getting Started

4 Reviewing Requirements4-22Simulink Report Generator Component Report InformationMissing Requirements Block Loop Applies all child components to bloc

Page 28 - 1 Getting Started

Customize Requirements Traceability Report for Model4-23System Design Description ReportThe System Design Description report describes a system desig

Page 29 - System Requirements

4 Reviewing Requirements4-24on page 4-7. This menu option is equivalent to Analysis > RequirementsTraceability > Generate Report.To specify opti

Page 30

Filter Requirements with User Tags4-25Filter Requirements with User TagsIn this section...“User Tags and Requirements Filtering” on page 4-25“Apply a

Page 31 - Requirements Traceability

4 Reviewing Requirements4-26

Page 32

Filter Requirements with User Tags4-274In the User tag field, enter one or more keywords, separated by commas, that theRMI can use to filter requirem

Page 33 - Links Between Models and

4 Reviewing Requirements4-284To enable filtering with user tags, click the Filter links by user tags whenhighlighting and reporting requirements optio

Page 34

Filter Requirements with User Tags4-298Reopen the Requirements Settings dialog box to the Filters tab.9In the Include links with any of these tags fi

Page 35

xiiiModel Component TestingOverview of Component Verification11Component Verification . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Component

Page 36

4 Reviewing Requirements4-303In the Apply this user tag to new links field, enter one or more user tags,separated by commas.The RMI applies these user

Page 37 - Requirements Link Storage

Filter Requirements with User Tags4-31The selection-based linking options specify which user tags the RMI applies to thelink that you create. In the

Page 38

4 Reviewing Requirements4-32Option DescriptionApply same filters in consistencycheckingIncludes or excludes requirements withspecified user tags when

Page 39

Create Requirements Traceability Report for Simulink Project4-33Create Requirements Traceability Report for Simulink ProjectTo create a report for re

Page 40

4 Reviewing Requirements4-34View Requirements Details for a Selected BlockIn this section...“Requirements Details Workflow” on page 4-34“Requirements

Page 41

View Requirements Details for a Selected Block4-35documents stored on network drives, and documents with Microsoft Office Trust CenterActiveX control

Page 43

5Requirements Links Maintenance• “Validation of Requirements Links” on page 5-2• “Validate Requirements Links in a Model” on page 5-4• “Validate Requi

Page 44 - Navigation

5 Requirements Links Maintenance5-2Validation of Requirements LinksRequirements links in a model can become outdated when requirements changeover time

Page 45

Validation of Requirements Links5-3How the rmi Function Checks a Requirements Documentrmi performs the following actions:• Locates all links to Simul

Page 46

xiv ContentsSignal Monitoring with Model Verification BlocksUsing Model Verification Blocks13Model Verification Blocks and the VerificationManager . .

Page 47 - Document Index Tab

5 Requirements Links Maintenance5-4Validate Requirements Links in a ModelIn this section...“Check Requirements Links with the Model Advisor” on page 5

Page 48 - Requirements Settings

Validate Requirements Links in a Model5-5Consistency Check Problem Identified• Microsoft Excel documents• IBM Rational DOORS documents• Simulink obje

Page 49 - Requirements Settings

5 Requirements Links Maintenance5-6continue the checks. The consistency checks must verify up-to-date stored copiesof the requirements documents.• If

Page 50 - Link Model Objects

Validate Requirements Links in a Model5-7Fix Invalid Requirements Links Detected by the Model AdvisorIn “Check Requirements Links with the Model Advi

Page 51 - Link Model Objects

5 Requirements Links Maintenance5-8• In the Location field, specify a valid location in the requirements document.• Delete the requirements link by se

Page 52

Validate Requirements Links in a Model5-9The first message indicated that the model contains a link to a bookmark namedSimulink_requirement_item_7 in

Page 53

5 Requirements Links Maintenance5-10seconds, then back to 10 degrees over the next two seconds. This cyclerepeats continuously while the engine is hel

Page 54

Validate Requirements Links in a Requirements Document5-11Validate Requirements Links in a Requirements DocumentIn this section...“Check Links in a R

Page 55

5 Requirements Links Maintenance5-12If you want to... Do the following...Fix the invalid links Follow the instructions in “Fix InvalidLinks in a Requi

Page 56 - DocBlock

Validate Requirements Links in a Requirements Document5-13link for that requirement. To rerun the check so that all requirements are checked, atthe t

Page 57

xvModel Coverage AnalysisModel Coverage Definition15Model Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2Types of Model

Page 58

5 Requirements Links Maintenance5-14To... Click...Navigate to and select a new target model or newtarget objects for these broken links.Fix allReset t

Page 59

Document Path Storage5-15Document Path StorageWhen you create a requirements link, the RMI stores the location of the requirementsdocument with the l

Page 60 - Document

5 Requirements Links Maintenance5-16Model file C:\work\models\controllers\pid.mdlRequirements document pid.htmlDocuments searched for(in order)C:\work

Page 61

Delete Requirements Links from Simulink Objects5-17Delete Requirements Links from Simulink ObjectsIn this section...“Delete a Single Link from a Simu

Page 62

5 Requirements Links Maintenance5-18Delete All Links from Multiple Simulink ObjectsTo delete all requirements links from a group of Simulink model obj

Page 63

Requirements Links for Library Blocks and Reference Blocks5-19Requirements Links for Library Blocks and Reference BlocksIn this section...“Introducti

Page 64

5 Requirements Links Maintenance5-20Copy Library Blocks with RequirementsWhen you copy a library subsystem or masked block to a model, you can highlig

Page 65

Requirements Links for Library Blocks and Reference Blocks5-21Manage Requirements Inside Reference BlocksIf your library block is a subsystem or a St

Page 66 - Workbook

5 Requirements Links Maintenance5-22S1LibrarylinkLibraryS1LibraryblockReferenceblockModel 12Disable the library link between the reference block and t

Page 67

Requirements Links for Library Blocks and Reference Blocks5-23aSelect the reference block.bSelect Diagram > Library Link > Resolve Link.cIn the

Page 68 - Change Requirements Links

xvi ContentsDiscrete FIR Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 16-11Discrete-Time Integrator . . . . . . . . . . . . . . . . . .

Page 69 - MAP sensor test scenario

5 Requirements Links Maintenance5-24Requirements documentLibrary modelRequirementS1S1S1LibrarylinkLibrarylinkLink torequirementLink torequirementLin

Page 70

Requirements Links for Library Blocks and Reference Blocks5-25Requirements documentLibraryRequirementB1Links to and froma requirementLibraryblockWh

Page 72

6IBM Rational DOORS SurrogateModule Synchronization• “Synchronization with DOORS Surrogate Modules” on page 6-2• “Advantages of Synchronizing Your Mod

Page 73

6 IBM Rational DOORS Surrogate Module Synchronization6-2Synchronization with DOORS Surrogate ModulesSynchronization is a user-initiated process that c

Page 74

Synchronization with DOORS Surrogate Modules6-320020220320420520620720811.11.1.11.1.21.1.31.21.2.11.3ModelSubsystemBlockBlockBlockSubsystemBlockBlock

Page 75

6 IBM Rational DOORS Surrogate Module Synchronization6-4Advantages of Synchronizing Your Model with a SurrogateModuleSynchronizing your Simulink model

Page 76

Synchronize a Simulink Model to Create a Surrogate Module6-5Synchronize a Simulink Model to Create a Surrogate ModuleThe first time that you synchron

Page 77

6 IBM Rational DOORS Surrogate Module Synchronization6-6After synchronization with the None option, the surrogate module, a formal modulenamed sf_car_

Page 78

Create Links Between Surrogate Module and Formal Module in a DOORS Database6-7Create Links Between Surrogate Module and Formal Module in aDOORS Datab

Page 79

xviiWhile Iterator, While Iterator Subsystem . . . . . . . . . 16-31Model Objects That Do Not Receive Coverage . . . . . . 16-33Setting Model Coverage

Page 80

6 IBM Rational DOORS Surrogate Module Synchronization6-8Customize DOORS SynchronizationIn this section...“DOORS Synchronization Settings” on page 6-8“

Page 81

Customize DOORS Synchronization6-9DOORS Settings Option DescriptionCopy unmatched links During synchronization, selecting the followingoptions has th

Page 82

6 IBM Rational DOORS Surrogate Module Synchronization6-10DOORS Settings Option DescriptionSave Simulink model (recommended) After the synchronization,

Page 83

Customize DOORS Synchronization6-114Click Continue to create a new surrogate module with the new path or name.Customize the Level of Detail in Synchr

Page 84

6 IBM Rational DOORS Surrogate Module Synchronization6-12Drop-Down List Option DescriptionModerate - Unmaskedsubsystems, Stateflow charts,and supersta

Page 85

Customize DOORS Synchronization6-134Update the surrogate module to include all objects in your model. To do this, underExtra mapping additionally to

Page 86

6 IBM Rational DOORS Surrogate Module Synchronization6-146Scroll through the surrogate module. Notice that the objects with requirements (theengine to

Page 87

Resynchronize DOORS Surrogate Module to Reflect Model Changes6-15Resynchronize DOORS Surrogate Module to Reflect ModelChangesIf you change your model

Page 88

6 IBM Rational DOORS Surrogate Module Synchronization6-165Delete the copied object (vehicle mph (yellow) & throttle %1 and resynchronize themodel.

Page 89

Navigate with the Surrogate Module6-17Navigate with the Surrogate ModuleIn this section...“Navigate Between Requirements and the Surrogate Module in

Page 90

xviii ContentsHow to Collect Coverage for MATLAB Functions . . . . 18-22Examples: Model Coverage for MATLAB Functions . . 18-23Model Coverage for C an

Page 91

6 IBM Rational DOORS Surrogate Module Synchronization6-182Select the object name.The surrogate module for sf_car_doors opens, at the object associated

Page 92

Navigate with the Surrogate Module6-19Navigate from a Requirement to the Model via the Surrogate ModuleTo navigate from the Transmission Requirements

Page 94 - External Storage

7Navigation from RequirementsDocuments• “IBM Rational DOORS” on page 7-2• “Microsoft Office” on page 7-10

Page 95

7 Navigation from Requirements Documents7-2IBM Rational DOORSIn this section...“Why Add Navigation Objects to DOORS Requirements?” on page 7-2“Configu

Page 96

IBM Rational DOORS7-3Follow the instructions in “Configure RMI for IBM Rational DOORS or Microsoft ActiveXNavigation” on page 2-12.Manually Install A

Page 97

7 Navigation from Requirements Documents7-4bIn a text editor, open the copiedFromDoors7.dxl file.cAdd // before this line to comment it out:#include &

Page 98

IBM Rational DOORS7-55Select Store absolute path to model file.For this exercise, you save a copy of the example model on the MATLAB path.If you add

Page 99

7 Navigation from Requirements Documents7-66Close the model.Note: When you navigate to a DOORS requirement from outside the software, theDOORS module

Page 100

IBM Rational DOORS7-7Customize DOORS Navigation ObjectsIf the RMI is configured to modify destination for bi-directional linking as described in“Enab

Page 101 - Reviewing Requirements

xixDecisions Analyzed . . . . . . . . . . . . . . . . . . . . . . . . . . 19-24Conditions Analyzed . . . . . . . . . . . . . . . . . . . . . . . . . 1

Page 102 - 4 Reviewing Requirements

7 Navigation from Requirements Documents7-8Navigate Between DOORS Requirement and Model ObjectIn “Insert Navigation Objects into DOORS Requirements” o

Page 103

IBM Rational DOORS7-9Diagnose and Fix DXL ErrorsIf you try to synchronize your Simulink model to a DOORS project, you might see thefollowing errors:-

Page 104

7 Navigation from Requirements Documents7-10Microsoft OfficeIn this section...“Why Add Navigation Objects to Microsoft Office Requirements?” on page 7

Page 105 - Navigate from Model Object

Microsoft Office7-11To enable linking from a Microsoft Office document to the example model:1Open the model:slvnvdemo_fuelsys_officereqNote: You can

Page 106

7 Navigation from Requirements Documents7-122Select the Throttle Sensor header.3In the slvnvdemo_fuelsys_officereq model, open the engine gas dynamics

Page 107

Microsoft Office7-13Note: In Microsoft Office requirements documents, following a navigation object linkhighlights the Simulink object that contains

Page 108

7 Navigation from Requirements Documents7-142In the requirements document, next to Throttle Sensor, follow the navigationobject link.The engine gas dy

Page 109 - List of Tables

Microsoft Office7-15a document created in an earlier version and then save it in Microsoft Word 2007 format,make sure that the links to the models co

Page 110

7 Navigation from Requirements Documents7-16Note: You might need to enable ActiveX controls in the Microsoft Office Trust Center.Field Codes in Requir

Page 111

Microsoft Office7-17• In Microsoft Word 2010, select File > Options.2In the left-hand portion of the pane, click Advanced.3In the Advanced pane, s

Page 112

How to Contact MathWorksLatest news:www.mathworks.comSales and services:www.mathworks.com/sales_and_servicesUser community:www.mathworks.com/matlabcen

Page 113

xx ContentsFilter a Stateflow Event . . . . . . . . . . . . . . . . . . . . . . 20-15Filter Library Reference Blocks . . . . . . . . . . . . . . . . .

Page 114

7 Navigation from Requirements Documents7-18ActiveX Control Does Not Link to Model ObjectIf you click an ActiveX control that links to a Simulink or S

Page 115

Microsoft Office7-195Select the setting that you want for ActiveX controls:• Prompt me for enabling all controls with minimal restrictions todecide e

Page 116

7 Navigation from Requirements Documents7-202In the pane that opens, at the bottom, click Excel Options.3In the Microsoft Excel Options dialog box, in

Page 117 - Customize Requirements Report

8MATLAB Code Traceability• “Link Between MATLAB Code Lines and Requirements Information in ExternalDocuments” on page 8-2• “Enable or Disable Highligh

Page 118

8 MATLAB Code Traceability8-2Link Between MATLAB Code Lines and Requirements Information inExternal DocumentsIn this section...“Create Link Using Cont

Page 119

Link Between MATLAB Code Lines and Requirements Information in External Documents8-3• From the context menu, select Requirements Traceability > Op

Page 120

8 MATLAB Code Traceability8-4Enable or Disable Highlighting of Traceability Links for MATLABCodeIn this section...“Enable Traceability Highlighting of

Page 121

Remove Traceability Links from MATLAB Code Lines8-5Remove Traceability Links from MATLAB Code LinesIn this section...“Delete Links to Requirements fr

Page 122

8 MATLAB Code Traceability8-6Traceability for MATLAB Code LinesIn this section...“Traceability Link Targets” on page 8-6“Storage of Traceability Links

Page 123

Traceability for MATLAB Code Lines8-7If you want to create traceability links for lines of code in a MATLAB Function block, setthe parent model to st

Page 124

xxiLimit Model Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-3What Is a Model Advisor Exclusion? . . . . . . . . . . . . . . 22-

Page 125

8 MATLAB Code Traceability8-8Associate Traceability Information with MATLAB Code Lines inSimulinkTraceability management support in the MATLAB Editor

Page 126

Associate Traceability Information with MATLAB Code Lines in Simulink8-9Two MATLAB Functions between neurons calculate post-synaptic currents. Whenpr

Page 127

8 MATLAB Code Traceability8-10

Page 128

Associate Traceability Information with MATLAB Code Lines in Simulink8-11

Page 129

8 MATLAB Code Traceability8-12Simulate Model and View ResultsSimulate slvnvdemo_synaptic_transmission model. Check Scope for results. The six plotsare

Page 130

Associate Traceability Information with MATLAB Code Lines in Simulink8-13file and navigate back to Simulink by selecting the shortcut in the Requirem

Page 131

8 MATLAB Code Traceability8-14

Page 132

Associate Traceability Information with MATLAB Code Lines in Simulink8-15Create Traceability Link for Lines of Code Inside MATLAB Function BlocksThe

Page 133

8 MATLAB Code Traceability8-16

Page 134

Associate Traceability Information with MATLAB Code Lines in Simulink8-17Report Traceability LinksTraceability links associated with MATLAB code line

Page 135

xxii ContentsView Results in Model Advisor GUI . . . . . . . . . . . . . 23-11View Model Advisor Report . . . . . . . . . . . . . . . . . . . . 23-12A

Page 136

8 MATLAB Code Traceability8-18

Page 137

Associate Traceability Information with MATLAB Code Lines in Simulink8-19

Page 139

9Custom Types of RequirementsDocuments• “Why Create a Custom Link Type?” on page 9-2• “Implement Custom Link Types” on page 9-3• “Custom Link Type Fun

Page 140

9 Custom Types of Requirements Documents9-2Why Create a Custom Link Type?In addition to linking to built-in types of requirements documents, you can r

Page 141

Implement Custom Link Types9-3Implement Custom Link TypesTo implement a custom link type:1Create a MATLAB function file based on the custom link type

Page 142

9 Custom Types of Requirements Documents9-4Custom Link Type FunctionsTo create a MATLAB function file, start with the custom link type template, locat

Page 143

Links and Link Types9-5Links and Link TypesRequirements links are the data structures, managed by Simulink, that identify aspecific location within a

Page 144

9 Custom Types of Requirements Documents9-6Link Type PropertiesLink type properties define how links are created, identified, navigated to, and stored

Page 145

Link Type Properties9-7Property DescriptionContentsFcn The MATLAB callback invoked when you click the DocumentIndex tab in the Requirements Traceabil

Page 146

xxiiiRegister Checks and Process Callbacks . . . . . . . . . . . 25-27Define Startup and Post-Execution Actions Using ProcessCallback Functions . . .

Page 147

9 Custom Types of Requirements Documents9-8Property DescriptionIsValidIdFcn The MATLAB callback invoked when you run a requirementsconsistency check.

Page 148

Link Type Properties9-9Property DescriptionDetailsFcn The MATLAB callback invoked when you generate therequirements report with the Include details f

Page 149

9 Custom Types of Requirements Documents9-10Custom Link Type RegistrationRegister your custom link type by passing the name of the MATLAB function fil

Page 150

Create a Custom Requirements Link Type9-11Create a Custom Requirements Link TypeIn this example, you implement a custom link type to a hypothetical d

Page 151 - Document Path Storage

9 Custom Types of Requirements Documents9-12 % Create a default (blank) requirement link type linkType = ReqMgr.LinkType; linkType.Registrati

Page 152 - Absolute Path Example

Create a Custom Requirements Link Type9-13function [labels, depths, locations] = ContentsFcn(filePath) % Read the entire file into a variable f

Page 153

9 Custom Types of Requirements Documents9-14The user-selectable climb rate is always a positive number if the current altitude is above the target alt

Page 154

Create a Custom Requirements Link Type9-15ENd of "Autopilot Disable"Requirement:: "Glide Slope Armed"Glide Slope Control is armed

Page 155

9 Custom Types of Requirements Documents9-16negative of the user setting. End of "Glide Slope Coupled"5Open the following example model:aero

Page 156

Create a Custom Requirements Link Type9-17Note: The rmi reference page describes other types of requirements locationdelimiters.The Location drop-dow

Page 157

xxiv ContentsCreate Custom Configurations by OrganizingChecks and Folders26Create Custom Configurations . . . . . . . . . . . . . . . . . . . . 26-2Cr

Page 158

9 Custom Types of Requirements Documents9-18

Page 159

Custom Link Type Synchronization9-19Custom Link Type SynchronizationSimulink Verification and Validation provides an API for synchronization of links

Page 160

9 Custom Types of Requirements Documents9-20Navigate to Simulink Objects from External DocumentsThe RMI includes several functions that simplify creat

Page 161 - Requirement

Navigate to Simulink Objects from External Documents9-21Use the ActiveX Navigation ControlThe RMI uses software that includes a special Microsoft Act

Page 162

9 Custom Types of Requirements Documents9-225Create a navigation item in the external document using the scripting capability ofthe external tool. Set

Page 163 - Module Synchronization

10Requirements Information inGenerated Code• “How Requirements Information Is Included in Generated Code” on page 10-2• “Generate Code for Models with

Page 164

10 Requirements Information in Generated Code10-2How Requirements Information Is Included in Generated CodeAfter you simulate your model and verify it

Page 165

How Requirements Information Is Included in Generated Code10-3Model Object with Requirement Location of Code Comments with RequirementsLinksNonsubsys

Page 166

10 Requirements Information in Generated Code10-4Generate Code for Models with Requirements LinksTo specify that generated code of an ERT target inclu

Page 167

Generate Code for Models with Requirements Links10-511Click the link Clock period shall be consistent with chirp toleranceto open the HTML requiremen

Page 168

xxvCreate Procedural-Based Model AdvisorConfigurations27Create Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-2What Is a Pr

Page 170

Model Component Testing

Page 172

11Overview of Component Verification• “Component Verification” on page 11-2• “Basic Approach to Component Verification” on page 11-4• “Functions for C

Page 173

11 Overview of Component Verification11-2Component VerificationIn this section...“Component Verification Approaches” on page 11-2“Simulink Verificatio

Page 174

Component Verification11-3components individually, you can create test cases that fully specify the componentinterface, allowing the component to rec

Page 175

11 Overview of Component Verification11-4Basic Approach to Component VerificationIn this section...“Workflow for Component Verification” on page 11-4“

Page 176

Basic Approach to Component Verification11-5• For closed-loop simulations, verify a component within the context of its containermodel by logging the

Page 177

11 Overview of Component Verification11-6Verify a Component Independently of the Container ModelUse component analysis to verify:• Model blocks• Atomi

Page 178

Basic Approach to Component Verification11-7Verify a Model Block in the Context of the Container ModelUse system analysis to verify a Model block in

Page 180 - Surrogate Module

11 Overview of Component Verification11-8Functions for Component VerificationThe Simulink Verification and Validation software provides several functi

Page 181

Functions for Component Verification11-9• Multiword fixed-point data types

Page 183 - Documents

12Verifying Generated Code for aComponent

Page 184 - IBM Rational DOORS

12 Verifying Generated Code for a Component12-2Verify Generated Code for a ComponentIn this section...“About the Example Model” on page 12-2“Prepare t

Page 185

Verify Generated Code for a Component12-3The Model block references the slvnvdemo_powerwindow_controller model.The referenced model contains a Statef

Page 186

12 Verifying Generated Code for a Component12-4Prepare the Component for VerificationTo verify the referenced model slvnvdemo_powerwindow_controller,

Page 187 - IBM Rational DOORS

Verify Generated Code for a Component12-5slvnvlogsignals stores the logged signals in loggedSignalsPlant.5Generate an empty harness model so that you

Page 188

12 Verifying Generated Code for a Component12-66Save the name of the harness model for use later in this example:[~,harnessModel] = fileparts(harnessM

Page 189

Verify Generated Code for a Component12-72Add the new test case to the Signal Builder block in the harness model.signalBuilderBlock = slvnvdemo_signa

Page 190

1Getting Started• “Simulink Verification and Validation Product Description” on page 1-2• “System Requirements” on page 1-3

Page 191 - Diagnose and Fix DXL Errors

12 Verifying Generated Code for a Component12-8runopts = slvnvruntestopts;2Specify to simulate the model, and record coverage:runopts.coverageEnabled

Page 192 - Microsoft Office

Verify Generated Code for a Component12-9runcgvopts.cgvConn = 'sim';3Execute the slvnv_powerwindow_controller model using the two test case

Page 193 - Microsoft Office

12 Verifying Generated Code for a Component12-10 silout = cgvSil.getOutputData(i); [matchNames, ~, mismatchNames, ~ ] = ... cgv.CGV.compa

Page 194

Signal Monitoring withModel Verification Blocks

Page 196

13Using Model Verification Blocks• “Model Verification Blocks and the Verification Manager” on page 13-2• “Use Check Static Lower Bound Block to Check

Page 197

13 Using Model Verification Blocks13-2Model Verification Blocks and the Verification ManagerSimulink Model Verification library blocks monitor time-do

Page 198

Use Check Static Lower Bound Block to Check for Out-of-Bounds Signal13-3Use Check Static Lower Bound Block to Check for Out-of-BoundsSignalThe follow

Page 199

13 Using Model Verification Blocks13-46To verify the signal value, double-click the Scope block.

Page 200

Use Check Static Lower Bound Block to Check for Out-of-Bounds Signal13-57To disable the Check Static Lower Bound block from asserting its limit, clea

Page 201

1 Getting Started1-2Simulink Verification and Validation Product DescriptionVerify models and generated codeSimulink Verification and Validation autom

Page 202

13 Using Model Verification Blocks13-6Linear System Modeling Blocks in Simulink Control DesignIf you have Simulink Control Design software, you can:•

Page 203

14Constructing Simulation Tests Usingthe Verification Manager• “What Is the Verification Manager?” on page 14-2• “Construct Simulation Tests Using the

Page 204 - External Documents

14 Constructing Simulation Tests Using the Verification Manager14-2What Is the Verification Manager?The Verification Manager is a graphical interface

Page 205 - Editor”

Construct Simulation Tests Using the Verification Manager14-3Construct Simulation Tests Using the Verification ManagerIn this section...“View Model V

Page 206 - 8 MATLAB Code Traceability

14 Constructing Simulation Tests Using the Verification Manager14-4In the example model, the contents of the subsystem are as follows.aIn the Signal B

Page 207

Construct Simulation Tests Using the Verification Manager14-5bMake two copies of the signal group, so that you have three signal groups:Group 1, Grou

Page 208

14 Constructing Simulation Tests Using the Verification Manager14-64On the Signal Builder dialog box toolbar, select the Show Verification Settings to

Page 209

Construct Simulation Tests Using the Verification Manager14-7The Verification block settings pane lists all Model Verification blocks in themodel, gr

Page 210

14 Constructing Simulation Tests Using the Verification Manager14-8• Display > Active blocks only — If enabled, lists only the blocks that areenabl

Page 211

Construct Simulation Tests Using the Verification Manager14-9Enable and Disable Model Verification Blocks in a ModelUse the Verification Manager to e

Page 212

System Requirements1-3System RequirementsIn this section...“Operating System Requirements” on page 1-3“Product Requirements” on page 1-3Operating Sys

Page 213

14 Constructing Simulation Tests Using the Verification Manager14-10Because you enabled the Check Static Upper Bound1 block in the current group, anOv

Page 214

Construct Simulation Tests Using the Verification Manager14-11The Check Static Upper Bound2 block is no longer crossed out, indicating that theblock

Page 215

14 Constructing Simulation Tests Using the Verification Manager14-124Save the model with these changes.Enable and Disable Model Verification Blocks in

Page 216

Construct Simulation Tests Using the Verification Manager14-13Node Status Context Menu Options• Contents group enable• Contents group disable• Block

Page 217

14 Constructing Simulation Tests Using the Verification Manager14-14This option restores the individually enabled/disabled settings for each verificat

Page 218

Construct Simulation Tests Using the Verification Manager14-155From the Active Group list, select Group 1. Right-click the Check Static UpperBound no

Page 219

14 Constructing Simulation Tests Using the Verification Manager14-16Group 1 Group 2 (unchanged) Group 3

Page 220

Construct Simulation Tests Using the Verification Manager14-170.8 or lower. If the signal value reaches that value or falls below it, the simulations

Page 221

14 Constructing Simulation Tests Using the Verification Manager14-187To disable the Check Static Lower Bound block from asserting its limit, clear the

Page 222

Construct Simulation Tests Using the Verification Manager14-19Link Test Cases to Requirements Documents Using the VerificationManagerYou can link req

Page 223 - Custom Types of Requirements

Revision HistoryJune 2004 First printing New for Version 1.0 (Release 14)October 2004 Online only Revised for Version 1.0.1 (Release 14SP1)March 2005

Page 225 - Implement Custom Link Types

14 Constructing Simulation Tests Using the Verification Manager14-206To view the requirements document in its native editor, right-click a requirement

Page 228 - Link Type Properties

15Model Coverage Definition• “Model Coverage” on page 15-2• “Types of Model Coverage” on page 15-3• “Simulink Optimizations and Model Coverage” on pag

Page 229 - Link Type Properties

15 Model Coverage Definition15-2Model CoverageModel coverage helps you validate your model tests by measuring how thoroughly themodel objects are test

Page 230

Types of Model Coverage15-3Types of Model CoverageSimulink Verification and Validation software can perform several types of coverageanalysis.In this

Page 231

15 Model Coverage Definition15-4For an example of cyclomatic complexity data in a model coverage report, see “CyclomaticComplexity” on page 19-22.Cond

Page 232 - Custom Link Type Registration

Types of Model Coverage15-5indicating each interpolation. If the total number of breakpoints of an n-D Lookup Tableblock exceeds 1,500,000, the softw

Page 233

15 Model Coverage Definition15-6• Condition Coverage• Decision Coverage• MCDC CoverageWhen you collect coverage for a model, you may not be able to ac

Page 234

Types of Model Coverage15-7Data Type of Operand ToleranceFloating point, such as single or double max(absTol, relTol* max(|lhs|,|rhs|))• absTol is an

Page 235

Requirements Traceability

Page 236

15 Model Coverage Definition15-8• Which model objects receive this coverage, see the table in “Model Objects ThatReceive Coverage”.• How to obtain cov

Page 237

Types of Model Coverage15-9Signal Size CoverageSignal size coverage records the minimum, maximum, and allocated size for all variable-size signals in

Page 238

15 Model Coverage Definition15-10• Analyze the model and use the Proof Assumption block to verify any counterexamplesthat the Simulink Design Verifier

Page 239 - Create a Document Index

Simulink Optimizations and Model Coverage15-11Simulink Optimizations and Model CoverageIn the Configuration Parameters dialog box Optimization pane,

Page 240

15 Model Coverage Definition15-12Conditional input branch executionTo improve model execution when the model contains Switch and Multiport Switchblock

Page 241

16Model Objects That Receive ModelCoverage

Page 242

16 Model Objects That Receive Model Coverage16-2Model Objects That Receive CoverageCertain Simulink objects can receive any type of model coverage. Ot

Page 243

Model Objects That Receive Coverage16-3Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun

Page 244

16 Model Objects That Receive Model Coverage16-4Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelati

Page 245 - Generated Code

Model Objects That Receive Coverage16-5Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun

Page 247

16 Model Objects That Receive Model Coverage16-6Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelati

Page 248

Model Objects That Receive Coverage16-7Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun

Page 249

16 Model Objects That Receive Model Coverage16-8• The number of time steps that the block input is less than zero, indicating a truedecision.• The num

Page 250

Model Objects That Receive Coverage16-9table values. Because this block always has at least one value in the truth table asoutput, the minimum covera

Page 251

16 Model Objects That Receive Model Coverage16-10Data Type ConversionIf you select the Saturate on integer overflow coverage metric, the Data TypeConv

Page 252

Model Objects That Receive Coverage16-11Direct Lookup Table (n-D)The Direct Lookup Table (n-D) block receives lookup table coverage. For an n-dimensi

Page 253

16 Model Objects That Receive Model Coverage16-12• External reset• Limit outputIf you set External reset to none, the Simulink Verification and Valida

Page 254 - Component Verification

Model Objects That Receive Coverage16-13Dot ProductIf you select the Saturate on integer overflow coverage metric, the Dot Product blockreceives satu

Page 255 - Component Verification

16 Model Objects That Receive Model Coverage16-14If at least one time step is true and at least one time step is false, decision coverage is100%. If n

Page 256 - Unit testing

Model Objects That Receive Coverage16-15• The number of time steps that each input to a Boolean operator is false (equal tozero).If all Boolean opera

Page 257

2Links Between Models andRequirements• “Overview of the Requirements Management Interface (RMI)” on page 2-3• “Requirements Traceability Links” on pag

Page 258

16 Model Objects That Receive Model Coverage16-16If, If Action SubsystemThe If block that causes an If Action Subsystem to execute receives condition,

Page 259

Model Objects That Receive Coverage16-17increasing white-to-green color scale, with six evenly spaced data ranges starting withzero, indicates the nu

Page 260

16 Model Objects That Receive Model Coverage16-18of them independently set the output to true for at least one time step and how manyindependently set

Page 261

Model Objects That Receive Coverage16-19The total number of coverage points for a two-dimensional lookup table is the number ofrow break points in th

Page 262

16 Model Objects That Receive Model Coverage16-20Math FunctionIf you select the Saturate on integer overflow coverage metric, the Math Functionblock r

Page 263 - Component

Model Objects That Receive Coverage16-21In the Coverage Settings dialog box, select the referenced models for which you want toreport coverage. The s

Page 264 - About the Example Model

16 Model Objects That Receive Model Coverage16-22more information, see “Saturate on Integer Overflow Coverage”. The software treats eachelement of a v

Page 265

Model Objects That Receive Coverage16-23Rate LimiterThe Rate Limiter block receives decision coverage. The Simulink Verification andValidation softwa

Page 266 - slvnvlogsignals(

16 Model Objects That Receive Model Coverage16-24• the number of times that the specified relational operation was false.The Relational Operator block

Page 267

Model Objects That Receive Coverage16-25C/C++ S-FunctionModel coverage is supported for C/C++ S-Functions. The coverage report for the modelcontains

Page 268 - Create and Log Test Cases

2 Links Between Models and Requirements2-2• “Link Requirements to Simulink Data Dictionary Entries” on page 2-58

Page 269 - Record Coverage for Component

16 Model Objects That Receive Model Coverage16-26• C++ class templates are not instrumented for coverage.SaturationThe Saturation block receives decis

Page 270 - mergedTestCases,runopts);

Model Objects That Receive Coverage16-27“Saturate on Integer Overflow Coverage”. The software treats each element of a vector ormatrix as a separate

Page 271

16 Model Objects That Receive Model Coverage16-28• The number of time steps that the control input evaluates to true.• The number of time steps the co

Page 272

Model Objects That Receive Coverage16-29If all points and intervals defined in the block are satisfied for at least one time step,Simulink Design Ver

Page 273 - Model Verification Blocks

16 Model Objects That Receive Model Coverage16-30• The number of time steps that each element of the trigger port is false.The software reports condit

Page 274

Model Objects That Receive Coverage16-31100%. The software treats each element of the vector as a separate condition for MCDCcoverage measurement.Tru

Page 275

16 Model Objects That Receive Model Coverage16-32number of iterations to -1 (no limit), the decision coverage for the iteration limit istrue for all i

Page 276

Model Objects That Do Not Receive Coverage16-33Model Objects That Do Not Receive CoverageThe Simulink Verification and Validation software does not r

Page 278

17Setting Model Coverage Options• “Specify Model Coverage Options” on page 17-2• “Cumulative Coverage Data” on page 17-17

Page 279 - Enable assertion check box

Overview of the Requirements Management Interface (RMI)2-3Overview of the Requirements Management Interface (RMI)If you want to link Simulink and Sta

Page 280

17 Setting Model Coverage Options17-2Specify Model Coverage OptionsBefore starting a model coverage analysis, you must specify several model coverager

Page 281

Specify Model Coverage Options17-3Coverage for this modelInstructs the software to gather and report the model coverages that you specifyduring simul

Page 282

17 Setting Model Coverage Options17-4Subsystem button and the Coverage metrics section of the Coverage pane becomeavailable.Select SubsystemSpecifies

Page 283

Specify Model Coverage Options17-5Select ModelsClick to specify the referenced models for which the Simulink Verification and Validationsoftware reco

Page 284

17 Setting Model Coverage Options17-6The icon next to the model name indicates the simulation mode for that referencedmodel. You can select only refer

Page 285

Specify Model Coverage Options17-7Enable cumulative data collectionAccumulates model coverage results from successive simulations. Select this and Sa

Page 286

17 Setting Model Coverage Options17-8Clear dataRemoves existing internal cumulative coverage data. If cumulative coverage data issaved in a workspace

Page 287

Specify Model Coverage Options17-9Generate reportCreates an HTML report containing the coverage data collected from simulation. Clickthe Settings but

Page 288

17 Setting Model Coverage Options17-10Show reportSpecifies whether to open the generated HTML coverage report in a MATLAB browserwindow at the end of

Page 289

Specify Model Coverage Options17-11Option DescriptionDo not report fully covered modelobjectsThe coverage report includes only modelobjects that the

Page 290

2 Links Between Models and Requirements2-4Requirements Traceability LinksWhen you want to navigate from a Simulink model or from a region of MATLAB co

Page 291

17 Setting Model Coverage Options17-12Options TabOn the Options tab, select options for model coverage reports.Treat Simulink logic blocks as short-ci

Page 292

Specify Model Coverage Options17-13blocks as if the block ignores remaining inputs when the previous inputs alone determinethe block's output. F

Page 293

17 Setting Model Coverage Options17-14Restrict recording to intervalTo record model coverage only inside a specified simulation time interval, check R

Page 294

Specify Model Coverage Options17-15FilenameIf you enable coverage for this model, you can create a filter file or open an existing filterfile. In thi

Page 295

17 Setting Model Coverage Options17-16If the current model has a filter file already associated with it, the file name appearsin the Filename field, a

Page 296

Cumulative Coverage Data17-17Cumulative Coverage DataOn the Results tab, if you select Enable cumulative data collection and Savecumulative results i

Page 298

18Coverage Collection DuringSimulation• “Model Coverage Collection Workflow” on page 18-2• “Create and Run Test Cases” on page 18-3• “View Coverage Re

Page 299

18 Coverage Collection During Simulation18-2Model Coverage Collection WorkflowTo develop effective tests with model coverage:1Develop one or more test

Page 300

Create and Run Test Cases18-3Create and Run Test CasesTo create and run test cases, model coverage provides two MATLAB commands, cvtestand cvsim. The

Page 301

Requirements Link Storage2-5Requirements Link StorageWhen you create links from a model to external requirements, by default, theRequirements Managem

Page 302

18 Coverage Collection During Simulation18-4View Coverage Results in a ModelIn this section...“Overview of Model Coverage Highlighting” on page 18-4“E

Page 303

View Coverage Results in a Model18-5Enable Coverage HighlightingTo enable the model coverage colored diagram display:1In the Simulink Editor, select

Page 304 - Model Coverage

18 Coverage Collection During Simulation18-6Red: Partial CoverageIn this example, the control_logic Stateflow chart received the following coverage:•

Page 305 - Types of Model Coverage

View Coverage Results in a Model18-7In the next example, in the Multiport Switch block, two of the data ports were neverexecuted.

Page 306 - 15 Model Coverage Definition

18 Coverage Collection During Simulation18-8Gray: Filtered CoverageIn this example, the fuel_rate_control subsystem is highlighted in gray because it

Page 307 - Types of Model Coverage

View Coverage Results in a Model18-9• Close the window. Press Alt+F4.• Close the window and remove highlighting on the model. Select Display > Rem

Page 308

18 Coverage Collection During Simulation18-10Model Coverage for Multiple Instances of a Referenced ModelIn this section...“About Coverage for Model Bl

Page 309

Model Coverage for Multiple Instances of a Referenced Model18-11This model contains three Model blocks that reference thesldemo_mdlref_counter_datamn

Page 310

18 Coverage Collection During Simulation18-12models whose simulation mode is Normal. In this example, only the first Modelblock that references sldemo

Page 311 - Signal Size Coverage

Model Coverage for Multiple Instances of a Referenced Model18-13Note the following about the coverage for the Range Check subsystem in thisexample:•

Page 312

2 Links Between Models and Requirements2-6Supported Requirements Document TypesThe Requirements Management Interface (RMI) supports linking with exter

Page 313 - Block reduction

18 Coverage Collection During Simulation18-14• The DetectOverflow function executed 50 times. This script has five decisions.The DetectOverflow script

Page 314

Model Coverage for Multiple Instances of a Referenced Model18-15

Page 315 - Coverage

18 Coverage Collection During Simulation18-16Record Coverage for the Second Instance of the Referenced ModelRecord coverage for two Model blocks. Set

Page 316

Model Coverage for Multiple Instances of a Referenced Model18-174To make sure that the software records coverage for both instances of this model:aSe

Page 317

18 Coverage Collection During Simulation18-18• The DetectOverflow function executed 100 times. The simulation of theCounter2 block executed the Detect

Page 318

Model Coverage for Multiple Instances of a Referenced Model18-19

Page 319

18 Coverage Collection During Simulation18-20Model Coverage for MATLAB FunctionsIn this section...“About Model Coverage for MATLAB Functions” on page

Page 320

Model Coverage for MATLAB Functions18-21• Function header — Decision coverage is 100% if the function or local function isexecuted.• if — Decision co

Page 321

18 Coverage Collection During Simulation18-22For an example of coverage data for Simulink Design Verifier functions in a coveragereport, see “Simulink

Page 322 - Combinatorial Logic

Model Coverage for MATLAB Functions18-23To collect coverage for these functions, on the Coverage tab of the Coverage Settingsdialog box, select the S

Page 323 - Compare to Zero

Supported Requirements Document Types2-7RequirementsDocument TypeLocation OptionsIBM RationalDOORSPage/item number — The unique numeric ID of the tar

Page 324 - Dead Zone

18 Coverage Collection During Simulation18-24The coordinates for the origin of the moving test rectangle are represented by persistentdata x1 and y1,

Page 325 - Discrete-Time Integrator

Model Coverage for MATLAB Functions18-25The local function rect_intersect checks to see if its two rectangle argumentsintersect. Each argument consis

Page 326 - Discrete Transfer Fcn

18 Coverage Collection During Simulation18-26Coverage for the MATLAB Function run_intersect_testModel coverage for the MATLAB Function block function

Page 327 - Enabled Subsystem

Model Coverage for MATLAB Functions18-27Lines with coverage elements are marked by a highlighted line number in the listing:• Line 1 receives decisio

Page 328

18 Coverage Collection During Simulation18-28• Lines 27 and 30 receive decision, condition, and MCDC coverage for their ifstatements and conditions.Ea

Page 329

Model Coverage for MATLAB Functions18-29Coverage for Line 14The Decisions Analyzed table indicates that the local function rect_intersectexecuted dur

Page 330 - Interpolation Using Prelookup

18 Coverage Collection During Simulation18-30brings the total true occurrences for the decision to three, as reported in the Decisionsanalyzed table.M

Page 331 - Logical Operator

Model Coverage for MATLAB Functions18-31Because the line 27 decision evaluated false five times, line 30 is evaluated five times,three of which are f

Page 332 - 2-D Lookup Table

18 Coverage Collection During Simulation18-32Coverage for run_intersect_testOn the Details tab, the metrics that summarize coverage for the entirerun_

Page 333

Model Coverage for MATLAB Functions18-33• The MCDC coverage tables for decision lines 27 and 30 each list two cases of decisionreversal for each cond

Page 335 - Multiport Switch

2 Links Between Models and Requirements2-8RequirementsDocument TypeLocation OptionsWeb browser URL The RMI can link to a URL location. In the Document

Page 336 - Proof Objective

18 Coverage Collection During Simulation18-34• sldv.condition• sldv.test• sldv.assume• sldv.proveFor this example, consider the following model that c

Page 337 - Relational Operator

Model Coverage for MATLAB Functions18-35

Page 338

18 Coverage Collection During Simulation18-36For an example of model coverage data for Simulink Design Verifier blocks, see“Simulink Design Verifier C

Page 339 - C/C++ S-Function

Model Coverage for C and C++ S-Functions18-37Model Coverage for C and C++ S-FunctionsModel coverage is supported for C/C++ S-Functions. The coverage

Page 340 - Saturation Dynamic

18 Coverage Collection During Simulation18-38S-Function Using S-Function Builder1Copy an instance of the S-Function Builder block from the User-Define

Page 341

Model Coverage for C and C++ S-Functions18-39

Page 342 - Test Condition

18 Coverage Collection During Simulation18-40When you run a simulation, the coverage report contains coverage metrics for C/C++ S-Function blocks in y

Page 343 - Triggered Models

View Coverage Results for C/C++ Code in S-Function Blocks18-41View Coverage Results for C/C++ Code in S-Function BlocksThis example shows how to view

Page 344 - Triggered Subsystem

18 Coverage Collection During Simulation18-423Select each of the links in Table Of Contents to navigate to various sections of thereport.Section Title

Page 345 - Weighted Sample Time Math

View Coverage Results for C/C++ Code in S-Function Blocks18-434In the Summary section, select each file or function name to see details of coveragefo

Page 346

Supported Model Objects for Requirements Linking2-9Supported Model Objects for Requirements LinkingYou can associate requirements links between the f

Page 347

18 Coverage Collection During Simulation18-446To obtain an overview of the statements that were not covered, navigate to the Codesection. This section

Page 348

Model Coverage for Stateflow Charts18-45Model Coverage for Stateflow ChartsIn this section...“How Model Coverage Reports Work for Stateflow Charts” o

Page 349

18 Coverage Collection During Simulation18-46• Have a Stateflow license.• Have debugging/animation enabled for the chart.Specify Coverage Report Setti

Page 350 - Coverage Tab

Model Coverage for Stateflow Charts18-47For analysis purposes, each chart counts as a single component.Decision CoverageDecision coverage interprets

Page 351 - Coverage for this model

18 Coverage Collection During Simulation18-48Chart Containing Exclusive OR Substates DecisionIf the chart contains exclusive (OR) substates, the decis

Page 352

Model Coverage for Stateflow Charts18-49Context Example Decisions That Occurand not to the parent state A. Inthis case, the transition markedby condi

Page 353

18 Coverage Collection During Simulation18-50State with On Event_Name Action Statement DecisionA state that has an on event_name action statement must

Page 354 - Results Tab

Model Coverage for Stateflow Charts18-51Outcome A B C8 F F FFor more information, see “Transition Details Report Section” on page 18-59.MCDC Coverage

Page 355

18 Coverage Collection During Simulation18-52When you specify the Simulink Design Verifier coverage metric in the CoverageSettings dialog box, the Sim

Page 356 - Reporting Tab

Model Coverage for Stateflow Charts18-53Model Coverage Reports for Stateflow Charts• “Summary Report Section” on page 18-53• “Subsystem and Chart Det

Page 357 - Generate report

2 Links Between Models and Requirements2-10Selection-Based LinkingYou can use selection-based linking to create links from a model object to another m

Page 358

18 Coverage Collection During Simulation18-54Each line in the hierarchy summarizes the coverage results at that level and the levelsbelow it. You can

Page 359

Model Coverage for Stateflow Charts18-55• Coverage (this object): Coverage data for the chart as a container object• Coverage (inc.) descendants: Cov

Page 360 - Options Tab

18 Coverage Collection During Simulation18-56State Details Report SectionFor each state in a chart, the coverage report includes a State section with

Page 361

Model Coverage for Stateflow Charts18-57The coverage report includes a State section on the state On.

Page 362 - Filter Tab

18 Coverage Collection During Simulation18-58The decision coverage for the On state tests the decision of which substate to execute.The three decision

Page 363

Model Coverage for Stateflow Charts18-59• Under Previously active substate entered due to history, which substate toreenter when On re-executes. The

Page 364

18 Coverage Collection During Simulation18-60The decision for this transition depends on the time delay of 40 seconds and the condition[cold()]. If, a

Page 365 - Cumulative Coverage Data

Model Coverage for Stateflow Charts18-61decision to execute this transition and turn the Heater on is made. For other timeintervals or environment co

Page 366

18 Coverage Collection During Simulation18-62conditions. Therefore, condition rows 1 and 3 are shaded. While condition 2 has beentested, conditions 1

Page 367 - Simulation

Model Coverage for Stateflow Charts18-63Coverage results for state transition tables are the same as coverage results forequivalent Stateflow charts,

Page 368

Link to Requirements Document Using Selection-Based Linking2-11Link to Requirements Document Using Selection-Based LinkingTo create a link from a mod

Page 369 - Create and Run Test Cases

18 Coverage Collection During Simulation18-641Open the doc_atomic_subcharts_map_iodata model.This model contains two Sine Wave blocks that supply inpu

Page 370

Model Coverage for Stateflow Charts18-65• For the library chart A and its contents. The chart itself achieves 100% coverage onthe input u1, and 88% c

Page 371 - Enable Coverage Highlighting

18 Coverage Collection During Simulation18-66Model Coverage for Stateflow Truth Tables• “Types of Coverage in Stateflow Truth Tables” on page 18-66• “

Page 372 - Red: Partial Coverage

Model Coverage for Stateflow Charts18-67The Stateflow chart contains the following truth table:

Page 373

18 Coverage Collection During Simulation18-68When you simulate the model and collect coverage, the model coverage report includesthe following data:

Page 374 - Gray: Filtered Coverage

Model Coverage for Stateflow Charts18-69The Coverage (this object) column shows no coverage. The reason is that the containerobject for the truth tab

Page 375

18 Coverage Collection During Simulation18-70Note: See “How Stateflow Generates Content for Truth Tables” for a description of thegraphical function f

Page 376

Model Coverage for Stateflow Charts18-71Colored Stateflow Chart Coverage DisplayThe Model Coverage tool displays model coverage results for individua

Page 377

18 Coverage Collection During Simulation18-72Object highlighting indicates coverage as follows:• Light green for full coverage• Light red for partial

Page 378

Model Coverage for Stateflow Charts18-73When you click a highlighted Stateflow object, the summarized coverage for thatobject appears in the Coverage

Page 379

2 Links Between Models and Requirements2-12Configure RMI for IBM Rational DOORS or Microsoft ActiveXNavigationTo use the features of the Requirements

Page 381

19Results Review• “Types of Coverage Reports” on page 19-2• “Top-Level Model Coverage Report” on page 19-12• “Export Model Coverage Web View” on page

Page 382

19 Results Review19-2Types of Coverage ReportsIn the Coverage Settings dialog box, on the Report tab, if you select the GenerateHTML report option, th

Page 383

Types of Coverage Reports19-3Model Summary ReportIf the top-level model contains Model blocks or calls external files, the software creates amodel su

Page 384

19 Results Review19-4Model Reference Coverage ReportIf your top-level model references a model in a Model block, the software creates aseparate report

Page 385

Types of Coverage Reports19-5External MATLAB File Coverage ReportIf your top-level model calls any external MATLAB files, select Coverage for MATLABf

Page 386 - reset = 1;

19 Results Review19-6

Page 387

Types of Coverage Reports19-7The Details section reports coverage for the external file and the function in that file.The Details section also lists

Page 388

19 Results Review19-8

Page 389

Types of Coverage Reports19-9Coverage results for each of the highlighted code lines follow in the report. The followinggraphic shows a portion of th

Page 390 - Stationary

Requirements Traceability Link Editor2-13Requirements Traceability Link EditorIn this section...“Manage Requirements Traceability Links Using Link Ed

Page 391

19 Results Review19-10• The top-level model that includes the subsystemIf the subsystem parameter Read/Write Permissions is set to NoReadOrWrite, thes

Page 392

Types of Coverage Reports19-11Code Coverage ReportFor each S-Function block, the model coverage report links to a detailed code coveragereport for th

Page 393

19 Results Review19-12Top-Level Model Coverage ReportThe Simulink Verification and Validation software always creates a model coveragereport for the t

Page 394 - Coverage for Line 6

Top-Level Model Coverage Report19-13The coverage summary has two subsections:• Tests — The simulation start and stop time of each test case and any s

Page 395 - Coverage for Line 27

19 Results Review19-14DetailsThe Details section reports the detailed model coverage results. Each section of thedetailed report summarizes the result

Page 396 - Coverage for Line 30

Top-Level Model Coverage Report19-15• “Chart Details” on page 19-18• “Coverage Details for MATLAB Functions and Simulink Design Verifier Functions”on

Page 397

19 Results Review19-16Subsystem DetailsEach subsystem Details section contains a summary of the test coverage results for thesubsystem and a list of t

Page 398

Top-Level Model Coverage Report19-17Block DetailsThe following graphic shows decision coverage results for the MinMax block in theMixing & Combus

Page 399

19 Results Review19-18Chart DetailsThe following graphic shows the coverage results for the Stateflow chart control_logic inthe sldemo_fuelsys example

Page 400

Top-Level Model Coverage Report19-19Note: For a detailed example of coverage reports for external MATLAB files, see“External MATLAB File Coverage Rep

Page 401

2 Links Between Models and Requirements2-14In the Link Editor, you can:• Create requirements links from one or more Simulink model objects or MATLAB c

Page 402

19 Results Review19-20Coverage for the hFcnsInExternalEML function and the sldv.* calls is:• Line 1, the function declaration for hFcnsInExternalEMLis

Page 403

Top-Level Model Coverage Report19-21Line 4, sldv.assume(u1 > u2), achieves 0% coverage because u1 > u2 neverevaluates to true.• Line 5, sldv.co

Page 404

19 Results Review19-22• Line 17, sldv.test(y > u1); sldv.test (y == 4) achieves 50% coverage. Thefirst sldv.test call achieves 100% coverage, but t

Page 405

Top-Level Model Coverage Report19-23• The Summary section contains the cyclomatic complexity numbers for each object inthe model hierarchy. For a sub

Page 406 - More About

19 Results Review19-24Decisions AnalyzedThe Decisions analyzed table lists possible outcomes for a decision and the number oftimes that an outcome occ

Page 407

Top-Level Model Coverage Report19-25To display and highlight the block in question, click the block name at the top of thesection containing the bloc

Page 408

19 Results Review19-26MCDC AnalysisThe MC/DC analysis table lists the MCDC input condition cases represented by thecorresponding block and the extent

Page 409

Top-Level Model Coverage Report19-27• The position of a character in the string corresponds to the input port number.• The character at the position

Page 410

19 Results Review19-28• Current Run — The coverage results of the simulation just completed.• Delta — Percentage of coverage added to the cumulative c

Page 411

Top-Level Model Coverage Report19-29The Conditions analyzed table uses column headers #n T and #n F to indicate results forindividual test cases. The

Page 412 - Cyclomatic Complexity

Requirements Traceability Link Editor2-15Requirements TabOn the Requirements tab, you specify detailed information about the link, including:• Descri

Page 413 - Decision Coverage

19 Results Review19-30Note: You can calculate cumulative coverage for reusable subsystems and Stateflowconstructs at the command line. For more inform

Page 414

Top-Level Model Coverage Report19-31In this model, the lookup table indices are 1, 2,..., 10 in each direction. The Sine Wave 2block is out of phase

Page 415

19 Results Review19-32The report contains a two-dimensional table representing the elements of the lookuptable. The element indices are represented by

Page 416 - Condition Coverage

Top-Level Model Coverage Report19-33The selected cell is outlined in red. You can also click the extrapolation cells on the edgeof the table.A bold g

Page 417 - Relational Boundary Coverage

19 Results Review19-34Both the x and y table axes have the indices 1, 2,..., 10. The z axis has the indices 10,20,..., 50. Lookup table values are acc

Page 418

Top-Level Model Coverage Report19-35Lookup table coverage for a three-dimensional lookup table block is reported as a set oftwo-dimensional tables.Th

Page 419

19 Results Review19-36Block ReductionAll model coverage reports indicate the status of the Simulink Block reductionparameter at the beginning of the r

Page 420

Top-Level Model Coverage Report19-37If you set Force block reduction off, the report contains no coverage data for this blockbecause the minimum inpu

Page 421

19 Results Review19-38• “Relational Boundary Coverage”.• The Relational Boundary column in “Model Objects That Receive Coverage”.The tables below show

Page 422

Top-Level Model Coverage Report19-39Fixed pointIf one of the operands has fixed-point type and the other operand is either a fixed point oran integer

Page 423

2 Links Between Models and Requirements2-16Requirements SettingsYou can manage your RMI preferences in the Requirements Settings dialog box.These sett

Page 424

19 Results Review19-40For a relational operation such as operand_1 <= operand_2:• The first row states the two operands in the form operand_1 - ope

Page 425

Top-Level Model Coverage Report19-41Relational Operator Report Format Explanation[-tol..0)<[0..tol]0 is included in the regionabove the relational

Page 426

19 Results Review19-42To display and highlight the block in question, click the block name at the top of thesection containing the block’s Saturation

Page 427

Top-Level Model Coverage Report19-43Each block is reported in hierarchical fashion; child blocks appear directly under parentblocks. Each block name

Page 428

19 Results Review19-44Signal Size Coverage for Variable-Dimension SignalsIf you select Signal Size, the software creates a Variable Signal Widths sect

Page 429

Top-Level Model Coverage Report19-45Simulink Design Verifier CoverageIf you select Simulink Design Verifier, the analysis collects coverage data for

Page 430

19 Results Review19-46

Page 431

Export Model Coverage Web View19-47Export Model Coverage Web ViewYou can export a Model Coverage Web View for your model. A Web View is an interactiv

Page 432

19 Results Review19-48When you simulate your model with these coverage settings enabled, the softwaregenerates a Model Coverage Web View that you can

Page 433

Export Model Coverage Web View19-49coverage information for a block in a Model Coverage Web View, click that block. Themodel coverage data appears in

Page 434

Requirements Settings2-17Options DescriptionModify destination for bi-directionallinkingCreates links both to and from selected linkdestination.Store

Page 436

20Excluding Model Objects FromCoverage• “Coverage Filtering” on page 20-2• “Coverage Filter Rules and Files” on page 20-3• “Model Objects to Filter fr

Page 437

20 Excluding Model Objects From Coverage20-2Coverage FilteringIn this section...“What Is Coverage Filtering?” on page 20-2“When to Use Coverage Filter

Page 438

Coverage Filter Rules and Files20-3Coverage Filter Rules and FilesIn this section...“What Is a Coverage Filter Rule?” on page 20-3“What Is a Coverage

Page 439

20 Excluding Model Objects From Coverage20-4Model Objects to Filter from CoverageIn your model, the objects that you can filter from coverage recordin

Page 440

Create, Edit, and View Coverage Filter Rules20-5Create, Edit, and View Coverage Filter RulesIn this section...“Create and Edit Coverage Filter Rules”

Page 441

20 Excluding Model Objects From Coverage20-6If you select Coverage > ... The rule type is ...Exclude referenced library: <library_name> by li

Page 442 - Types of Coverage Reports

Create, Edit, and View Coverage Filter Rules20-7Note: The Rationale field is the only coverage filter rule field that you can edit in theCoverage Fil

Page 443 - Model Summary Report

20 Excluding Model Objects From Coverage20-8Save Coverage Filter to FileAfter you define the coverage filter rules, save the rules to a file so that y

Page 444 - 19 Results Review

Create, Edit, and View Coverage Filter Rules20-9To open the Coverage Filter Viewer, right-click anywhere in the model window and selectCoverage >

Page 445 - Types of Coverage Reports

vContentsGetting Started1Simulink Verification and Validation Product Description . 1-2Key Features . . . . . . . . . . . . . . . . . . . . . . . . .

Page 446

2 Links Between Models and Requirements2-18Link Model ObjectsIn this section...“Link Objects in the Same Model” on page 2-18“Link Objects in Different

Page 447

20 Excluding Model Objects From Coverage20-10Coverage Filter ViewerIn the Coverage Filter Viewer, you can:• Review and manage the coverage filter rule

Page 448

Coverage Filter Viewer20-11To ... Do this:Navigate to the model to create coveragefilter rules.Click Add new rule by right-clicking inthe model.Navig

Page 449 - Subsystem Coverage Report

20 Excluding Model Objects From Coverage20-12Filter Model Objects to Refine Coverage ResultsIn this section...“About the Example Model” on page 20-12“

Page 450

Filter Model Objects to Refine Coverage Results20-13When the simulation is complete, an HTML coverage report opens. This model does notrecord 100% co

Page 451 - Code Coverage Report

20 Excluding Model Objects From Coverage20-142Right-click the [!on] transition and select Coverage > Exclude this transition.The Coverage Filter Vi

Page 452

Filter Model Objects to Refine Coverage Results20-15If you open the Mode Logic chart and click the transition, the Informer windowdisplays filtering

Page 453

20 Excluding Model Objects From Coverage20-16

Page 454

Filter Model Objects to Refine Coverage Results20-17As a result, you cannot record 100% condition and MCDC coverage for the transitionafter(4, tick).

Page 455

20 Excluding Model Objects From Coverage20-18Click OK to close the Coverage Filter Viewer.5Simulate the model again and review the results.The Objects

Page 456

Filter Model Objects to Refine Coverage Results20-19With the tick event filtered from coverage analysis, there is no longer asubcondition on the deci

Page 457

Link Model Objects2-195Right-click the slvnvdemo_powerwindow_controller/control subsystem andselect Requirements Traceability. The new RMI link appea

Page 458

20 Excluding Model Objects From Coverage20-20• protected division1The library subsystem is a protection against division by zero and might not be rele

Page 459

Filter Model Objects to Refine Coverage Results20-21Exclude the Switchable config subsystem from coverage.1In the Simulink Editor, right-click the Sw

Page 461

21Automating Model Coverage Tasks• “Commands for Automating Model Coverage Tasks” on page 21-2• “Create Tests with cvtest” on page 21-3• “Run Tests wi

Page 462

21 Automating Model Coverage Tasks21-2Commands for Automating Model Coverage TasksUsing model coverage commands lets you automate the entire model cov

Page 463

Create Tests with cvtest21-3Create Tests with cvtestThe cvtest command creates a test specification object. Once you create the object, yousimulate i

Page 464

21 Automating Model Coverage Tasks21-4Field Descriptionsettings.overflowsaturation Set to 1 for saturate on integer overflowcoveragesettings.sigrange

Page 465 - Conditions Analyzed

Run Tests with cvsim21-5Run Tests with cvsimUse the cvsim command to simulate a test specification object.The call to cvsim has the following default

Page 466

21 Automating Model Coverage Tasks21-6You can also execute multiple test objects with the cvsim command. The followingcommand executes a set of covera

Page 467 - Cumulative Coverage

Retrieve Coverage Details from Results21-7Retrieve Coverage Details from ResultsSimulink Verification and Validation provides commands that allow you

Page 468

2 Links Between Models and Requirements2-20Link from External ApplicationsYou can navigate to Simulink objects or MATLAB code with requirements using

Page 469

21 Automating Model Coverage Tasks21-8Obtain Cumulative Coverage for Reusable Subsystems andStateflow® ConstructsThis example shows how to create and

Page 470

Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs21-9Get decision coverage for Subsystem 1Execute the commands for Subsyst

Page 471 - Table coverage

21 Automating Model Coverage Tasks21-10cvhtml('cum_subsystem',covobj3)Cumulative decision coverage for reusable subsystems Subsystem 1 and S

Page 472

Create HTML Reports with cvhtml21-11Create HTML Reports with cvhtmlOnce you run a test in simulation with cvsim, results are saved to cv.cvdatagroup

Page 473

21 Automating Model Coverage Tasks21-12Save Test Runs to File with cvsaveOnce you run a test with cvsim, save its coverage tests and results to a file

Page 474

Load Stored Coverage Test Results with cvload21-13Load Stored Coverage Test Results with cvloadThe cvload command loads into memory the coverage test

Page 475

21 Automating Model Coverage Tasks21-14Use Coverage Commands in a ScriptThe following script demonstrates some common model coverage commands.This scr

Page 476

Use Coverage Commands in a Script21-15decision_cov2 = decisioninfo(dataObj2,mdl_subsys);percent_cov2 = 100 * decision_cov2(1) / decision_cov2(2)cc_co

Page 478

Checking Systems with the Model Advisor

Page 479

Link Multiple Model Objects to a Requirements Document2-21Link Multiple Model Objects to a Requirements DocumentYou can link multiple Simulink and St

Page 481

22Checking Systems Interactively• “Check Model and Subsystems” on page 22-2• “Limit Model Checks” on page 22-3• “Limit Model Checks By Excluding Gain

Page 482

22 Checking Systems Interactively22-2Check Model and SubsystemsYou can use the Model Advisor to check a model or subsystem for adherence to modelinggu

Page 483

Limit Model Checks22-3Limit Model ChecksIn this section...“What Is a Model Advisor Exclusion?” on page 22-3“Model Advisor Exclusion Files” on page 22

Page 484

22 Checking Systems Interactively22-4To exclude blocks from specified checks during an analysis of your model, you first createexclusions and save the

Page 485

Limit Model Checks22-5To ... Select Model Advisor > ...Exclude the block from allchecks.Exclude block only > All ChecksExclude all blocks of th

Page 486

22 Checking Systems Interactively22-6the current folder. Optionally, in the Save Exclusion File dialog box, you can select adifferent file name or loc

Page 487

Limit Model Checks22-72In the Model Advisor window, click the Enable highlighting toggle button ( ).3In the left pane of the Model Advisor window, se

Page 488

22 Checking Systems Interactively22-8Note: The Rationale field is the only field that you can edit in the Model AdvisorExclusion Editor.Save Exclusion

Page 489

Limit Model Checks22-9Load an Exclusion FileTo load an existing exclusion file for use with your model:1In the Model Advisor Exclusion Editor dialog

Page 490

2 Links Between Models and Requirements2-22• Link to Selection in Excel• Link to Selection in DOORS5You can also add and edit links for multiple objec

Page 491 - Excluding Model Objects From

22 Checking Systems Interactively22-101Use get_param to obtain the model object. For example, for sldemo_mdladv:mo = get_param('sldemo_mdladv&apo

Page 492 - Coverage Filtering

Limit Model Checks By Excluding Gain and Outport Blocks22-11Limit Model Checks By Excluding Gain and Outport BlocksThis example shows how to exclude

Page 493

22 Checking Systems Interactively22-129After reviewing the check results, exclude the Gain2 block from all Model Advisorchecks:aIn the model window, r

Page 494

Limit Model Checks By Excluding Gain and Outport Blocks22-1310After reviewing the check results, exclude all Outport blocks from the Identifyunconnec

Page 495

22 Checking Systems Interactively22-14ports check. The sldemo_mdladv_exclusions file is updated with the Outportblock exclusions.11In the left pane of

Page 496

Limit Model Checks By Excluding Gain and Outport Blocks22-15• Model window. In the left pane of the Model Advisor window, select By Product> Simul

Page 497

22 Checking Systems Interactively22-16Model Checks for DO-178C/DO-331 Standard ComplianceYou can check that your model or subsystem complies with sele

Page 498 - Save Coverage Filter to File

Model Checks for DO-178C/DO-331 Standard Compliance22-17DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check safety-related

Page 499 - Remove Coverage Filter Rules

22 Checking Systems Interactively22-18DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check for blocks that do not link toreq

Page 500 - Coverage Filter Viewer

Model Checks for DO-178C/DO-331 Standard Compliance22-19DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check usage of Logic

Page 501 - Coverage Filter Viewer

Link Multiple Model Objects to a Requirements Document2-23

Page 502

22 Checking Systems Interactively22-20Model Checks for IEC 61508, ISO 26262, and EN 50128 StandardComplianceYou can check that your model or subsystem

Page 503 - Filter a Stateflow Transition

Model Checks for IEC 61508, ISO 26262, and EN 50128 Standard Compliance22-21IEC 61508, ISO 26262, and EN 50128 Checks Applicable High-Integrity Syste

Page 504

22 Checking Systems Interactively22-22IEC 61508, ISO 26262, and EN 50128 Checks Applicable High-Integrity System ModelingGuidelines“Check for MATLAB F

Page 505 - Filter a Stateflow Event

Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-23Model Checks for MathWorks Automotive Advisory Board (MAAB)Guide

Page 506

22 Checking Systems Interactively22-24By Task >ModelingStandards forMAAB subfolderMathWorks Automotive AdvisoryBoard (MAAB) CheckMAAB Control Algor

Page 507

Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-25By Task >ModelingStandards forMAAB subfolderMathWorks Automot

Page 508

22 Checking Systems Interactively22-26By Task >ModelingStandards forMAAB subfolderMathWorks Automotive AdvisoryBoard (MAAB) CheckMAAB Control Algor

Page 509

Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-27By Task >ModelingStandards forMAAB subfolderMathWorks Automot

Page 510 - Filter a Subsystem

22 Checking Systems Interactively22-28Model Checks for Requirements LinksTo check that every requirements link in your model has a valid target in a r

Page 511 - Filter a Specific Block

23Check Systems Programmatically• “Checking Systems Programmatically” on page 23-2• “Finding Check IDs” on page 23-3• “Create a Function for Checking

Page 512

2 Links Between Models and Requirements2-24Link Multiple Model Objects to a Requirement Document Using a SimulinkDocBlockThis example shows how to lin

Page 513

23 Check Systems Programmatically23-2Checking Systems ProgrammaticallyThe Simulink Verification and Validation product includes a programmable interfa

Page 514

Finding Check IDs23-3Finding Check IDsAn ID is a unique string that identifies a Model Advisor check. You find check IDs in theModel Advisor, using c

Page 515 - Create Tests with cvtest

23 Check Systems Programmatically23-4Create a Function for Checking Multiple SystemsThe following tutorial guides you through creating and testing a f

Page 516

Create a Function for Checking Multiple Systems23-59Save the function.10Test the function. In the MATLAB Command Window, run run_configuration.mon th

Page 517 - Run Tests with cvsim

23 Check Systems Programmatically23-6Check Multiple Systems in ParallelChecking multiple systems in parallel reduces the processing time required by t

Page 518

Create a Function for Checking Multiple Systems in Parallel23-7Create a Function for Checking Multiple Systems in ParallelIf you have a Parallel Comp

Page 519 - object, ignore_descendants)

23 Check Systems Programmatically23-88Run run_fast_configuration on the list of systems, specifying numParallel tobe the number of cores in your syste

Page 520 - Stateflow® Constructs

Archive and View Results23-9Archive and View ResultsYou can archive and view the results of running the Model Advisor programmatically asdescribed in

Page 521

23 Check Systems Programmatically23-10You can review additional results in the Command Window by calling theDisplayResults parameter when you run the

Page 522

Archive and View Results23-11To view the Model Advisor Command-Line Summary report after loading an object, usethe ModelAdvisor.summaryReport functio

Page 523

Link Multiple Model Objects to a Requirements Document2-25The link to the new requirements are on the top menu option.13To verify that the links were

Page 524

23 Check Systems Programmatically23-12View Model Advisor ReportFor a single system or check, you can view the same Model Advisor report that you acces

Page 525

Archive and View Model Advisor Run Results23-13Archive and View Model Advisor Run ResultsThe following example guides you through archiving the resul

Page 527

Customizing the Model Advisor

Page 529

24Overview of Customizing the ModelAdvisor

Page 530

24 Overview of Customizing the Model Advisor24-2Model Advisor CustomizationUsing Model Advisor APIs and the Model Advisor Configuration Editor, you ca

Page 531

25Create Model Advisor Checks• “Create Model Advisor Checks Workflow” on page 25-2• “Customization File Overview” on page 25-3• “Quick Start Examples”

Page 532 - Check Model and Subsystems

25 Create Model Advisor Checks25-2Create Model Advisor Checks Workflow1On your MATLAB path, create a customization file named sl_customization.m.In th

Page 533 - Limit Model Checks

Customization File Overview25-3Customization File OverviewA customization file is a MATLAB file that you create and name sl_customization.m.The sl_cu

Page 534

2 Links Between Models and Requirements2-26Link to Requirements in Microsoft Word DocumentsIn this section...“Create Bookmarks in a Microsoft Word Req

Page 535 - Limit Model Checks

25 Create Model Advisor Checks25-4Function Description When RequiredOne or more calls to checkactionsSpecifies actions the softwareperforms for custom

Page 536

Customization File Overview25-5

Page 537 - Manage Exclusions

25 Create Model Advisor Checks25-6Quick Start ExamplesIn this section...“Add Customized Check to By Product Folder” on page 25-6“Create Customized Pas

Page 538

Quick Start Examples25-75From the model window, select Analysis > Model Advisor > Model Advisor toopen the Model Advisor.6A System Selector — M

Page 539

25 Create Model Advisor Checks25-81In your working directory, update the sl_customization.m file, asshown below. This file registers and creates the c

Page 540

Quick Start Examples25-93It the Command Window, enter:sl_refresh_customizations4From the MATLAB window, select New > Model to open a new Simulink

Page 541

25 Create Model Advisor Checks25-1011Follow the Recommended Action to fix the failed Constant block. In the ModelAdvisor dialog box:• Double-click the

Page 542

Quick Start Examples25-11Create Customized Pass/Fail Check with Fix ActionThe following example shows how to create a Model Advisor pass/fail check w

Page 543

25 Create Model Advisor Checks25-12 'Text entry example'];rec.setAction(myAction);mdladvRoot.publish(rec, 'Demo'); % --- Simple

Page 544

Quick Start Examples25-13endft.setSubBar(0);result = ft;mdladvObj.setActionEnable(false);2Close the Model Advisor and your model if either are open.3

Page 545

Link to Requirements in Microsoft Word Documents2-276Open the document. The RMI populates the Document and Document type fields.7Click the Document I

Page 546

25 Create Model Advisor Checks25-1411In the Model Advisor Dialog box, enter a nonnumeric value in the Text entryexample parameter field in the Analysi

Page 547

Quick Start Examples25-1513In the Model Advisor dialog box, click Run This Check. Both constant blocks nowpass the check.See Also• “Register Checks a

Page 548

25 Create Model Advisor Checks25-16Create Check for Model Configuration ParametersIn this section...“Create Data File for Diagnostics Pane Configurati

Page 549

Create Check for Model Configuration Parameters25-17Create Data File for Diagnostics Pane Configuration Parameter CheckThis example shows how to crea

Page 550 - Compliance

25 Create Model Advisor Checks25-18fixvalue of error. When you run the configuration parameter check usingex_DataFile.xml, the check fails if the Bloc

Page 551

Create Check for Model Configuration Parameters25-19</customcheck>7Verify the data syntax with Advisor.authoring.DataFile.validate. At thecomma

Page 552

25 Create Model Advisor Checks25-20 rec = ModelAdvisor.Check('com.mathworks.Check1'); rec.Title = 'Example: Check model configurati

Page 553 - Guideline Compliance

Create Check for Model Configuration Parameters25-216From the model window, select Analysis > Model Advisor > Model Advisor toopen the Model Ad

Page 554

25 Create Model Advisor Checks25-22Data File for Configuration Parameter CheckYou use an XML data file to create a configuration parameter check. To c

Page 555

Create Check for Model Configuration Parameters25-23Within the <checkdata> tagging, the data file specifies two types of constraints:• <Posi

Page 556

vi ContentsLink to Requirements Document Using Selection-BasedLinking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Co

Page 557

2 Links Between Models and Requirements2-288Select the bookmark that you want to link the block to and click OK.The RMI creates a link from the block

Page 558

25 Create Model Advisor Checks25-24• dependson - Specifies a prerequisite subcheck. Optional. For example, to specify thatconfiguration parameter subc

Page 559

Create Check for Model Configuration Parameters25-25 <parameter>SolverType</parameter> <value>Fixed-step</value> <fixva

Page 560

25 Create Model Advisor Checks25-26 <fixvalue>Variable-step</value> <dependson>ID_B</value></NegativeModelParameterConstr

Page 561 - Finding Check IDs

Register Checks and Process Callbacks25-27Register Checks and Process CallbacksIn this section...“Create sl_customization Function” on page 25-27“Reg

Page 562

25 Create Model Advisor Checks25-28• addModelAdvisorCheckFcn (@checkDefinitionFcn)Registers the checks that you define in checkDefinitionFcn to the By

Page 563

Register Checks and Process Callbacks25-29and Value properties. For example, you can remove, rename, and selectively displaychecks and tasks in the B

Page 564

25 Create Model Advisor Checks25-30Define Custom ChecksIn this section...“About Custom Checks” on page 25-30“Contents of Check Definitions” on page 25

Page 565

Define Custom Checks25-31Contents DescriptionCheck ID (required) Uniquely identifies the check. The ModelAdvisor uses this id to access the check.Han

Page 566 - % Run on 2 cores

25 Create Model Advisor Checks25-32Display and Enable ChecksYou can create a check and specify how it appears in the Model Advisor. You can definewhen

Page 567 - Archive and View Results

Define Custom Checks25-33Visible?Do notdisplaycheckor taskIgnoreEnable and ValuepropertiesfalsetrueEnabled?falsetrueDisplaycheckor taskwith activeche

Page 568

Link to Requirements in Microsoft Word Documents2-29• Enable Modify destination for bi-directional linking.When you select this option, every time yo

Page 569 - Archive and View Results

25 Create Model Advisor Checks25-34Check Definition FunctionThe following is an example of a function that defines the custom checks associated withth

Page 570 - View Model Advisor Report

Define Custom Checks25-35must define one instance of this class for each input parameter that you want to add to aModel Advisor check.Note: You do no

Page 571

25 Create Model Advisor Checks25-36instance of this class for each list view that you want to add to a Model Advisor ResultExplorer window.Note: You d

Page 572

Create Callback Functions and Results25-37Create Callback Functions and ResultsIn this section...“About Callback Functions” on page 25-37“Common Util

Page 573

25 Create Model Advisor Checks25-38Utility Used for...find_system Getting handle or path to:• Blocks• Lines• AnnotationsWhen getting the object, you c

Page 574

Create Callback Functions and Results25-39Argument I/O Type Descriptionresult Output MATLAB string that supports Model AdvisorFormatting API calls or

Page 575

25 Create Model Advisor Checks25-40Here is an example of a detailed check callback function that checks optimizationsettings for simulation and code g

Page 576 - Model Advisor Customization

Create Callback Functions and Results25-41Argument I/O Type Descriptionsystem Input Path to the model or system analyzed bythe Model Advisor.ResultDe

Page 577

25 Create Model Advisor Checks25-42 returnendregularFontSize = str2double(regularFontSize);if regularFontSize<1 || regularFontSize>=99 mdl

Page 578

Create Callback Functions and Results25-43 mdladvObj.setListViewParameters... ({mdladvObj.getListViewParameters{:}, myLVParam}); needEna

Page 579 - Customization File Overview

2 Links Between Models and Requirements2-30This dialog box contains the following information for the link you just created:• Description of the link,

Page 580

25 Create Model Advisor Checks25-44Format Model Advisor Results• “Overview of Displaying Results” on page 25-44• “Format Model Advisor Results” on pag

Page 581 - Customization File Overview

Create Callback Functions and Results25-45Format TextText is the simplest form of output. You can format text in many different ways. Thedefault text

Page 582 - Quick Start Examples

25 Create Model Advisor Checks25-46• Bold title, row, and column headingsChange table formatting using the ModelAdvisor.Table constructor.The followin

Page 583 - Quick Start Examples

Create Callback Functions and Results25-47 table1.setRowHeading(n, ['Row ', num2str(n)]);end% set Table contentfor rowIndex=1:5 for c

Page 584

25 Create Model Advisor Checks25-48function result = SampleStyleOneCallback(system)mdladvObj = Simulink.ModelAdvisor.getModelAdvisor(system);if strcmp

Page 585

Exclude Blocks From Custom Checks25-49Exclude Blocks From Custom ChecksThis example shows how to exclude blocks from custom checks. To save timedurin

Page 586

25 Create Model Advisor Checks25-50• After both instances of searchResult =mdladvObj.filterResultWithExclusion(searchResult);, addsearchResult = setdi

Page 587

Exclude Blocks From Custom Checks25-5111In the model window, right-click the Input block and select Model Advisor >Exclude block only > Check

Page 588

25 Create Model Advisor Checks25-52Model Advisor Code ExamplesIn this section...“Register Custom Checks and Process Callbacks” on page 25-52“Process C

Page 589

Model Advisor Code Examples25-53% Defines actions to execute at startup and post-executionfunction [checkCellArray taskCellArray] = ... ModelAdvis

Page 590

Link to Requirements in Microsoft Word Documents2-31• The type and identifier of the location in the requirements document. With selection-based link

Page 591

25 Create Model Advisor Checks25-54inputParam2.Name = 'Standard font size';inputParam2.Value='12';inputParam2.Type='String&ap

Page 592

Model Advisor Code Examples25-55The following code, when included in a check definition function, adds the ExploreResult button to the check in the M

Page 593

25 Create Model Advisor Checks25-56Informational Check Callback FunctionThe following code is an example of a callback function for a custom informati

Page 594

Model Advisor Code Examples25-57function resultDescription = modelVersionChecksumCallbackUsingFT(system)resultDescription = [];system = getfullname(s

Page 595

25 Create Model Advisor Checks25-58Basic Check with Pass/Fail StatusHere is an example of a callback function for a custom basic check that finds and

Page 596

Model Advisor Code Examples25-59% Basic checks do not have subresults, supress linesetSubBar(ft,false);% Check for unconnected lines, inputs, and out

Page 597

25 Create Model Advisor Checks25-60 setRecAction(ft,'Connect the specified blocks.'); % Create a list of handles to problem objects

Page 598

Model Advisor Code Examples25-61% Title and description of first subchecksetSubTitle(ft1,'Verify Block reduction setting');setInformation(f

Page 599

25 Create Model Advisor Checks25-62 ResultStatus = false;endResultDescription{end+1} = ft2; % Pass list template object to Model AdvisormdladvObj.s

Page 600

26Create Custom Configurations byOrganizing Checks and Folders• “Create Custom Configurations” on page 26-2• “Create Configurations by Organizing Chec

Page 601

2 Links Between Models and Requirements2-32Link to Requirements in IBM Rational DOORS DatabasesThis example shows how to create links from objects in

Page 602

26 Create Custom Configurations by Organizing Checks and Folders26-2Create Custom ConfigurationsYou can use the Model Advisor APIs and Model Advisor C

Page 603

Create Configurations by Organizing Checks and Folders26-3Create Configurations by Organizing Checks and FoldersTo customize the Model Advisor with M

Page 604 - Functions

26 Create Custom Configurations by Organizing Checks and Folders26-4Create Procedural-Based ConfigurationsYou can create a procedural-based configurat

Page 605

Organize Checks and Folders Using the Model Advisor Configuration Editor26-5Organize Checks and Folders Using the Model AdvisorConfiguration EditorIn

Page 606 - Define Custom Checks

26 Create Custom Configurations by Organizing Checks and Folders26-6Model Advisor Configuration EditorWhen you select a folder or check in the Model A

Page 607 - Define Custom Checks

Organize Checks and Folders Using the Model Advisor Configuration Editor26-7The Model Advisor Check Browser window includes a read-only list of avail

Page 608 - Display and Enable Checks

26 Create Custom Configurations by Organizing Checks and Folders26-8Model Advisor Check BrowserUsing the Model Advisor Configuration Editor, you can p

Page 609

Organize Checks and Folders Using the Model Advisor Configuration Editor26-9To... Select...Edit > Move downThe check or folder and drag and dropRe

Page 610 - Define Check Input Parameters

26 Create Custom Configurations by Organizing Checks and Folders26-101To include custom checks in the new Model Advisor configuration, update theSimul

Page 611

Organize Checks and Folders Using the Model Advisor Configuration Editor26-116In the right pane, edit Display Name to rename the folder. For the purp

Page 612 - Define Check Actions

Link to Requirements in IBM Rational DOORS Databases2-33If you navigate to a DOORS requirement, the DOORS module opens in read onlymode. If you want

Page 613 - About Callback Functions

26 Create Custom Configurations by Organizing Checks and Folders26-12Organize Customization File Checks and FoldersIn this section...“Customization Fi

Page 614

Organize Customization File Checks and Folders26-13Function Description Required or OptionalOne or more groups Defines custom groups (see“Define Cust

Page 615

26 Create Custom Configurations by Organizing Checks and Folders26-14function sl_customization(cm)The customization manager object includes methods fo

Page 616

Organize Customization File Checks and Folders26-15Add Check to Custom or Multiple Folders Using TasksYou can use custom tasks for adding checks to t

Page 617

26 Create Custom Configurations by Organizing Checks and Folders26-16Define Where Tasks AppearYou can specify where the Model Advisor places tasks wit

Page 618

Organize Customization File Checks and Folders26-17Define Where Custom Folders AppearYou can specify the location of custom folders within the Model

Page 619 - Action Callback Function

26 Create Custom Configurations by Organizing Checks and Folders26-18Verify and Use Custom ConfigurationsIn this section...“Update the Environment to

Page 620 - Format Model Advisor Results

Verify and Use Custom Configurations26-19Folders Using the Model Advisor Configuration Editor” on page 26-10, selectoptimization_configuration.mat.6W

Page 621

26 Create Custom Configurations by Organizing Checks and Folders26-20Model Advisor Code ExamplesIn this section...“Register Custom Tasks and Folders”

Page 622

Model Advisor Code Examples26-21mdladvRoot.register(MAT1);% Define task that uses Sample Check 2: Basic Check with Pass/Fail StatusMAT2 = ModelAdviso

Page 623

2 Links Between Models and Requirements2-34Link to Requirements in Microsoft Excel WorkbooksIn this section...“Navigate from a Model Object to Require

Page 624

26 Create Custom Configurations by Organizing Checks and Folders26-22rec = ModelAdvisor.FactoryGroup('com.mathworks.sample.factorygroup');re

Page 625

27Create Procedural-Based ModelAdvisor Configurations• “Create Procedures” on page 27-2• “Create a Procedural-Based Configuration” on page 27-5

Page 626

27 Create Procedural-Based Model Advisor Configurations27-2Create ProceduresIn this section...“What Is a Procedure?” on page 27-2“Create Procedures Us

Page 627

Create Procedures27-3Add Subprocedures and Tasks to ProceduresYou can add subprocedures or tasks to a procedure. The tasks are wrappers for checks.•

Page 628 - Model Advisor Code Examples

27 Create Procedural-Based Model Advisor Configurations27-4MAP2=ModelAdvisor.Procedure('com.mathworks.example.procedure_sub2');MAP3=ModelAdv

Page 629 - Input Parameter Definition

Create a Procedural-Based Configuration27-5Create a Procedural-Based ConfigurationIn this example, you examine a procedural-based configuration.1At t

Page 630 - List View Definition

27 Create Procedural-Based Model Advisor Configurations27-6MAT6 = ModelAdvisor.Task('com.mathworks.sample.TaskSample6'); MAT6.DisplayName=&a

Page 631 - Action Definition

Create a Procedural-Based Configuration27-78In the Action section of the Model Advisor dialog box, click Fix block fonts.9In the left pane of the Mod

Page 633 - Model Advisor Code Examples

28Deploy Custom Configurations• “Overview of Deploying Custom Configurations” on page 28-2• “How to Deploy Custom Configurations” on page 28-3• “Manua

Page 634

Link to Requirements in Microsoft Excel Workbooks2-35You will link the speed sensor block to the Speed Sensor Failure information inthe Microsoft Exc

Page 635

28 Deploy Custom Configurations28-2Overview of Deploying Custom ConfigurationsIn this section...“About Deploying Custom Configurations” on page 28-2“D

Page 636

How to Deploy Custom Configurations28-3How to Deploy Custom ConfigurationsTo deploy a custom configuration:1Determine which files to distribute. You

Page 637

28 Deploy Custom Configurations28-4Manually Load and Set the Default ConfigurationWhen you use the Model Advisor, you can load any configuration. Once

Page 638

Automatically Load and Set the Default Configuration28-5Automatically Load and Set the Default ConfigurationWhen you use the Model Advisor, you can a

Page 640 - Create Custom Configurations

2 Links Between Models and Requirements2-364Use the Link Editor to specify information about the Microsoft Excel requirementsdocument, the requirement

Page 641

Link to Requirements in Microsoft Excel Workbooks2-372In the Description field, enter:MAP sensor test scenarioThe User tag field contains the tag tes

Page 642

viiChange Requirements Links . . . . . . . . . . . . . . . . . . . . 2-36Link to Requirements in MuPAD Notebooks . . . . . . . . 2-39Create Requiremen

Page 643 - Configuration Editor

2 Links Between Models and Requirements2-38Note: For more information about user tags, see “Filter Requirements with UserTags” on page 4-25.3Click App

Page 644

Link to Requirements in MuPAD Notebooks2-39Link to Requirements in MuPAD NotebooksThis example shows how to create a link from a Simulink model to a

Page 645

2 Links Between Models and Requirements2-40This figure shows two link targets.Note: These link targets are in a MuPAD notebook that was created for th

Page 646

Link to Requirements in MuPAD Notebooks2-41The Requirements tab reopens, displaying the details of the newly created link.Unless you have previously

Page 647

2 Links Between Models and Requirements2-42Create Requirements Traceability Report for ModelTo create the default requirements report for a Simulink m

Page 648

Create Requirements Traceability Report for Model2-43A typical requirements report includes:• Table of contents• List of tables• Per-subsystem sectio

Page 649

2 Links Between Models and Requirements2-44Link to Requirements Modeled in SimulinkYou can use Simulink to model your design requirements. For example

Page 650

Link to Requirements Modeled in Simulink2-45Verification Subsystems for Power Window Controller ModelOpen the verification model, 'Power Window

Page 651 - Register Tasks and Folders

2 Links Between Models and Requirements2-462Requirement 2 (Autodown feature) - If the driver presses the down button for lessthan 1 second, the contro

Page 652 - Define Custom Tasks

Link to Requirements Modeled in Simulink2-47

Page 653

viii ContentsReviewing Requirements4Highlight Model Objects with Requirements . . . . . . . . . 4-2Highlight Model Objects with Requirements Using Mod

Page 654 - Define Custom Folders

2 Links Between Models and Requirements2-48Create RMI Link to a Simulink ObjectCreate an RMI link from Verification Subsystem2 to the emergencyDown st

Page 655 - Customization Example

Link to Requirements Modeled in Simulink2-491Right-click on this group of objects, select Requirements > Select for linkingwith Simulink. Be caref

Page 656 - Verify Custom Configurations

2 Links Between Models and Requirements2-505Right-click each input and select Requirements to display new links. Click the newlink, confirm that NAND

Page 657

Link to Requirements Modeled in Simulink2-51Highlight and Report RMI Links Between Simulink ObjectsCreate RMI links to Simulink objects in the same w

Page 658

2 Links Between Models and Requirements2-52CleanupClose all open models. Do not save changes.close_system('slvnvdemo_powerwindowController',

Page 659 - Group Definition

Requirements Linking with Simulink Annotations2-53Requirements Linking with Simulink AnnotationsYou can create requirements links to and from Simulin

Page 660

2 Links Between Models and Requirements2-54Link Signal Builder Blocks to Requirements DocumentsYou can create links from a signal group in a Signal Bu

Page 661 - Advisor Configurations

Link Signal Builder Blocks to Requirements Documents2-559Next to the Location drop-down list, enter User Input Requirements.10Click Apply to create t

Page 662 - Create Procedures

2 Links Between Models and Requirements2-56Link Signal Builder Blocks to Model ObjectsThis example shows how to create links from a signal group in a

Page 663

Link Signal Builder Blocks to Model Objects2-5710Click Apply to create the link.11In the model window, select the User Inputs block, right-click, and

Page 664

ixHow the rmi Function Checks a RequirementsDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3Validate Requirements Links

Page 665

2 Links Between Models and Requirements2-58Link Requirements to Simulink Data Dictionary EntriesYou can create requirements traceability links for ent

Page 666

Link Requirements to Simulink Data Dictionary Entries2-595Open the airflow_calc subsystem and select the Pumping Constant lookuptable.6In the Model E

Page 668

3How Is Requirements Link InformationStored?• “External Storage” on page 3-2• “Guidelines for External Storage of Requirements Links” on page 3-3• “Sp

Page 669

3 How Is Requirements Link Information Stored?3-2External StorageThe first time you create links to requirements in a Simulink model, the RMI uses you

Page 670

Guidelines for External Storage of Requirements Links3-3Guidelines for External Storage of Requirements LinksIf you decide to store requirements link

Page 671

3 How Is Requirements Link Information Stored?3-4Specify Storage for Requirements LinksBy default, the Requirements Management Interface (RMI) stores

Page 672

Save Requirements Links in External Storage3-5Save Requirements Links in External StorageThe Requirements Management Interface (RMI) stores externall

Page 673

3 How Is Requirements Link Information Stored?3-6Load Requirements Links from External StorageWhen you open a Simulink model that does not have intern

Page 674

Move Internally Stored Requirements Links to External Storage3-7Move Internally Stored Requirements Links to External StorageIf you have a model with

Commentaires sur ces manuels

Pas de commentaire