Hey Shital,
Understanding from your question, you want a single output from referenced models.
You can do this by making a parent model where you call these both models.
And then generate the C/C++ code using Simulink or Embedded Coder. Ensure that you have adjusted solver settings to generate code. You may refer to the below example:
I constructed two models and referenced them in a single “ParentModel” Simulink model using “Model” block as:
On this single ‘ParentModel.slx’ use Simulink Coder or Embedded Coder to generate code. Before generating adjust the settings to generate single input and output endpoints.
Refer to the below links to Integrate the code in BSW:
- Model AUTOSAR Basic Software Service Calls: https://www.mathworks.com/help/autosar/ug/model-autosar-basic-software-bsw-service-calls.html
- AUTOSAR Blockset: https://www.mathworks.com/help/autosar/index.html
For more clarification on model referencing and code generation, refer to the following links:
- Model referencing: https://www.mathworks.com/help/simulink/model-reference.html
- Generate Code for Model Reference Hierarchy: https://www.mathworks.com/help/rtw/ug/generate-code-for-model-reference-hierarchy.html
- Combined Code generated for models: https://www.mathworks.com/help/rtw/ug/combined-models.html
For documentation specific links, access them using following commands in MATLAB command window respectively:
web(fullfile(docroot, '/autosar/ug/model-autosar-basic-software-bsw-service-calls.html'))
web(fullfile(docroot, '/autosar/index.html'))
web(fullfile(docroot, '/simulink/model-reference.html'))
web(fullfile(docroot, '/rtw/ug/generate-code-for-model-reference-hierarchy.html'))
web(fullfile(docroot, '/rtw/ug/combined-models.html'))
I hope this helps you. Do share more details if you have more doubts regarding this.