Before you implement a piece of your system using a specific component type, consider whether the component type satisfies your modeling requirements.
Component Consideration | Modeling Requirements |
---|---|
Development Process |
|
Performance Requirements |
|
Features |
|
Modeling Requirement | Subsystems | Linked Subsystems | Subsystem References | Model References |
---|---|---|---|---|
Component Reuse | Not supported While you can copy a subsystem to reuse it in a model, the copies are independent of each other. When you edit a subsystem, the changes apply to the parent model file. To create or change a subsystem, you must open the parent model, which can lead to file contention when multiple people want to work in the model. | Supported You save the parent library block of a linked block in a separate file from the model that links to it. Using separate files helps to avoid file contention. You can link to the same parent library block multiple times in multiple models without creating copies. Managing library links adds some overhead, such as managing broken, disabled, or parameterized links. | Supported You save a referenced subsystem in a separate file from the model that references it. Using separate files helps to avoid file contention. You can reference the same subsystem multiple times in multiple models without creating copies. | Supported You save a referenced model in a separate file from the model that references it. Using separate files helps to avoid file contention. You can reference the same model multiple times in multiple models without creating copies. See Model Reuse. |
Shared Data | Supported You can share data among instances by defining the data outside the component. For example, by using a data store in a common parent subsystem. | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You can share data among instances of the referenced model by creating a data store inside the model. See Share Data Among Referenced Model Instances. |
Instance-Specific Edits | Supported Subsystem copies are independent of each other. | Supported When you edit a parent library block, the changes apply to the library file and propagate to all blocks that link to that block. To edit an instance of the block, you can disable the library link. You cannot disable library links when the parent library block has restricted write access. | Not supported When you edit an instance of a referenced subsystem, the changes apply to the subsystem file and propagate to all other instances of the referenced subsystem. | Not supported When you edit an instance of a referenced model, the changes apply to the model file and propagate to all other instances of the referenced model. |
Version Control and Configuration Management | Not supported You cannot directly place subsystems in a source control system. To reduce file contention and use separate version control for each subsystem, use a subsystem reference. | Supported You can place library files in a source control system. To provide individual version control for each library block, use subsystem references and model references in the library. When you drag these blocks from the library into your model, they reference the subsystem file or model file. Forwarding tables allow you to map old library blocks to new versions of the blocks. | Supported You can place subsystem files in a source control system. | Supported You can place model files in a source control system. |
Intellectual Property Protection | Not supported Use model references instead. | Not supported Same behavior as subsystems. | Not supported Same behavior as subsystems. | Supported Protected models obscure model contents, which can be useful when distributing models. Creating a protected model requires a Simulink® Coder™ license. Using a protected model does not require a Simulink Coder license. |
Unit Testing | Supported Subsystems are dependent on their context in a model. If the context of a subsystem changes, such as the data type of an input signal, the related test harness must be updated. For subsystems that are not atomic, the test harness may use different block execution orders, due to virtual boundaries. For tools that support authoring, managing, and executing systematic, simulation-based tests of subsystems, see Create Test Harnesses and Select Properties (Simulink Test). To measure how thoroughly model components are tested, see Model Coverage (Simulink Coverage). | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You can test a referenced model independently to isolate behavior by simulating it as a top model. You can use a data-defined test harness, with MATLAB® test vectors and direct coverage collection. For tools that support authoring, managing, and executing systematic, simulation-based tests of subsystems, see Create Test Harnesses and Select Properties (Simulink Test). To measure how thoroughly model components are tested, see Model Coverage (Simulink Coverage). |
Modeling Requirement | Subsystems | Linked Subsystems | Subsystem References | Model References |
---|---|---|---|---|
Incremental Model Loading | Not supported Loading a model loads all subsystem contents that are saved in the model. | Supported Simulink incrementally loads a library at the point needed during editing, updating a diagram, or simulating a model. | Supported Simulink incrementally loads a referenced subsystem at the point needed during editing, updating a diagram, or simulating a model. | Supported Simulink incrementally loads a referenced model at the point needed during editing, updating a diagram, or simulating a model. |
Build Artifact Reuse | Not supported Build artifacts, such as simulation targets, are not generated for subsystems. | Not supported Same behavior as subsystems. | Not supported Same behavior as subsystems. | Supported You can share and reuse build artifacts, such as simulation targets, using Simulink cache files. For more information, see Share Simulink Cache Files for Faster Simulation. |
Reduced Memory Usage for Large Models | Not supported Subsystems do not reduce memory usage for simulation and code generation. | Not supported Linked subsystems do not reduce memory usage for simulation and code generation. Simulink duplicates library block instances during block update. | Not supported Subsystem references do not reduce memory usage for simulation and code generation. Simulink duplicates subsystem reference instances during block update. | Supported Models referenced in accelerator mode reduce memory usage for simulation and code generation because Simulink incrementally loads compiled versions of them. |
Artificial Algebraic Loop Elimination | Supported Subsystems that are not atomic avoid artificial algebraic loops. If a subsystem is atomic, you can try to eliminate artificial algebraic loops by enabling the Subsystem block parameter Minimize algebraic loop occurrences. | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You can try to eliminate artificial algebraic loops by enabling Configuration Parameters > Model Referencing > Minimize algebraic loop occurrences. |
Modeling Requirement | Subsystems | Linked Subsystems | Subsystem References | Model References |
---|---|---|---|---|
Compatible Configuration Parameter Settings | Supported Subsystems use the configuration parameter settings of the model that contains them. | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported Configuration parameter settings can generally be different for a parent model and its referenced models. For compatibility information, see Set Configuration Parameters for Model Hierarchies. |
Signal Property Specification at Interfaces | Supported You can specify signal properties at a subsystem interface. For signal properties that you do not specify, subsystems inherit the signal properties from their context. Propagation of signal properties can lead to Simulink using signal properties that you do not anticipate. | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You must specify most signal properties at a referenced model interface. Referenced models are context-independent with a defined boundary, so they do not inherit most signal properties. Referenced models can inherit discrete sample times when the referenced model is sample-time independent. |
Bus Specification | Supported You
can use a Subsystems do not require the use of
| Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You
can use a Model references do not require the use of
|
State Initialization | Supported You can initialize states of subsystems. | Supported Same behavior as subsystems. | Supported Same behavior as subsystems. | Supported You can initialize states from the top model using either the structure format or structure-with-time format. For more information, see State Information for Referenced Models. |
Code Generation | Supported For information on subsystem code generation, see Control Generation of Functions for Subsystems (Simulink Coder). | Supported For information on linked subsystem code generation, see Control Generation of Functions for Subsystems (Simulink Coder). | Supported Same behavior as subsystems. | Supported For information on referenced model code generation, see Generate Code for Model Reference Hierarchy (Simulink Coder). |