Clear Filters
Clear Filters

Can we have single harness for MIL and SIL ?

8 views (last 30 days)
Shivaputra Narke
Shivaputra Narke on 8 Apr 2021
Answered: MarkB on 19 Jan 2024
Hi,
I am trying to create harness model in Normal Mode and SIL mode. However, I would like to perfrom MIL-SIL deviation analysis (includding signal value differences and coverage metrics differences).
Current Situation :
I can simulate two separately created harness model one for MIL and other for SIL. I can get output signal information as well. ( However, my model gets stuck for coverage analysis for SIL at 10% simulation that's other problem and can be addressed in separate question). Here, the test case is being duplicated in both harness which I want to avoid.
Question:
  1. Can we generate one harness with two Model blocks one for SIL and MIL as shown in attached image ? if so what precuations needs to be taken to avoid any simulation errors
MIL_SIL
I have tried above shown approach by copying MIL block into SIL harness ( and also copying SIL into MIL harness too). Below is the error which is being shown during simulation. I can see <model_name>_sbs.mexw64 in the current directory of the model.
Build process completed successfully ### Preparing to start SIL simulation ... Building with 'lcc-win64'.
cannot open output file C:\Users\..\Model\.._sbs.mexw64
Let me know if anyone has a better solution for this.
Here are the configuration details,
Model : Autosar model with default autosar.tlc.
Matlab : 2019b wiht Embedded coder

Answers (1)

MarkB
MarkB on 19 Jan 2024
If I understand the question correctly, you probably don't need to use two model blocks. I would propose the alternative of:
  1. Create one test harness with only one system-under-test (i.e. the MIL block in the image).
  2. In Simulink Test Manager, create an equivalence test that uses the same system-under-test and harness for both simulations.
  3. In the first simulation, under the "Simulation settings and release overrides"->"Simulation Mode" set it to "normal" (i.e. MIL)
  4. In the second simulation, under the "Simulation settings and release overrides"->"Simulation Mode" set it to "Software-in-the-loop (SIL)" (i.e. SIL)
Initially, this might feel "wasteful" because it re-runs the upstream input sources once per simulation, rather than just running it once and feeding it to both systems-under-test. However, there are some distinct benefits to this approach that should offset this waste. In particular, the equivalence test will let you do things like compare the results in each case easily and automatically. Also, you won't need to maintain two versions of the scopes (In fact, Simulink Test Manager has good signal plotting, and you might not need the scopes at all, you can just name the signals, mark them for logging, and plot them in the report.) Lastly, it doesn't make sense for a small model, but if you had a big model and a long simulation, and our parallel computing tools, Simulink Test Manager would also let you run both "flavors" in parallel.

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!