Simulink® Verification and Validation™User's GuideR2015a
x ContentsAdvantages of Synchronizing Your Model with aSurrogate Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-4Synchronize a Sim
3 How Is Requirements Link Information Stored?3-8Move Externally Stored Requirements Links to the Model FileIf you have a model with requirements link
4Reviewing Requirements• “Highlight Model Objects with Requirements” on page 4-2• “Navigate to Requirements from Model” on page 4-5• “Customize Requir
4 Reviewing Requirements4-2Highlight Model Objects with RequirementsYou can highlight a model to see which objects in the model have links to requirem
Highlight Model Objects with Requirements4-3Objects that do not have requirements are colored gray.3To remove the highlighting from the model, select
4 Reviewing Requirements4-41Open the example model:slvnvdemo_fuelsys_officereq2Select View > Model Explorer.3To highlight all model objects with r
Navigate to Requirements from Model4-5Navigate to Requirements from ModelIn this section...“Navigate from Model Object” on page 4-5“Navigate from Sys
4 Reviewing Requirements4-61Open the example model:slvnvdemo_fuelsys_officereq2In the Simulink Editor, select Analysis > Requirements Traceability
Customize Requirements Traceability Report for Model4-7Customize Requirements Traceability Report for ModelIn this section...“Create Default Requirem
4 Reviewing Requirements4-81Select Analysis > Requirements Traceability > Generate Report.The Requirements Management Interface (RMI) searches t
Customize Requirements Traceability Report for Model4-9List of TablesThe List of Tables includes links to each table in the report.
xiMicrosoft Office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-10Why Add Navigation Objects to Microsoft OfficeRequirements? . .
4 Reviewing Requirements4-10Model InformationThe Model Information contains general information about the model, such as whenthe model was created and
Customize Requirements Traceability Report for Model4-11• ID — The ID. In this example, DOC1, DOC2, DOC3, and DOC4 are short names forthe requirement
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
Customize Requirements Traceability Report for Model4-13• A list of blocks in the top-level model that have requirements. In this example, onlythe MA
4 Reviewing Requirements4-14ChartEach Chart section reports on requirements in Stateflow charts, and includes:• A graphic of the Stateflow chart that
Customize Requirements Traceability Report for Model4-15Report for Requirements in Model BlocksIf your model contains Model blocks that reference ext
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
Customize Requirements Traceability Report for Model4-17Customize Requirements ReportThe Requirements Management Interface (RMI) uses the Simulink Re
4 Reviewing Requirements4-18On the Report tab, select options that specify the contents that you want in the report.Requirements Settings Report Optio
Customize Requirements Traceability Report for Model4-19Requirements Settings Report Option Descriptionprevents long path names to requirementsdocume
xii ContentsCustom Types of Requirements Documents9Why Create a Custom Link Type? . . . . . . . . . . . . . . . . . . 9-2Implement Custom Link Types .
4 Reviewing Requirements4-205To close the Requirements Settings dialog box, click Close.6Generate a requirements report by selecting Analysis > Req
Customize Requirements Traceability Report for Model4-21Requirements Document Format Includes in the ReportUse the RptgenRMI.doorsAttribs functionto
4 Reviewing Requirements4-22Simulink Report Generator Component Report InformationMissing Requirements Block Loop Applies all child components to bloc
Customize Requirements Traceability Report for Model4-23System Design Description ReportThe System Design Description report describes a system desig
4 Reviewing Requirements4-24on page 4-7. This menu option is equivalent to Analysis > RequirementsTraceability > Generate Report.To specify opti
Filter Requirements with User Tags4-25Filter Requirements with User TagsIn this section...“User Tags and Requirements Filtering” on page 4-25“Apply a
4 Reviewing Requirements4-26
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
4 Reviewing Requirements4-284To enable filtering with user tags, click the Filter links by user tags whenhighlighting and reporting requirements optio
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
xiiiModel Component TestingOverview of Component Verification11Component Verification . . . . . . . . . . . . . . . . . . . . . . . . . 11-2Component
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
Filter Requirements with User Tags4-31The selection-based linking options specify which user tags the RMI applies to thelink that you create. In the
4 Reviewing Requirements4-32Option DescriptionApply same filters in consistencycheckingIncludes or excludes requirements withspecified user tags when
Create Requirements Traceability Report for Simulink Project4-33Create Requirements Traceability Report for Simulink ProjectTo create a report for re
4 Reviewing Requirements4-34View Requirements Details for a Selected BlockIn this section...“Requirements Details Workflow” on page 4-34“Requirements
View Requirements Details for a Selected Block4-35documents stored on network drives, and documents with Microsoft Office Trust CenterActiveX control
5Requirements Links Maintenance• “Validation of Requirements Links” on page 5-2• “Validate Requirements Links in a Model” on page 5-4• “Validate Requi
5 Requirements Links Maintenance5-2Validation of Requirements LinksRequirements links in a model can become outdated when requirements changeover time
Validation of Requirements Links5-3How the rmi Function Checks a Requirements Documentrmi performs the following actions:• Locates all links to Simul
xiv ContentsSignal Monitoring with Model Verification BlocksUsing Model Verification Blocks13Model Verification Blocks and the VerificationManager . .
5 Requirements Links Maintenance5-4Validate Requirements Links in a ModelIn this section...“Check Requirements Links with the Model Advisor” on page 5
Validate Requirements Links in a Model5-5Consistency Check Problem Identified• Microsoft Excel documents• IBM Rational DOORS documents• Simulink obje
5 Requirements Links Maintenance5-6continue the checks. The consistency checks must verify up-to-date stored copiesof the requirements documents.• If
Validate Requirements Links in a Model5-7Fix Invalid Requirements Links Detected by the Model AdvisorIn “Check Requirements Links with the Model Advi
5 Requirements Links Maintenance5-8• In the Location field, specify a valid location in the requirements document.• Delete the requirements link by se
Validate Requirements Links in a Model5-9The first message indicated that the model contains a link to a bookmark namedSimulink_requirement_item_7 in
5 Requirements Links Maintenance5-10seconds, then back to 10 degrees over the next two seconds. This cyclerepeats continuously while the engine is hel
Validate Requirements Links in a Requirements Document5-11Validate Requirements Links in a Requirements DocumentIn this section...“Check Links in a R
5 Requirements Links Maintenance5-12If you want to... Do the following...Fix the invalid links Follow the instructions in “Fix InvalidLinks in a Requi
Validate Requirements Links in a Requirements Document5-13link for that requirement. To rerun the check so that all requirements are checked, atthe t
xvModel Coverage AnalysisModel Coverage Definition15Model Coverage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15-2Types of Model
5 Requirements Links Maintenance5-14To... Click...Navigate to and select a new target model or newtarget objects for these broken links.Fix allReset t
Document Path Storage5-15Document Path StorageWhen you create a requirements link, the RMI stores the location of the requirementsdocument with the l
5 Requirements Links Maintenance5-16Model file C:\work\models\controllers\pid.mdlRequirements document pid.htmlDocuments searched for(in order)C:\work
Delete Requirements Links from Simulink Objects5-17Delete Requirements Links from Simulink ObjectsIn this section...“Delete a Single Link from a Simu
5 Requirements Links Maintenance5-18Delete All Links from Multiple Simulink ObjectsTo delete all requirements links from a group of Simulink model obj
Requirements Links for Library Blocks and Reference Blocks5-19Requirements Links for Library Blocks and Reference BlocksIn this section...“Introducti
5 Requirements Links Maintenance5-20Copy Library Blocks with RequirementsWhen you copy a library subsystem or masked block to a model, you can highlig
Requirements Links for Library Blocks and Reference Blocks5-21Manage Requirements Inside Reference BlocksIf your library block is a subsystem or a St
5 Requirements Links Maintenance5-22S1LibrarylinkLibraryS1LibraryblockReferenceblockModel 12Disable the library link between the reference block and t
Requirements Links for Library Blocks and Reference Blocks5-23aSelect the reference block.bSelect Diagram > Library Link > Resolve Link.cIn the
xvi ContentsDiscrete FIR Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 16-11Discrete-Time Integrator . . . . . . . . . . . . . . . . . .
5 Requirements Links Maintenance5-24Requirements documentLibrary modelRequirementS1S1S1LibrarylinkLibrarylinkLink torequirementLink torequirementLin
Requirements Links for Library Blocks and Reference Blocks5-25Requirements documentLibraryRequirementB1Links to and froma requirementLibraryblockWh
6IBM Rational DOORS SurrogateModule Synchronization• “Synchronization with DOORS Surrogate Modules” on page 6-2• “Advantages of Synchronizing Your Mod
6 IBM Rational DOORS Surrogate Module Synchronization6-2Synchronization with DOORS Surrogate ModulesSynchronization is a user-initiated process that c
Synchronization with DOORS Surrogate Modules6-320020220320420520620720811.11.1.11.1.21.1.31.21.2.11.3ModelSubsystemBlockBlockBlockSubsystemBlockBlock
6 IBM Rational DOORS Surrogate Module Synchronization6-4Advantages of Synchronizing Your Model with a SurrogateModuleSynchronizing your Simulink model
Synchronize a Simulink Model to Create a Surrogate Module6-5Synchronize a Simulink Model to Create a Surrogate ModuleThe first time that you synchron
6 IBM Rational DOORS Surrogate Module Synchronization6-6After synchronization with the None option, the surrogate module, a formal modulenamed sf_car_
Create Links Between Surrogate Module and Formal Module in a DOORS Database6-7Create Links Between Surrogate Module and Formal Module in aDOORS Datab
xviiWhile Iterator, While Iterator Subsystem . . . . . . . . . 16-31Model Objects That Do Not Receive Coverage . . . . . . 16-33Setting Model Coverage
6 IBM Rational DOORS Surrogate Module Synchronization6-8Customize DOORS SynchronizationIn this section...“DOORS Synchronization Settings” on page 6-8“
Customize DOORS Synchronization6-9DOORS Settings Option DescriptionCopy unmatched links During synchronization, selecting the followingoptions has th
6 IBM Rational DOORS Surrogate Module Synchronization6-10DOORS Settings Option DescriptionSave Simulink model (recommended) After the synchronization,
Customize DOORS Synchronization6-114Click Continue to create a new surrogate module with the new path or name.Customize the Level of Detail in Synchr
6 IBM Rational DOORS Surrogate Module Synchronization6-12Drop-Down List Option DescriptionModerate - Unmaskedsubsystems, Stateflow charts,and supersta
Customize DOORS Synchronization6-134Update the surrogate module to include all objects in your model. To do this, underExtra mapping additionally to
6 IBM Rational DOORS Surrogate Module Synchronization6-146Scroll through the surrogate module. Notice that the objects with requirements (theengine to
Resynchronize DOORS Surrogate Module to Reflect Model Changes6-15Resynchronize DOORS Surrogate Module to Reflect ModelChangesIf you change your model
6 IBM Rational DOORS Surrogate Module Synchronization6-165Delete the copied object (vehicle mph (yellow) & throttle %1 and resynchronize themodel.
Navigate with the Surrogate Module6-17Navigate with the Surrogate ModuleIn this section...“Navigate Between Requirements and the Surrogate Module in
xviii ContentsHow to Collect Coverage for MATLAB Functions . . . . 18-22Examples: Model Coverage for MATLAB Functions . . 18-23Model Coverage for C an
6 IBM Rational DOORS Surrogate Module Synchronization6-182Select the object name.The surrogate module for sf_car_doors opens, at the object associated
Navigate with the Surrogate Module6-19Navigate from a Requirement to the Model via the Surrogate ModuleTo navigate from the Transmission Requirements
7Navigation from RequirementsDocuments• “IBM Rational DOORS” on page 7-2• “Microsoft Office” on page 7-10
7 Navigation from Requirements Documents7-2IBM Rational DOORSIn this section...“Why Add Navigation Objects to DOORS Requirements?” on page 7-2“Configu
IBM Rational DOORS7-3Follow the instructions in “Configure RMI for IBM Rational DOORS or Microsoft ActiveXNavigation” on page 2-12.Manually Install A
7 Navigation from Requirements Documents7-4bIn a text editor, open the copiedFromDoors7.dxl file.cAdd // before this line to comment it out:#include &
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
7 Navigation from Requirements Documents7-66Close the model.Note: When you navigate to a DOORS requirement from outside the software, theDOORS module
IBM Rational DOORS7-7Customize DOORS Navigation ObjectsIf the RMI is configured to modify destination for bi-directional linking as described in“Enab
xixDecisions Analyzed . . . . . . . . . . . . . . . . . . . . . . . . . . 19-24Conditions Analyzed . . . . . . . . . . . . . . . . . . . . . . . . . 1
7 Navigation from Requirements Documents7-8Navigate Between DOORS Requirement and Model ObjectIn “Insert Navigation Objects into DOORS Requirements” o
IBM Rational DOORS7-9Diagnose and Fix DXL ErrorsIf you try to synchronize your Simulink model to a DOORS project, you might see thefollowing errors:-
7 Navigation from Requirements Documents7-10Microsoft OfficeIn this section...“Why Add Navigation Objects to Microsoft Office Requirements?” on page 7
Microsoft Office7-11To enable linking from a Microsoft Office document to the example model:1Open the model:slvnvdemo_fuelsys_officereqNote: You can
7 Navigation from Requirements Documents7-122Select the Throttle Sensor header.3In the slvnvdemo_fuelsys_officereq model, open the engine gas dynamics
Microsoft Office7-13Note: In Microsoft Office requirements documents, following a navigation object linkhighlights the Simulink object that contains
7 Navigation from Requirements Documents7-142In the requirements document, next to Throttle Sensor, follow the navigationobject link.The engine gas dy
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
7 Navigation from Requirements Documents7-16Note: You might need to enable ActiveX controls in the Microsoft Office Trust Center.Field Codes in Requir
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
How to Contact MathWorksLatest news:www.mathworks.comSales and services:www.mathworks.com/sales_and_servicesUser community:www.mathworks.com/matlabcen
xx ContentsFilter a Stateflow Event . . . . . . . . . . . . . . . . . . . . . . 20-15Filter Library Reference Blocks . . . . . . . . . . . . . . . . .
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
Microsoft Office7-195Select the setting that you want for ActiveX controls:• Prompt me for enabling all controls with minimal restrictions todecide e
7 Navigation from Requirements Documents7-202In the pane that opens, at the bottom, click Excel Options.3In the Microsoft Excel Options dialog box, in
8MATLAB Code Traceability• “Link Between MATLAB Code Lines and Requirements Information in ExternalDocuments” on page 8-2• “Enable or Disable Highligh
8 MATLAB Code Traceability8-2Link Between MATLAB Code Lines and Requirements Information inExternal DocumentsIn this section...“Create Link Using Cont
Link Between MATLAB Code Lines and Requirements Information in External Documents8-3• From the context menu, select Requirements Traceability > Op
8 MATLAB Code Traceability8-4Enable or Disable Highlighting of Traceability Links for MATLABCodeIn this section...“Enable Traceability Highlighting of
Remove Traceability Links from MATLAB Code Lines8-5Remove Traceability Links from MATLAB Code LinesIn this section...“Delete Links to Requirements fr
8 MATLAB Code Traceability8-6Traceability for MATLAB Code LinesIn this section...“Traceability Link Targets” on page 8-6“Storage of Traceability Links
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
xxiLimit Model Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22-3What Is a Model Advisor Exclusion? . . . . . . . . . . . . . . 22-
8 MATLAB Code Traceability8-8Associate Traceability Information with MATLAB Code Lines inSimulinkTraceability management support in the MATLAB Editor
Associate Traceability Information with MATLAB Code Lines in Simulink8-9Two MATLAB Functions between neurons calculate post-synaptic currents. Whenpr
8 MATLAB Code Traceability8-10
Associate Traceability Information with MATLAB Code Lines in Simulink8-11
8 MATLAB Code Traceability8-12Simulate Model and View ResultsSimulate slvnvdemo_synaptic_transmission model. Check Scope for results. The six plotsare
Associate Traceability Information with MATLAB Code Lines in Simulink8-13file and navigate back to Simulink by selecting the shortcut in the Requirem
8 MATLAB Code Traceability8-14
Associate Traceability Information with MATLAB Code Lines in Simulink8-15Create Traceability Link for Lines of Code Inside MATLAB Function BlocksThe
8 MATLAB Code Traceability8-16
Associate Traceability Information with MATLAB Code Lines in Simulink8-17Report Traceability LinksTraceability links associated with MATLAB code line
xxii ContentsView Results in Model Advisor GUI . . . . . . . . . . . . . 23-11View Model Advisor Report . . . . . . . . . . . . . . . . . . . . 23-12A
8 MATLAB Code Traceability8-18
Associate Traceability Information with MATLAB Code Lines in Simulink8-19
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
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
Implement Custom Link Types9-3Implement Custom Link TypesTo implement a custom link type:1Create a MATLAB function file based on the custom link type
9 Custom Types of Requirements Documents9-4Custom Link Type FunctionsTo create a MATLAB function file, start with the custom link type template, locat
Links and Link Types9-5Links and Link TypesRequirements links are the data structures, managed by Simulink, that identify aspecific location within a
9 Custom Types of Requirements Documents9-6Link Type PropertiesLink type properties define how links are created, identified, navigated to, and stored
Link Type Properties9-7Property DescriptionContentsFcn The MATLAB callback invoked when you click the DocumentIndex tab in the Requirements Traceabil
xxiiiRegister Checks and Process Callbacks . . . . . . . . . . . 25-27Define Startup and Post-Execution Actions Using ProcessCallback Functions . . .
9 Custom Types of Requirements Documents9-8Property DescriptionIsValidIdFcn The MATLAB callback invoked when you run a requirementsconsistency check.
Link Type Properties9-9Property DescriptionDetailsFcn The MATLAB callback invoked when you generate therequirements report with the Include details f
9 Custom Types of Requirements Documents9-10Custom Link Type RegistrationRegister your custom link type by passing the name of the MATLAB function fil
Create a Custom Requirements Link Type9-11Create a Custom Requirements Link TypeIn this example, you implement a custom link type to a hypothetical d
9 Custom Types of Requirements Documents9-12 % Create a default (blank) requirement link type linkType = ReqMgr.LinkType; linkType.Registrati
Create a Custom Requirements Link Type9-13function [labels, depths, locations] = ContentsFcn(filePath) % Read the entire file into a variable f
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
Create a Custom Requirements Link Type9-15ENd of "Autopilot Disable"Requirement:: "Glide Slope Armed"Glide Slope Control is armed
9 Custom Types of Requirements Documents9-16negative of the user setting. End of "Glide Slope Coupled"5Open the following example model:aero
Create a Custom Requirements Link Type9-17Note: The rmi reference page describes other types of requirements locationdelimiters.The Location drop-dow
xxiv ContentsCreate Custom Configurations by OrganizingChecks and Folders26Create Custom Configurations . . . . . . . . . . . . . . . . . . . . 26-2Cr
9 Custom Types of Requirements Documents9-18
Custom Link Type Synchronization9-19Custom Link Type SynchronizationSimulink Verification and Validation provides an API for synchronization of links
9 Custom Types of Requirements Documents9-20Navigate to Simulink Objects from External DocumentsThe RMI includes several functions that simplify creat
Navigate to Simulink Objects from External Documents9-21Use the ActiveX Navigation ControlThe RMI uses software that includes a special Microsoft Act
9 Custom Types of Requirements Documents9-225Create a navigation item in the external document using the scripting capability ofthe external tool. Set
10Requirements Information inGenerated Code• “How Requirements Information Is Included in Generated Code” on page 10-2• “Generate Code for Models with
10 Requirements Information in Generated Code10-2How Requirements Information Is Included in Generated CodeAfter you simulate your model and verify it
How Requirements Information Is Included in Generated Code10-3Model Object with Requirement Location of Code Comments with RequirementsLinksNonsubsys
10 Requirements Information in Generated Code10-4Generate Code for Models with Requirements LinksTo specify that generated code of an ERT target inclu
Generate Code for Models with Requirements Links10-511Click the link Clock period shall be consistent with chirp toleranceto open the HTML requiremen
xxvCreate Procedural-Based Model AdvisorConfigurations27Create Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27-2What Is a Pr
Model Component Testing
11Overview of Component Verification• “Component Verification” on page 11-2• “Basic Approach to Component Verification” on page 11-4• “Functions for C
11 Overview of Component Verification11-2Component VerificationIn this section...“Component Verification Approaches” on page 11-2“Simulink Verificatio
Component Verification11-3components individually, you can create test cases that fully specify the componentinterface, allowing the component to rec
11 Overview of Component Verification11-4Basic Approach to Component VerificationIn this section...“Workflow for Component Verification” on page 11-4“
Basic Approach to Component Verification11-5• For closed-loop simulations, verify a component within the context of its containermodel by logging the
11 Overview of Component Verification11-6Verify a Component Independently of the Container ModelUse component analysis to verify:• Model blocks• Atomi
Basic Approach to Component Verification11-7Verify a Model Block in the Context of the Container ModelUse system analysis to verify a Model block in
11 Overview of Component Verification11-8Functions for Component VerificationThe Simulink Verification and Validation software provides several functi
Functions for Component Verification11-9• Multiword fixed-point data types
12Verifying Generated Code for aComponent
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
Verify Generated Code for a Component12-3The Model block references the slvnvdemo_powerwindow_controller model.The referenced model contains a Statef
12 Verifying Generated Code for a Component12-4Prepare the Component for VerificationTo verify the referenced model slvnvdemo_powerwindow_controller,
Verify Generated Code for a Component12-5slvnvlogsignals stores the logged signals in loggedSignalsPlant.5Generate an empty harness model so that you
12 Verifying Generated Code for a Component12-66Save the name of the harness model for use later in this example:[~,harnessModel] = fileparts(harnessM
Verify Generated Code for a Component12-72Add the new test case to the Signal Builder block in the harness model.signalBuilderBlock = slvnvdemo_signa
1Getting Started• “Simulink Verification and Validation Product Description” on page 1-2• “System Requirements” on page 1-3
12 Verifying Generated Code for a Component12-8runopts = slvnvruntestopts;2Specify to simulate the model, and record coverage:runopts.coverageEnabled
Verify Generated Code for a Component12-9runcgvopts.cgvConn = 'sim';3Execute the slvnv_powerwindow_controller model using the two test case
12 Verifying Generated Code for a Component12-10 silout = cgvSil.getOutputData(i); [matchNames, ~, mismatchNames, ~ ] = ... cgv.CGV.compa
Signal Monitoring withModel Verification Blocks
13Using Model Verification Blocks• “Model Verification Blocks and the Verification Manager” on page 13-2• “Use Check Static Lower Bound Block to Check
13 Using Model Verification Blocks13-2Model Verification Blocks and the Verification ManagerSimulink Model Verification library blocks monitor time-do
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
13 Using Model Verification Blocks13-46To verify the signal value, double-click the Scope block.
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
1 Getting Started1-2Simulink Verification and Validation Product DescriptionVerify models and generated codeSimulink Verification and Validation autom
13 Using Model Verification Blocks13-6Linear System Modeling Blocks in Simulink Control DesignIf you have Simulink Control Design software, you can:•
14Constructing Simulation Tests Usingthe Verification Manager• “What Is the Verification Manager?” on page 14-2• “Construct Simulation Tests Using the
14 Constructing Simulation Tests Using the Verification Manager14-2What Is the Verification Manager?The Verification Manager is a graphical interface
Construct Simulation Tests Using the Verification Manager14-3Construct Simulation Tests Using the Verification ManagerIn this section...“View Model V
14 Constructing Simulation Tests Using the Verification Manager14-4In the example model, the contents of the subsystem are as follows.aIn the Signal B
Construct Simulation Tests Using the Verification Manager14-5bMake two copies of the signal group, so that you have three signal groups:Group 1, Grou
14 Constructing Simulation Tests Using the Verification Manager14-64On the Signal Builder dialog box toolbar, select the Show Verification Settings to
Construct Simulation Tests Using the Verification Manager14-7The Verification block settings pane lists all Model Verification blocks in themodel, gr
14 Constructing Simulation Tests Using the Verification Manager14-8• Display > Active blocks only — If enabled, lists only the blocks that areenabl
Construct Simulation Tests Using the Verification Manager14-9Enable and Disable Model Verification Blocks in a ModelUse the Verification Manager to e
System Requirements1-3System RequirementsIn this section...“Operating System Requirements” on page 1-3“Product Requirements” on page 1-3Operating Sys
14 Constructing Simulation Tests Using the Verification Manager14-10Because you enabled the Check Static Upper Bound1 block in the current group, anOv
Construct Simulation Tests Using the Verification Manager14-11The Check Static Upper Bound2 block is no longer crossed out, indicating that theblock
14 Constructing Simulation Tests Using the Verification Manager14-124Save the model with these changes.Enable and Disable Model Verification Blocks in
Construct Simulation Tests Using the Verification Manager14-13Node Status Context Menu Options• Contents group enable• Contents group disable• Block
14 Constructing Simulation Tests Using the Verification Manager14-14This option restores the individually enabled/disabled settings for each verificat
Construct Simulation Tests Using the Verification Manager14-155From the Active Group list, select Group 1. Right-click the Check Static UpperBound no
14 Constructing Simulation Tests Using the Verification Manager14-16Group 1 Group 2 (unchanged) Group 3
Construct Simulation Tests Using the Verification Manager14-170.8 or lower. If the signal value reaches that value or falls below it, the simulations
14 Constructing Simulation Tests Using the Verification Manager14-187To disable the Check Static Lower Bound block from asserting its limit, clear the
Construct Simulation Tests Using the Verification Manager14-19Link Test Cases to Requirements Documents Using the VerificationManagerYou can link req
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
14 Constructing Simulation Tests Using the Verification Manager14-206To view the requirements document in its native editor, right-click a requirement
Model Coverage Analysis
15Model Coverage Definition• “Model Coverage” on page 15-2• “Types of Model Coverage” on page 15-3• “Simulink Optimizations and Model Coverage” on pag
15 Model Coverage Definition15-2Model CoverageModel coverage helps you validate your model tests by measuring how thoroughly themodel objects are test
Types of Model Coverage15-3Types of Model CoverageSimulink Verification and Validation software can perform several types of coverageanalysis.In this
15 Model Coverage Definition15-4For an example of cyclomatic complexity data in a model coverage report, see “CyclomaticComplexity” on page 19-22.Cond
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
15 Model Coverage Definition15-6• Condition Coverage• Decision Coverage• MCDC CoverageWhen you collect coverage for a model, you may not be able to ac
Types of Model Coverage15-7Data Type of Operand ToleranceFloating point, such as single or double max(absTol, relTol* max(|lhs|,|rhs|))• absTol is an
Requirements Traceability
15 Model Coverage Definition15-8• Which model objects receive this coverage, see the table in “Model Objects ThatReceive Coverage”.• How to obtain cov
Types of Model Coverage15-9Signal Size CoverageSignal size coverage records the minimum, maximum, and allocated size for all variable-size signals in
15 Model Coverage Definition15-10• Analyze the model and use the Proof Assumption block to verify any counterexamplesthat the Simulink Design Verifier
Simulink Optimizations and Model Coverage15-11Simulink Optimizations and Model CoverageIn the Configuration Parameters dialog box Optimization pane,
15 Model Coverage Definition15-12Conditional input branch executionTo improve model execution when the model contains Switch and Multiport Switchblock
16Model Objects That Receive ModelCoverage
16 Model Objects That Receive Model Coverage16-2Model Objects That Receive CoverageCertain Simulink objects can receive any type of model coverage. Ot
Model Objects That Receive Coverage16-3Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun
16 Model Objects That Receive Model Coverage16-4Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelati
Model Objects That Receive Coverage16-5Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun
16 Model Objects That Receive Model Coverage16-6Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelati
Model Objects That Receive Coverage16-7Model Object Decision Condition MCDC LookupTableSimulinkDesignVerifierSaturateon IntegerOverflowRelationalBoun
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
Model Objects That Receive Coverage16-9table values. Because this block always has at least one value in the truth table asoutput, the minimum covera
16 Model Objects That Receive Model Coverage16-10Data Type ConversionIf you select the Saturate on integer overflow coverage metric, the Data TypeConv
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
16 Model Objects That Receive Model Coverage16-12• External reset• Limit outputIf you set External reset to none, the Simulink Verification and Valida
Model Objects That Receive Coverage16-13Dot ProductIf you select the Saturate on integer overflow coverage metric, the Dot Product blockreceives satu
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
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
2Links Between Models andRequirements• “Overview of the Requirements Management Interface (RMI)” on page 2-3• “Requirements Traceability Links” on pag
16 Model Objects That Receive Model Coverage16-16If, If Action SubsystemThe If block that causes an If Action Subsystem to execute receives condition,
Model Objects That Receive Coverage16-17increasing white-to-green color scale, with six evenly spaced data ranges starting withzero, indicates the nu
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
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
16 Model Objects That Receive Model Coverage16-20Math FunctionIf you select the Saturate on integer overflow coverage metric, the Math Functionblock r
Model Objects That Receive Coverage16-21In the Coverage Settings dialog box, select the referenced models for which you want toreport coverage. The s
16 Model Objects That Receive Model Coverage16-22more information, see “Saturate on Integer Overflow Coverage”. The software treats eachelement of a v
Model Objects That Receive Coverage16-23Rate LimiterThe Rate Limiter block receives decision coverage. The Simulink Verification andValidation softwa
16 Model Objects That Receive Model Coverage16-24• the number of times that the specified relational operation was false.The Relational Operator block
Model Objects That Receive Coverage16-25C/C++ S-FunctionModel coverage is supported for C/C++ S-Functions. The coverage report for the modelcontains
2 Links Between Models and Requirements2-2• “Link Requirements to Simulink Data Dictionary Entries” on page 2-58
16 Model Objects That Receive Model Coverage16-26• C++ class templates are not instrumented for coverage.SaturationThe Saturation block receives decis
Model Objects That Receive Coverage16-27“Saturate on Integer Overflow Coverage”. The software treats each element of a vector ormatrix as a separate
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
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
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
Model Objects That Receive Coverage16-31100%. The software treats each element of the vector as a separate condition for MCDCcoverage measurement.Tru
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
Model Objects That Do Not Receive Coverage16-33Model Objects That Do Not Receive CoverageThe Simulink Verification and Validation software does not r
17Setting Model Coverage Options• “Specify Model Coverage Options” on page 17-2• “Cumulative Coverage Data” on page 17-17
Overview of the Requirements Management Interface (RMI)2-3Overview of the Requirements Management Interface (RMI)If you want to link Simulink and Sta
17 Setting Model Coverage Options17-2Specify Model Coverage OptionsBefore starting a model coverage analysis, you must specify several model coverager
Specify Model Coverage Options17-3Coverage for this modelInstructs the software to gather and report the model coverages that you specifyduring simul
17 Setting Model Coverage Options17-4Subsystem button and the Coverage metrics section of the Coverage pane becomeavailable.Select SubsystemSpecifies
Specify Model Coverage Options17-5Select ModelsClick to specify the referenced models for which the Simulink Verification and Validationsoftware reco
17 Setting Model Coverage Options17-6The icon next to the model name indicates the simulation mode for that referencedmodel. You can select only refer
Specify Model Coverage Options17-7Enable cumulative data collectionAccumulates model coverage results from successive simulations. Select this and Sa
17 Setting Model Coverage Options17-8Clear dataRemoves existing internal cumulative coverage data. If cumulative coverage data issaved in a workspace
Specify Model Coverage Options17-9Generate reportCreates an HTML report containing the coverage data collected from simulation. Clickthe Settings but
17 Setting Model Coverage Options17-10Show reportSpecifies whether to open the generated HTML coverage report in a MATLAB browserwindow at the end of
Specify Model Coverage Options17-11Option DescriptionDo not report fully covered modelobjectsThe coverage report includes only modelobjects that the
2 Links Between Models and Requirements2-4Requirements Traceability LinksWhen you want to navigate from a Simulink model or from a region of MATLAB co
17 Setting Model Coverage Options17-12Options TabOn the Options tab, select options for model coverage reports.Treat Simulink logic blocks as short-ci
Specify Model Coverage Options17-13blocks as if the block ignores remaining inputs when the previous inputs alone determinethe block's output. F
17 Setting Model Coverage Options17-14Restrict recording to intervalTo record model coverage only inside a specified simulation time interval, check R
Specify Model Coverage Options17-15FilenameIf you enable coverage for this model, you can create a filter file or open an existing filterfile. In thi
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
Cumulative Coverage Data17-17Cumulative Coverage DataOn the Results tab, if you select Enable cumulative data collection and Savecumulative results i
18Coverage Collection DuringSimulation• “Model Coverage Collection Workflow” on page 18-2• “Create and Run Test Cases” on page 18-3• “View Coverage Re
18 Coverage Collection During Simulation18-2Model Coverage Collection WorkflowTo develop effective tests with model coverage:1Develop one or more test
Create and Run Test Cases18-3Create and Run Test CasesTo create and run test cases, model coverage provides two MATLAB commands, cvtestand cvsim. The
Requirements Link Storage2-5Requirements Link StorageWhen you create links from a model to external requirements, by default, theRequirements Managem
18 Coverage Collection During Simulation18-4View Coverage Results in a ModelIn this section...“Overview of Model Coverage Highlighting” on page 18-4“E
View Coverage Results in a Model18-5Enable Coverage HighlightingTo enable the model coverage colored diagram display:1In the Simulink Editor, select
18 Coverage Collection During Simulation18-6Red: Partial CoverageIn this example, the control_logic Stateflow chart received the following coverage:•
View Coverage Results in a Model18-7In the next example, in the Multiport Switch block, two of the data ports were neverexecuted.
18 Coverage Collection During Simulation18-8Gray: Filtered CoverageIn this example, the fuel_rate_control subsystem is highlighted in gray because it
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
18 Coverage Collection During Simulation18-10Model Coverage for Multiple Instances of a Referenced ModelIn this section...“About Coverage for Model Bl
Model Coverage for Multiple Instances of a Referenced Model18-11This model contains three Model blocks that reference thesldemo_mdlref_counter_datamn
18 Coverage Collection During Simulation18-12models whose simulation mode is Normal. In this example, only the first Modelblock that references sldemo
Model Coverage for Multiple Instances of a Referenced Model18-13Note the following about the coverage for the Range Check subsystem in thisexample:•
2 Links Between Models and Requirements2-6Supported Requirements Document TypesThe Requirements Management Interface (RMI) supports linking with exter
18 Coverage Collection During Simulation18-14• The DetectOverflow function executed 50 times. This script has five decisions.The DetectOverflow script
Model Coverage for Multiple Instances of a Referenced Model18-15
18 Coverage Collection During Simulation18-16Record Coverage for the Second Instance of the Referenced ModelRecord coverage for two Model blocks. Set
Model Coverage for Multiple Instances of a Referenced Model18-174To make sure that the software records coverage for both instances of this model:aSe
18 Coverage Collection During Simulation18-18• The DetectOverflow function executed 100 times. The simulation of theCounter2 block executed the Detect
Model Coverage for Multiple Instances of a Referenced Model18-19
18 Coverage Collection During Simulation18-20Model Coverage for MATLAB FunctionsIn this section...“About Model Coverage for MATLAB Functions” on page
Model Coverage for MATLAB Functions18-21• Function header — Decision coverage is 100% if the function or local function isexecuted.• if — Decision co
18 Coverage Collection During Simulation18-22For an example of coverage data for Simulink Design Verifier functions in a coveragereport, see “Simulink
Model Coverage for MATLAB Functions18-23To collect coverage for these functions, on the Coverage tab of the Coverage Settingsdialog box, select the S
Supported Requirements Document Types2-7RequirementsDocument TypeLocation OptionsIBM RationalDOORSPage/item number — The unique numeric ID of the tar
18 Coverage Collection During Simulation18-24The coordinates for the origin of the moving test rectangle are represented by persistentdata x1 and y1,
Model Coverage for MATLAB Functions18-25The local function rect_intersect checks to see if its two rectangle argumentsintersect. Each argument consis
18 Coverage Collection During Simulation18-26Coverage for the MATLAB Function run_intersect_testModel coverage for the MATLAB Function block function
Model Coverage for MATLAB Functions18-27Lines with coverage elements are marked by a highlighted line number in the listing:• Line 1 receives decisio
18 Coverage Collection During Simulation18-28• Lines 27 and 30 receive decision, condition, and MCDC coverage for their ifstatements and conditions.Ea
Model Coverage for MATLAB Functions18-29Coverage for Line 14The Decisions Analyzed table indicates that the local function rect_intersectexecuted dur
18 Coverage Collection During Simulation18-30brings the total true occurrences for the decision to three, as reported in the Decisionsanalyzed table.M
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
18 Coverage Collection During Simulation18-32Coverage for run_intersect_testOn the Details tab, the metrics that summarize coverage for the entirerun_
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
2 Links Between Models and Requirements2-8RequirementsDocument TypeLocation OptionsWeb browser URL The RMI can link to a URL location. In the Document
18 Coverage Collection During Simulation18-34• sldv.condition• sldv.test• sldv.assume• sldv.proveFor this example, consider the following model that c
Model Coverage for MATLAB Functions18-35
18 Coverage Collection During Simulation18-36For an example of model coverage data for Simulink Design Verifier blocks, see“Simulink Design Verifier C
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
18 Coverage Collection During Simulation18-38S-Function Using S-Function Builder1Copy an instance of the S-Function Builder block from the User-Define
Model Coverage for C and C++ S-Functions18-39
18 Coverage Collection During Simulation18-40When you run a simulation, the coverage report contains coverage metrics for C/C++ S-Function blocks in y
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
18 Coverage Collection During Simulation18-423Select each of the links in Table Of Contents to navigate to various sections of thereport.Section Title
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
Supported Model Objects for Requirements Linking2-9Supported Model Objects for Requirements LinkingYou can associate requirements links between the f
18 Coverage Collection During Simulation18-446To obtain an overview of the statements that were not covered, navigate to the Codesection. This section
Model Coverage for Stateflow Charts18-45Model Coverage for Stateflow ChartsIn this section...“How Model Coverage Reports Work for Stateflow Charts” o
18 Coverage Collection During Simulation18-46• Have a Stateflow license.• Have debugging/animation enabled for the chart.Specify Coverage Report Setti
Model Coverage for Stateflow Charts18-47For analysis purposes, each chart counts as a single component.Decision CoverageDecision coverage interprets
18 Coverage Collection During Simulation18-48Chart Containing Exclusive OR Substates DecisionIf the chart contains exclusive (OR) substates, the decis
Model Coverage for Stateflow Charts18-49Context Example Decisions That Occurand not to the parent state A. Inthis case, the transition markedby condi
18 Coverage Collection During Simulation18-50State with On Event_Name Action Statement DecisionA state that has an on event_name action statement must
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
18 Coverage Collection During Simulation18-52When you specify the Simulink Design Verifier coverage metric in the CoverageSettings dialog box, the Sim
Model Coverage for Stateflow Charts18-53Model Coverage Reports for Stateflow Charts• “Summary Report Section” on page 18-53• “Subsystem and Chart Det
2 Links Between Models and Requirements2-10Selection-Based LinkingYou can use selection-based linking to create links from a model object to another m
18 Coverage Collection During Simulation18-54Each line in the hierarchy summarizes the coverage results at that level and the levelsbelow it. You can
Model Coverage for Stateflow Charts18-55• Coverage (this object): Coverage data for the chart as a container object• Coverage (inc.) descendants: Cov
18 Coverage Collection During Simulation18-56State Details Report SectionFor each state in a chart, the coverage report includes a State section with
Model Coverage for Stateflow Charts18-57The coverage report includes a State section on the state On.
18 Coverage Collection During Simulation18-58The decision coverage for the On state tests the decision of which substate to execute.The three decision
Model Coverage for Stateflow Charts18-59• Under Previously active substate entered due to history, which substate toreenter when On re-executes. The
18 Coverage Collection During Simulation18-60The decision for this transition depends on the time delay of 40 seconds and the condition[cold()]. If, a
Model Coverage for Stateflow Charts18-61decision to execute this transition and turn the Heater on is made. For other timeintervals or environment co
18 Coverage Collection During Simulation18-62conditions. Therefore, condition rows 1 and 3 are shaded. While condition 2 has beentested, conditions 1
Model Coverage for Stateflow Charts18-63Coverage results for state transition tables are the same as coverage results forequivalent Stateflow charts,
Link to Requirements Document Using Selection-Based Linking2-11Link to Requirements Document Using Selection-Based LinkingTo create a link from a mod
18 Coverage Collection During Simulation18-641Open the doc_atomic_subcharts_map_iodata model.This model contains two Sine Wave blocks that supply inpu
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
18 Coverage Collection During Simulation18-66Model Coverage for Stateflow Truth Tables• “Types of Coverage in Stateflow Truth Tables” on page 18-66• “
Model Coverage for Stateflow Charts18-67The Stateflow chart contains the following truth table:
18 Coverage Collection During Simulation18-68When you simulate the model and collect coverage, the model coverage report includesthe following data:
Model Coverage for Stateflow Charts18-69The Coverage (this object) column shows no coverage. The reason is that the containerobject for the truth tab
18 Coverage Collection During Simulation18-70Note: See “How Stateflow Generates Content for Truth Tables” for a description of thegraphical function f
Model Coverage for Stateflow Charts18-71Colored Stateflow Chart Coverage DisplayThe Model Coverage tool displays model coverage results for individua
18 Coverage Collection During Simulation18-72Object highlighting indicates coverage as follows:• Light green for full coverage• Light red for partial
Model Coverage for Stateflow Charts18-73When you click a highlighted Stateflow object, the summarized coverage for thatobject appears in the Coverage
2 Links Between Models and Requirements2-12Configure RMI for IBM Rational DOORS or Microsoft ActiveXNavigationTo use the features of the Requirements
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
19 Results Review19-2Types of Coverage ReportsIn the Coverage Settings dialog box, on the Report tab, if you select the GenerateHTML report option, th
Types of Coverage Reports19-3Model Summary ReportIf the top-level model contains Model blocks or calls external files, the software creates amodel su
19 Results Review19-4Model Reference Coverage ReportIf your top-level model references a model in a Model block, the software creates aseparate report
Types of Coverage Reports19-5External MATLAB File Coverage ReportIf your top-level model calls any external MATLAB files, select Coverage for MATLABf
19 Results Review19-6
Types of Coverage Reports19-7The Details section reports coverage for the external file and the function in that file.The Details section also lists
19 Results Review19-8
Types of Coverage Reports19-9Coverage results for each of the highlighted code lines follow in the report. The followinggraphic shows a portion of th
Requirements Traceability Link Editor2-13Requirements Traceability Link EditorIn this section...“Manage Requirements Traceability Links Using Link Ed
19 Results Review19-10• The top-level model that includes the subsystemIf the subsystem parameter Read/Write Permissions is set to NoReadOrWrite, thes
Types of Coverage Reports19-11Code Coverage ReportFor each S-Function block, the model coverage report links to a detailed code coveragereport for th
19 Results Review19-12Top-Level Model Coverage ReportThe Simulink Verification and Validation software always creates a model coveragereport for the t
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
19 Results Review19-14DetailsThe Details section reports the detailed model coverage results. Each section of thedetailed report summarizes the result
Top-Level Model Coverage Report19-15• “Chart Details” on page 19-18• “Coverage Details for MATLAB Functions and Simulink Design Verifier Functions”on
19 Results Review19-16Subsystem DetailsEach subsystem Details section contains a summary of the test coverage results for thesubsystem and a list of t
Top-Level Model Coverage Report19-17Block DetailsThe following graphic shows decision coverage results for the MinMax block in theMixing & Combus
19 Results Review19-18Chart DetailsThe following graphic shows the coverage results for the Stateflow chart control_logic inthe sldemo_fuelsys example
Top-Level Model Coverage Report19-19Note: For a detailed example of coverage reports for external MATLAB files, see“External MATLAB File Coverage Rep
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
19 Results Review19-20Coverage for the hFcnsInExternalEML function and the sldv.* calls is:• Line 1, the function declaration for hFcnsInExternalEMLis
Top-Level Model Coverage Report19-21Line 4, sldv.assume(u1 > u2), achieves 0% coverage because u1 > u2 neverevaluates to true.• Line 5, sldv.co
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
Top-Level Model Coverage Report19-23• The Summary section contains the cyclomatic complexity numbers for each object inthe model hierarchy. For a sub
19 Results Review19-24Decisions AnalyzedThe Decisions analyzed table lists possible outcomes for a decision and the number oftimes that an outcome occ
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
19 Results Review19-26MCDC AnalysisThe MC/DC analysis table lists the MCDC input condition cases represented by thecorresponding block and the extent
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
19 Results Review19-28• Current Run — The coverage results of the simulation just completed.• Delta — Percentage of coverage added to the cumulative c
Top-Level Model Coverage Report19-29The Conditions analyzed table uses column headers #n T and #n F to indicate results forindividual test cases. The
Requirements Traceability Link Editor2-15Requirements TabOn the Requirements tab, you specify detailed information about the link, including:• Descri
19 Results Review19-30Note: You can calculate cumulative coverage for reusable subsystems and Stateflowconstructs at the command line. For more inform
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
19 Results Review19-32The report contains a two-dimensional table representing the elements of the lookuptable. The element indices are represented by
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
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
Top-Level Model Coverage Report19-35Lookup table coverage for a three-dimensional lookup table block is reported as a set oftwo-dimensional tables.Th
19 Results Review19-36Block ReductionAll model coverage reports indicate the status of the Simulink Block reductionparameter at the beginning of the r
Top-Level Model Coverage Report19-37If you set Force block reduction off, the report contains no coverage data for this blockbecause the minimum inpu
19 Results Review19-38• “Relational Boundary Coverage”.• The Relational Boundary column in “Model Objects That Receive Coverage”.The tables below show
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
2 Links Between Models and Requirements2-16Requirements SettingsYou can manage your RMI preferences in the Requirements Settings dialog box.These sett
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
Top-Level Model Coverage Report19-41Relational Operator Report Format Explanation[-tol..0)<[0..tol]0 is included in the regionabove the relational
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
Top-Level Model Coverage Report19-43Each block is reported in hierarchical fashion; child blocks appear directly under parentblocks. Each block name
19 Results Review19-44Signal Size Coverage for Variable-Dimension SignalsIf you select Signal Size, the software creates a Variable Signal Widths sect
Top-Level Model Coverage Report19-45Simulink Design Verifier CoverageIf you select Simulink Design Verifier, the analysis collects coverage data for
19 Results Review19-46
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
19 Results Review19-48When you simulate your model with these coverage settings enabled, the softwaregenerates a Model Coverage Web View that you can
Export Model Coverage Web View19-49coverage information for a block in a Model Coverage Web View, click that block. Themodel coverage data appears in
Requirements Settings2-17Options DescriptionModify destination for bi-directionallinkingCreates links both to and from selected linkdestination.Store
20Excluding Model Objects FromCoverage• “Coverage Filtering” on page 20-2• “Coverage Filter Rules and Files” on page 20-3• “Model Objects to Filter fr
20 Excluding Model Objects From Coverage20-2Coverage FilteringIn this section...“What Is Coverage Filtering?” on page 20-2“When to Use Coverage Filter
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
20 Excluding Model Objects From Coverage20-4Model Objects to Filter from CoverageIn your model, the objects that you can filter from coverage recordin
Create, Edit, and View Coverage Filter Rules20-5Create, Edit, and View Coverage Filter RulesIn this section...“Create and Edit Coverage Filter Rules”
20 Excluding Model Objects From Coverage20-6If you select Coverage > ... The rule type is ...Exclude referenced library: <library_name> by li
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
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
Create, Edit, and View Coverage Filter Rules20-9To open the Coverage Filter Viewer, right-click anywhere in the model window and selectCoverage >
vContentsGetting Started1Simulink Verification and Validation Product Description . 1-2Key Features . . . . . . . . . . . . . . . . . . . . . . . . .
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
20 Excluding Model Objects From Coverage20-10Coverage Filter ViewerIn the Coverage Filter Viewer, you can:• Review and manage the coverage filter rule
Coverage Filter Viewer20-11To ... Do this:Navigate to the model to create coveragefilter rules.Click Add new rule by right-clicking inthe model.Navig
20 Excluding Model Objects From Coverage20-12Filter Model Objects to Refine Coverage ResultsIn this section...“About the Example Model” on page 20-12“
Filter Model Objects to Refine Coverage Results20-13When the simulation is complete, an HTML coverage report opens. This model does notrecord 100% co
20 Excluding Model Objects From Coverage20-142Right-click the [!on] transition and select Coverage > Exclude this transition.The Coverage Filter Vi
Filter Model Objects to Refine Coverage Results20-15If you open the Mode Logic chart and click the transition, the Informer windowdisplays filtering
20 Excluding Model Objects From Coverage20-16
Filter Model Objects to Refine Coverage Results20-17As a result, you cannot record 100% condition and MCDC coverage for the transitionafter(4, tick).
20 Excluding Model Objects From Coverage20-18Click OK to close the Coverage Filter Viewer.5Simulate the model again and review the results.The Objects
Filter Model Objects to Refine Coverage Results20-19With the tick event filtered from coverage analysis, there is no longer asubcondition on the deci
Link Model Objects2-195Right-click the slvnvdemo_powerwindow_controller/control subsystem andselect Requirements Traceability. The new RMI link appea
20 Excluding Model Objects From Coverage20-20• protected division1The library subsystem is a protection against division by zero and might not be rele
Filter Model Objects to Refine Coverage Results20-21Exclude the Switchable config subsystem from coverage.1In the Simulink Editor, right-click the Sw
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
21 Automating Model Coverage Tasks21-2Commands for Automating Model Coverage TasksUsing model coverage commands lets you automate the entire model cov
Create Tests with cvtest21-3Create Tests with cvtestThe cvtest command creates a test specification object. Once you create the object, yousimulate i
21 Automating Model Coverage Tasks21-4Field Descriptionsettings.overflowsaturation Set to 1 for saturate on integer overflowcoveragesettings.sigrange
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
21 Automating Model Coverage Tasks21-6You can also execute multiple test objects with the cvsim command. The followingcommand executes a set of covera
Retrieve Coverage Details from Results21-7Retrieve Coverage Details from ResultsSimulink Verification and Validation provides commands that allow you
2 Links Between Models and Requirements2-20Link from External ApplicationsYou can navigate to Simulink objects or MATLAB code with requirements using
21 Automating Model Coverage Tasks21-8Obtain Cumulative Coverage for Reusable Subsystems andStateflow® ConstructsThis example shows how to create and
Obtain Cumulative Coverage for Reusable Subsystems and Stateflow® Constructs21-9Get decision coverage for Subsystem 1Execute the commands for Subsyst
21 Automating Model Coverage Tasks21-10cvhtml('cum_subsystem',covobj3)Cumulative decision coverage for reusable subsystems Subsystem 1 and S
Create HTML Reports with cvhtml21-11Create HTML Reports with cvhtmlOnce you run a test in simulation with cvsim, results are saved to cv.cvdatagroup
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
Load Stored Coverage Test Results with cvload21-13Load Stored Coverage Test Results with cvloadThe cvload command loads into memory the coverage test
21 Automating Model Coverage Tasks21-14Use Coverage Commands in a ScriptThe following script demonstrates some common model coverage commands.This scr
Use Coverage Commands in a Script21-15decision_cov2 = decisioninfo(dataObj2,mdl_subsys);percent_cov2 = 100 * decision_cov2(1) / decision_cov2(2)cc_co
Checking Systems with the Model Advisor
Link Multiple Model Objects to a Requirements Document2-21Link Multiple Model Objects to a Requirements DocumentYou can link multiple Simulink and St
22Checking Systems Interactively• “Check Model and Subsystems” on page 22-2• “Limit Model Checks” on page 22-3• “Limit Model Checks By Excluding Gain
22 Checking Systems Interactively22-2Check Model and SubsystemsYou can use the Model Advisor to check a model or subsystem for adherence to modelinggu
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
22 Checking Systems Interactively22-4To exclude blocks from specified checks during an analysis of your model, you first createexclusions and save the
Limit Model Checks22-5To ... Select Model Advisor > ...Exclude the block from allchecks.Exclude block only > All ChecksExclude all blocks of th
22 Checking Systems Interactively22-6the current folder. Optionally, in the Save Exclusion File dialog box, you can select adifferent file name or loc
Limit Model Checks22-72In the Model Advisor window, click the Enable highlighting toggle button ( ).3In the left pane of the Model Advisor window, se
22 Checking Systems Interactively22-8Note: The Rationale field is the only field that you can edit in the Model AdvisorExclusion Editor.Save Exclusion
Limit Model Checks22-9Load an Exclusion FileTo load an existing exclusion file for use with your model:1In the Model Advisor Exclusion Editor dialog
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
22 Checking Systems Interactively22-101Use get_param to obtain the model object. For example, for sldemo_mdladv:mo = get_param('sldemo_mdladv&apo
Limit Model Checks By Excluding Gain and Outport Blocks22-11Limit Model Checks By Excluding Gain and Outport BlocksThis example shows how to exclude
22 Checking Systems Interactively22-129After reviewing the check results, exclude the Gain2 block from all Model Advisorchecks:aIn the model window, r
Limit Model Checks By Excluding Gain and Outport Blocks22-1310After reviewing the check results, exclude all Outport blocks from the Identifyunconnec
22 Checking Systems Interactively22-14ports check. The sldemo_mdladv_exclusions file is updated with the Outportblock exclusions.11In the left pane of
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
22 Checking Systems Interactively22-16Model Checks for DO-178C/DO-331 Standard ComplianceYou can check that your model or subsystem complies with sele
Model Checks for DO-178C/DO-331 Standard Compliance22-17DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check safety-related
22 Checking Systems Interactively22-18DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check for blocks that do not link toreq
Model Checks for DO-178C/DO-331 Standard Compliance22-19DO-178C/DO-331 Check Applicable High-Integrity System ModelingGuidelines“Check usage of Logic
Link Multiple Model Objects to a Requirements Document2-23
22 Checking Systems Interactively22-20Model Checks for IEC 61508, ISO 26262, and EN 50128 StandardComplianceYou can check that your model or subsystem
Model Checks for IEC 61508, ISO 26262, and EN 50128 Standard Compliance22-21IEC 61508, ISO 26262, and EN 50128 Checks Applicable High-Integrity Syste
22 Checking Systems Interactively22-22IEC 61508, ISO 26262, and EN 50128 Checks Applicable High-Integrity System ModelingGuidelines“Check for MATLAB F
Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-23Model Checks for MathWorks Automotive Advisory Board (MAAB)Guide
22 Checking Systems Interactively22-24By Task >ModelingStandards forMAAB subfolderMathWorks Automotive AdvisoryBoard (MAAB) CheckMAAB Control Algor
Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-25By Task >ModelingStandards forMAAB subfolderMathWorks Automot
22 Checking Systems Interactively22-26By Task >ModelingStandards forMAAB subfolderMathWorks Automotive AdvisoryBoard (MAAB) CheckMAAB Control Algor
Model Checks for MathWorks Automotive Advisory Board (MAAB) Guideline Compliance22-27By Task >ModelingStandards forMAAB subfolderMathWorks Automot
22 Checking Systems Interactively22-28Model Checks for Requirements LinksTo check that every requirements link in your model has a valid target in a r
23Check Systems Programmatically• “Checking Systems Programmatically” on page 23-2• “Finding Check IDs” on page 23-3• “Create a Function for Checking
2 Links Between Models and Requirements2-24Link Multiple Model Objects to a Requirement Document Using a SimulinkDocBlockThis example shows how to lin
23 Check Systems Programmatically23-2Checking Systems ProgrammaticallyThe Simulink Verification and Validation product includes a programmable interfa
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
23 Check Systems Programmatically23-4Create a Function for Checking Multiple SystemsThe following tutorial guides you through creating and testing a f
Create a Function for Checking Multiple Systems23-59Save the function.10Test the function. In the MATLAB Command Window, run run_configuration.mon th
23 Check Systems Programmatically23-6Check Multiple Systems in ParallelChecking multiple systems in parallel reduces the processing time required by t
Create a Function for Checking Multiple Systems in Parallel23-7Create a Function for Checking Multiple Systems in ParallelIf you have a Parallel Comp
23 Check Systems Programmatically23-88Run run_fast_configuration on the list of systems, specifying numParallel tobe the number of cores in your syste
Archive and View Results23-9Archive and View ResultsYou can archive and view the results of running the Model Advisor programmatically asdescribed in
23 Check Systems Programmatically23-10You can review additional results in the Command Window by calling theDisplayResults parameter when you run the
Archive and View Results23-11To view the Model Advisor Command-Line Summary report after loading an object, usethe ModelAdvisor.summaryReport functio
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
23 Check Systems Programmatically23-12View Model Advisor ReportFor a single system or check, you can view the same Model Advisor report that you acces
Archive and View Model Advisor Run Results23-13Archive and View Model Advisor Run ResultsThe following example guides you through archiving the resul
Customizing the Model Advisor
24Overview of Customizing the ModelAdvisor
24 Overview of Customizing the Model Advisor24-2Model Advisor CustomizationUsing Model Advisor APIs and the Model Advisor Configuration Editor, you ca
25Create Model Advisor Checks• “Create Model Advisor Checks Workflow” on page 25-2• “Customization File Overview” on page 25-3• “Quick Start Examples”
25 Create Model Advisor Checks25-2Create Model Advisor Checks Workflow1On your MATLAB path, create a customization file named sl_customization.m.In th
Customization File Overview25-3Customization File OverviewA customization file is a MATLAB file that you create and name sl_customization.m.The sl_cu
2 Links Between Models and Requirements2-26Link to Requirements in Microsoft Word DocumentsIn this section...“Create Bookmarks in a Microsoft Word Req
25 Create Model Advisor Checks25-4Function Description When RequiredOne or more calls to checkactionsSpecifies actions the softwareperforms for custom
Customization File Overview25-5
25 Create Model Advisor Checks25-6Quick Start ExamplesIn this section...“Add Customized Check to By Product Folder” on page 25-6“Create Customized Pas
Quick Start Examples25-75From the model window, select Analysis > Model Advisor > Model Advisor toopen the Model Advisor.6A System Selector — M
25 Create Model Advisor Checks25-81In your working directory, update the sl_customization.m file, asshown below. This file registers and creates the c
Quick Start Examples25-93It the Command Window, enter:sl_refresh_customizations4From the MATLAB window, select New > Model to open a new Simulink
25 Create Model Advisor Checks25-1011Follow the Recommended Action to fix the failed Constant block. In the ModelAdvisor dialog box:• Double-click the
Quick Start Examples25-11Create Customized Pass/Fail Check with Fix ActionThe following example shows how to create a Model Advisor pass/fail check w
25 Create Model Advisor Checks25-12 'Text entry example'];rec.setAction(myAction);mdladvRoot.publish(rec, 'Demo'); % --- Simple
Quick Start Examples25-13endft.setSubBar(0);result = ft;mdladvObj.setActionEnable(false);2Close the Model Advisor and your model if either are open.3
Link to Requirements in Microsoft Word Documents2-276Open the document. The RMI populates the Document and Document type fields.7Click the Document I
25 Create Model Advisor Checks25-1411In the Model Advisor Dialog box, enter a nonnumeric value in the Text entryexample parameter field in the Analysi
Quick Start Examples25-1513In the Model Advisor dialog box, click Run This Check. Both constant blocks nowpass the check.See Also• “Register Checks a
25 Create Model Advisor Checks25-16Create Check for Model Configuration ParametersIn this section...“Create Data File for Diagnostics Pane Configurati
Create Check for Model Configuration Parameters25-17Create Data File for Diagnostics Pane Configuration Parameter CheckThis example shows how to crea
25 Create Model Advisor Checks25-18fixvalue of error. When you run the configuration parameter check usingex_DataFile.xml, the check fails if the Bloc
Create Check for Model Configuration Parameters25-19</customcheck>7Verify the data syntax with Advisor.authoring.DataFile.validate. At thecomma
25 Create Model Advisor Checks25-20 rec = ModelAdvisor.Check('com.mathworks.Check1'); rec.Title = 'Example: Check model configurati
Create Check for Model Configuration Parameters25-216From the model window, select Analysis > Model Advisor > Model Advisor toopen the Model Ad
25 Create Model Advisor Checks25-22Data File for Configuration Parameter CheckYou use an XML data file to create a configuration parameter check. To c
Create Check for Model Configuration Parameters25-23Within the <checkdata> tagging, the data file specifies two types of constraints:• <Posi
vi ContentsLink to Requirements Document Using Selection-BasedLinking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-11Co
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
25 Create Model Advisor Checks25-24• dependson - Specifies a prerequisite subcheck. Optional. For example, to specify thatconfiguration parameter subc
Create Check for Model Configuration Parameters25-25 <parameter>SolverType</parameter> <value>Fixed-step</value> <fixva
25 Create Model Advisor Checks25-26 <fixvalue>Variable-step</value> <dependson>ID_B</value></NegativeModelParameterConstr
Register Checks and Process Callbacks25-27Register Checks and Process CallbacksIn this section...“Create sl_customization Function” on page 25-27“Reg
25 Create Model Advisor Checks25-28• addModelAdvisorCheckFcn (@checkDefinitionFcn)Registers the checks that you define in checkDefinitionFcn to the By
Register Checks and Process Callbacks25-29and Value properties. For example, you can remove, rename, and selectively displaychecks and tasks in the B
25 Create Model Advisor Checks25-30Define Custom ChecksIn this section...“About Custom Checks” on page 25-30“Contents of Check Definitions” on page 25
Define Custom Checks25-31Contents DescriptionCheck ID (required) Uniquely identifies the check. The ModelAdvisor uses this id to access the check.Han
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
Define Custom Checks25-33Visible?Do notdisplaycheckor taskIgnoreEnable and ValuepropertiesfalsetrueEnabled?falsetrueDisplaycheckor taskwith activeche
Link to Requirements in Microsoft Word Documents2-29• Enable Modify destination for bi-directional linking.When you select this option, every time yo
25 Create Model Advisor Checks25-34Check Definition FunctionThe following is an example of a function that defines the custom checks associated withth
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
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
Create Callback Functions and Results25-37Create Callback Functions and ResultsIn this section...“About Callback Functions” on page 25-37“Common Util
25 Create Model Advisor Checks25-38Utility Used for...find_system Getting handle or path to:• Blocks• Lines• AnnotationsWhen getting the object, you c
Create Callback Functions and Results25-39Argument I/O Type Descriptionresult Output MATLAB string that supports Model AdvisorFormatting API calls or
25 Create Model Advisor Checks25-40Here is an example of a detailed check callback function that checks optimizationsettings for simulation and code g
Create Callback Functions and Results25-41Argument I/O Type Descriptionsystem Input Path to the model or system analyzed bythe Model Advisor.ResultDe
25 Create Model Advisor Checks25-42 returnendregularFontSize = str2double(regularFontSize);if regularFontSize<1 || regularFontSize>=99 mdl
Create Callback Functions and Results25-43 mdladvObj.setListViewParameters... ({mdladvObj.getListViewParameters{:}, myLVParam}); needEna
2 Links Between Models and Requirements2-30This dialog box contains the following information for the link you just created:• Description of the link,
25 Create Model Advisor Checks25-44Format Model Advisor Results• “Overview of Displaying Results” on page 25-44• “Format Model Advisor Results” on pag
Create Callback Functions and Results25-45Format TextText is the simplest form of output. You can format text in many different ways. Thedefault text
25 Create Model Advisor Checks25-46• Bold title, row, and column headingsChange table formatting using the ModelAdvisor.Table constructor.The followin
Create Callback Functions and Results25-47 table1.setRowHeading(n, ['Row ', num2str(n)]);end% set Table contentfor rowIndex=1:5 for c
25 Create Model Advisor Checks25-48function result = SampleStyleOneCallback(system)mdladvObj = Simulink.ModelAdvisor.getModelAdvisor(system);if strcmp
Exclude Blocks From Custom Checks25-49Exclude Blocks From Custom ChecksThis example shows how to exclude blocks from custom checks. To save timedurin
25 Create Model Advisor Checks25-50• After both instances of searchResult =mdladvObj.filterResultWithExclusion(searchResult);, addsearchResult = setdi
Exclude Blocks From Custom Checks25-5111In the model window, right-click the Input block and select Model Advisor >Exclude block only > Check
25 Create Model Advisor Checks25-52Model Advisor Code ExamplesIn this section...“Register Custom Checks and Process Callbacks” on page 25-52“Process C
Model Advisor Code Examples25-53% Defines actions to execute at startup and post-executionfunction [checkCellArray taskCellArray] = ... ModelAdvis
Link to Requirements in Microsoft Word Documents2-31• The type and identifier of the location in the requirements document. With selection-based link
25 Create Model Advisor Checks25-54inputParam2.Name = 'Standard font size';inputParam2.Value='12';inputParam2.Type='String&ap
Model Advisor Code Examples25-55The following code, when included in a check definition function, adds the ExploreResult button to the check in the M
25 Create Model Advisor Checks25-56Informational Check Callback FunctionThe following code is an example of a callback function for a custom informati
Model Advisor Code Examples25-57function resultDescription = modelVersionChecksumCallbackUsingFT(system)resultDescription = [];system = getfullname(s
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
Model Advisor Code Examples25-59% Basic checks do not have subresults, supress linesetSubBar(ft,false);% Check for unconnected lines, inputs, and out
25 Create Model Advisor Checks25-60 setRecAction(ft,'Connect the specified blocks.'); % Create a list of handles to problem objects
Model Advisor Code Examples25-61% Title and description of first subchecksetSubTitle(ft1,'Verify Block reduction setting');setInformation(f
25 Create Model Advisor Checks25-62 ResultStatus = false;endResultDescription{end+1} = ft2; % Pass list template object to Model AdvisormdladvObj.s
26Create Custom Configurations byOrganizing Checks and Folders• “Create Custom Configurations” on page 26-2• “Create Configurations by Organizing Chec
2 Links Between Models and Requirements2-32Link to Requirements in IBM Rational DOORS DatabasesThis example shows how to create links from objects in
26 Create Custom Configurations by Organizing Checks and Folders26-2Create Custom ConfigurationsYou can use the Model Advisor APIs and Model Advisor C
Create Configurations by Organizing Checks and Folders26-3Create Configurations by Organizing Checks and FoldersTo customize the Model Advisor with M
26 Create Custom Configurations by Organizing Checks and Folders26-4Create Procedural-Based ConfigurationsYou can create a procedural-based configurat
Organize Checks and Folders Using the Model Advisor Configuration Editor26-5Organize Checks and Folders Using the Model AdvisorConfiguration EditorIn
26 Create Custom Configurations by Organizing Checks and Folders26-6Model Advisor Configuration EditorWhen you select a folder or check in the Model A
Organize Checks and Folders Using the Model Advisor Configuration Editor26-7The Model Advisor Check Browser window includes a read-only list of avail
26 Create Custom Configurations by Organizing Checks and Folders26-8Model Advisor Check BrowserUsing the Model Advisor Configuration Editor, you can p
Organize Checks and Folders Using the Model Advisor Configuration Editor26-9To... Select...Edit > Move downThe check or folder and drag and dropRe
26 Create Custom Configurations by Organizing Checks and Folders26-101To include custom checks in the new Model Advisor configuration, update theSimul
Organize Checks and Folders Using the Model Advisor Configuration Editor26-116In the right pane, edit Display Name to rename the folder. For the purp
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
26 Create Custom Configurations by Organizing Checks and Folders26-12Organize Customization File Checks and FoldersIn this section...“Customization Fi
Organize Customization File Checks and Folders26-13Function Description Required or OptionalOne or more groups Defines custom groups (see“Define Cust
26 Create Custom Configurations by Organizing Checks and Folders26-14function sl_customization(cm)The customization manager object includes methods fo
Organize Customization File Checks and Folders26-15Add Check to Custom or Multiple Folders Using TasksYou can use custom tasks for adding checks to t
26 Create Custom Configurations by Organizing Checks and Folders26-16Define Where Tasks AppearYou can specify where the Model Advisor places tasks wit
Organize Customization File Checks and Folders26-17Define Where Custom Folders AppearYou can specify the location of custom folders within the Model
26 Create Custom Configurations by Organizing Checks and Folders26-18Verify and Use Custom ConfigurationsIn this section...“Update the Environment to
Verify and Use Custom Configurations26-19Folders Using the Model Advisor Configuration Editor” on page 26-10, selectoptimization_configuration.mat.6W
26 Create Custom Configurations by Organizing Checks and Folders26-20Model Advisor Code ExamplesIn this section...“Register Custom Tasks and Folders”
Model Advisor Code Examples26-21mdladvRoot.register(MAT1);% Define task that uses Sample Check 2: Basic Check with Pass/Fail StatusMAT2 = ModelAdviso
2 Links Between Models and Requirements2-34Link to Requirements in Microsoft Excel WorkbooksIn this section...“Navigate from a Model Object to Require
26 Create Custom Configurations by Organizing Checks and Folders26-22rec = ModelAdvisor.FactoryGroup('com.mathworks.sample.factorygroup');re
27Create Procedural-Based ModelAdvisor Configurations• “Create Procedures” on page 27-2• “Create a Procedural-Based Configuration” on page 27-5
27 Create Procedural-Based Model Advisor Configurations27-2Create ProceduresIn this section...“What Is a Procedure?” on page 27-2“Create Procedures Us
Create Procedures27-3Add Subprocedures and Tasks to ProceduresYou can add subprocedures or tasks to a procedure. The tasks are wrappers for checks.•
27 Create Procedural-Based Model Advisor Configurations27-4MAP2=ModelAdvisor.Procedure('com.mathworks.example.procedure_sub2');MAP3=ModelAdv
Create a Procedural-Based Configuration27-5Create a Procedural-Based ConfigurationIn this example, you examine a procedural-based configuration.1At t
27 Create Procedural-Based Model Advisor Configurations27-6MAT6 = ModelAdvisor.Task('com.mathworks.sample.TaskSample6'); MAT6.DisplayName=&a
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
28Deploy Custom Configurations• “Overview of Deploying Custom Configurations” on page 28-2• “How to Deploy Custom Configurations” on page 28-3• “Manua
Link to Requirements in Microsoft Excel Workbooks2-35You will link the speed sensor block to the Speed Sensor Failure information inthe Microsoft Exc
28 Deploy Custom Configurations28-2Overview of Deploying Custom ConfigurationsIn this section...“About Deploying Custom Configurations” on page 28-2“D
How to Deploy Custom Configurations28-3How to Deploy Custom ConfigurationsTo deploy a custom configuration:1Determine which files to distribute. You
28 Deploy Custom Configurations28-4Manually Load and Set the Default ConfigurationWhen you use the Model Advisor, you can load any configuration. Once
Automatically Load and Set the Default Configuration28-5Automatically Load and Set the Default ConfigurationWhen you use the Model Advisor, you can a
2 Links Between Models and Requirements2-364Use the Link Editor to specify information about the Microsoft Excel requirementsdocument, the requirement
Link to Requirements in Microsoft Excel Workbooks2-372In the Description field, enter:MAP sensor test scenarioThe User tag field contains the tag tes
viiChange Requirements Links . . . . . . . . . . . . . . . . . . . . 2-36Link to Requirements in MuPAD Notebooks . . . . . . . . 2-39Create Requiremen
2 Links Between Models and Requirements2-38Note: For more information about user tags, see “Filter Requirements with UserTags” on page 4-25.3Click App
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
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
Link to Requirements in MuPAD Notebooks2-41The Requirements tab reopens, displaying the details of the newly created link.Unless you have previously
2 Links Between Models and Requirements2-42Create Requirements Traceability Report for ModelTo create the default requirements report for a Simulink m
Create Requirements Traceability Report for Model2-43A typical requirements report includes:• Table of contents• List of tables• Per-subsystem sectio
2 Links Between Models and Requirements2-44Link to Requirements Modeled in SimulinkYou can use Simulink to model your design requirements. For example
Link to Requirements Modeled in Simulink2-45Verification Subsystems for Power Window Controller ModelOpen the verification model, 'Power Window
2 Links Between Models and Requirements2-462Requirement 2 (Autodown feature) - If the driver presses the down button for lessthan 1 second, the contro
Link to Requirements Modeled in Simulink2-47
viii ContentsReviewing Requirements4Highlight Model Objects with Requirements . . . . . . . . . 4-2Highlight Model Objects with Requirements Using Mod
2 Links Between Models and Requirements2-48Create RMI Link to a Simulink ObjectCreate an RMI link from Verification Subsystem2 to the emergencyDown st
Link to Requirements Modeled in Simulink2-491Right-click on this group of objects, select Requirements > Select for linkingwith Simulink. Be caref
2 Links Between Models and Requirements2-505Right-click each input and select Requirements to display new links. Click the newlink, confirm that NAND
Link to Requirements Modeled in Simulink2-51Highlight and Report RMI Links Between Simulink ObjectsCreate RMI links to Simulink objects in the same w
2 Links Between Models and Requirements2-52CleanupClose all open models. Do not save changes.close_system('slvnvdemo_powerwindowController',
Requirements Linking with Simulink Annotations2-53Requirements Linking with Simulink AnnotationsYou can create requirements links to and from Simulin
2 Links Between Models and Requirements2-54Link Signal Builder Blocks to Requirements DocumentsYou can create links from a signal group in a Signal Bu
Link Signal Builder Blocks to Requirements Documents2-559Next to the Location drop-down list, enter User Input Requirements.10Click Apply to create t
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
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
ixHow the rmi Function Checks a RequirementsDocument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-3Validate Requirements Links
2 Links Between Models and Requirements2-58Link Requirements to Simulink Data Dictionary EntriesYou can create requirements traceability links for ent
Link Requirements to Simulink Data Dictionary Entries2-595Open the airflow_calc subsystem and select the Pumping Constant lookuptable.6In the Model E
3How Is Requirements Link InformationStored?• “External Storage” on page 3-2• “Guidelines for External Storage of Requirements Links” on page 3-3• “Sp
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
Guidelines for External Storage of Requirements Links3-3Guidelines for External Storage of Requirements LinksIf you decide to store requirements link
3 How Is Requirements Link Information Stored?3-4Specify Storage for Requirements LinksBy default, the Requirements Management Interface (RMI) stores
Save Requirements Links in External Storage3-5Save Requirements Links in External StorageThe Requirements Management Interface (RMI) stores externall
3 How Is Requirements Link Information Stored?3-6Load Requirements Links from External StorageWhen you open a Simulink model that does not have intern
Move Internally Stored Requirements Links to External Storage3-7Move Internally Stored Requirements Links to External StorageIf you have a model with
Kommentare zu diesen Handbüchern