Coverage Filter Rules and Files

What Is a Coverage Filter Rule?

A coverage filter rule is a rule that specifies a model object or set of objects to exclude from coverage recording:

Each coverage filter rule includes the following fields:

  • Name—Name or path of the object to be filtered from coverage

  • Type—Whether a specific object is filtered or all objects of a given type are filtered

  • Rationale—An optional description that explains why this object is filtered from coverage

What Is a Coverage Filter File?

A coverage filter file is a collection of coverage filter rules. Each rule specifies one or more objects to exclude from coverage recording.

To apply the coverage filter rules during coverage recording, you must first attach a coverage filter file to your model. After you attach the coverage filter file, when you simulate the model, the specified objects are excluded from coverage. You can attach a coverage filter file to several Simulink® models. However, a model can have only one attached coverage filter file.

MATLAB® saves coverage filter files in the MATLAB Current Folder, unless you specify a different folder. The default name for a coverage filter file is <model_name>_covfilter.cvf.

If you use the default file name and the coverage filter file exists on the MATLAB path, each time you open the model, you see the coverage filter rules, unless another coverage filter file is already attached to that model.

Was this topic helpful?