Why does code generation with AUTOSAR results in a CGIR assertion?

1 vue (au cours des 30 derniers jours)
I have imported an ARXML file and done "createComponentAsModel" . However, when building (Ctrl+B) the skeleton model that was created in R2017b or earlier releases, code generation results in a CGIR exception, as follows:
CGIR assertion 'T::isa((const Type*)aType)' failed in 'b:\matlab\src\cg_ir\export\include\cg_ir\type\type.hpp:501'
[ 0] 0x000000010fc0a392 bin\win64\cg_ir.dll+01024914 cg_const_create_matrix_numeric_from_double+00000114
[ 1] 0x00000001b8c4e726 bin\win64\rtwcg.dll+02615078 RTWCG::RTWBlock::CreateConst+00000118
[ 2] 0x00000001a46af903 bin\win64\libmwsimulink.dll+05437699 SLGlue::getArgumentSpecificationFromSubsys+00201555
[ 3] 0x00000001b8c846a2 bin\win64\rtwcg.dll+02836130 RTWCG::RTWCGCtx::constructCode+00001922
[ 4] 0x00000001a46af397 bin\win64\libmwsimulink.dll+05436311 SLGlue::getArgumentSpecificationFromSubsys+00200167
[ 5] 0x00000001a51320f2 bin\win64\libmwsimulink.dll+16457970 BlockSetLocation+00026514
[ 6] 0x00000001a4bcf802 bin\win64\libmwsimulink.dll+10811394 sleGetRTWBlockForSLBlock+00071938
[ 7] 0x00000001a4bc8627 bin\win64\libmwsimulink.dll+10782247 sleGetRTWBlockForSLBlock+00042791
[ 8] 0x00000001a4b94d18 bin\win64\libmwsimulink.dll+10571032 SleCompModelAPI::requestBlockReduction+00600824
[ 9] 0x00000001a4b8cd77 bin\win64\libmwsimulink.dll+10538359 SleCompModelAPI::requestBlockReduction+00568151
[ 10] 0x00000001a4c04d56 bin\win64\libmwsimulink.dll+11029846 PartitionSort::BlockPartition::getFcnCallPortGroupIndex+00115158
[ 11] 0x00000001a4c0b16a bin\win64\libmwsimulink.dll+11055466 PartitionSort::BlockPartition::getFcnCallPortGroupIndex+00140778
[ 12] 0x00000001a47f178e bin\win64\libmwsimulink.dll+06756238 SLGlue::getShowSigGenName+00100334
[ 13] 0x000000001556d42e bin\win64\pgo\m_dispatcher.dll+00119854 mdPathNotification::function_rebind_notification+00000158
[ 14] 0x000000001555a780 bin\win64\pgo\m_dispatcher.dll+00042880 Mfunction_handle::dispatch+00000688
[ 15] 0x00000000161f9899 bin\win64\pgo\m_lxe.dll+00235673
Is there any way I can work around this issue to generate code for my model?

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 30 Sep 2020
This issue is caused by a bug that generates the assertion for some cases when using an enumeration type in an outport that is fed by a ground block.
The issue has been already addressed and fixed for release R2018a. Upgrading to R2018a would fix the issue and allow code generation from the skeleton model.
We strongly encourage you upgrade to a newer MATLAB release, but should this not be possible for you, you can *workaround *this issue by replacing the Ground blocks with Constant blocks, and setting their value to be the default one for the enum in the outport. Thanks to back propagation of the data type, the setup would work.
This will result in the same behaviour and the generated code will look the same as with the Ground blocks, because the purpose of the Ground blocks here would be exactly the same: to initialize the value in the outports to be the default one from the enumeration.
Because this is only a skeleton model, I understand that you will develop it further up to a point in which those ground connections will be removed, but in the meantime the provided workaround would allow code generation if you needed to build the model.

Plus de réponses (0)

Catégories

En savoir plus sur General Applications dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by