Hello, I was wondering if it was possible to get model coverage without using sim() on a simulink model? We can't use the sim() for our models. We need to run for a few cycles, check our input, run for another cycle and see if the input changed. Since sim() starts, runs and exits every call we can't use it. Our program works in every aspect we need it to but model coverage. Is there a way that I can invoke it manually outside of sim()?
cvt = cvtest(modelname);
cvt.setupCmd = 'load(''Set_Up.m'');';
cvd = cvsim(cvt);
Ends up doing the same thing as sim() and is not what we need, since cvsim() acts the same way sim() does. Just need to be able to start and end the data gathering manually.
We're looking for a way to do this like we loaded our models:
cmd_line = [model_name '(, , , ''compile'');'];
[sys,x0,str,ts] = eval(cmd_line);
So we were able to do that without open or load system. Doing it like the way above we can start, pause and stop the model when we want.
I had a meeting with my boss and our verification officer and we realized that the was that we’re getting coverage it wrong. That the way we’re doing it won’t give us 100% coverage when we get to our latch blocks. So we want to collect coverage while we iterate through our model but even if we set up coverage it won’t do anything since we never call sim() or hit the play button (simulate) from within the model. We need a way where we can capture each iteration we did in the model and collect coverage based on that.
I set up the coverage options in the model before anything’s done to it.
set_param(modelname, 'RecordCoverage', 'on', 'CovHtmlReporting', 'on', 'CovCumulativeReport', 'on', 'CovMetricSettings', 'dcm');
But unless I use cvsim(), sim() or hit the simulate button (play) from within the model, I won’t get any type of coverage.