Unexpected or internal error encountered in "in CGIR

30 views (last 30 days)
I am usign the simulink to generate C code.
When i simulate the model it is working properly, but when i try to generate the code i get the following error.
CGIR assertion 'T::isa((const Type*)aType)' failed in 'b:\matlab\src\cg_ir\export\include\cg_ir\type\type.hpp:501'
[ 0] 0x00000000c4bc2f1a bin\win64\rtwcg.dll+03485466 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::replaceVar+00000410
[ 1] 0x00000000c4bc3742 bin\win64\rtwcg.dll+03487554 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::replaceVarWithStructVar+00001650
[ 2] 0x00000000c4bc2d13 bin\win64\rtwcg.dll+03484947 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::makeIOSMapCompact+00015379
[ 3] 0x00000000c4bc4019 bin\win64\rtwcg.dll+03489817 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::replaceVarWithStructVar+00003913
[ 4] 0x00000000c4bba78a bin\win64\rtwcg.dll+03450762 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::constructMatSubscripts+00004314
[ 5] 0x00000000c4bba820 bin\win64\rtwcg.dll+03450912 RTWCG::WholeModelXform::ReuseBufferInsertionUtils::constructMatSubscripts+00004464
[ 6] 0x00000000c4b8f6c1 bin\win64\rtwcg.dll+03274433 RTWCG::FindUtilFcnUsage+00008545
[ 7] 0x00000000c4b8d3cb bin\win64\rtwcg.dll+03265483 RTWCG::ApplyWholeModelXForms2+00000363
[ 8] 0x0000000118e6652c bin\win64\libmwsimulink.dll+10577196 RTW_CORE::CoderMappingCoderDISrc::accessOrdinal+00628092
[ 9] 0x0000000118e5cdfa bin\win64\libmwsimulink.dll+10538490 RTW_CORE::CoderMappingCoderDISrc::accessOrdinal+00589386
[ 10] 0x0000000118ed3e76 bin\win64\libmwsimulink.dll+11026038 PartitionSort::Partition::isPortGroupAggPartition+00285670
[ 11] 0x0000000118eda1fa bin\win64\libmwsimulink.dll+11051514 PartitionSort::Partition::isPortGroupAggPartition+00311146
[ 12] 0x0000000118abaa1e bin\win64\libmwsimulink.dll+06728222 sl::simharness::SlSigDescriptor::setUsed+00098814
[ 13] 0x00000000196ad42e bin\win64\pgo\m_dispatcher.dll+00119854 mdPathNotification::function_rebind_notification+00000158
[ 14] 0x000000001969a780 bin\win64\pgo\m_dispatcher.dll+00042880 Mfunction_handle::dispatch+00000688
[ 15] 0x000000001adf9899 bin\win64\pgo\m_lxe.dll+00235673
### Build procedure for model: 'BiLlcCurrentLoop_R2016A_SLX' aborted due to an error.
Unexpected or internal error encountered in "in CGIR: b:\matlab\src\cg_ir\export\include\cg_ir\type\type.hpp line 501: T::isa((const Type*)aType)
". Please report this to MathWorks if you can cause it to recur
  1 Comment
Jan
Jan on 20 Nov 2018
"Please report this to MathWorks if you can cause it to recur..." sounds like you are wanted to send this to the official support. See the "Contact Us" link on top of this page.

Sign in to comment.

Answers (1)

Phani Teja
Phani Teja on 1 Jul 2019
There are varius assertions in matlab and root cause can be different for the same assertion.
I gone through the similar assertion during code generation (Autosar compliance) using Embedded coder (Matlab 2018a), It has basically generated in the data propogation using global storage blocks (Data store memory, Data store write and Data store read).
If you have similar case then check the Data store write blocks in your model where it is dirtectly feeding from the autosar bus signals.

Products

Community Treasure Hunt

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

Start Hunting!