CGIR assertion when build model for S32K in R2018b

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CGIR assertion when build model for S32K in R2018b

2,162 Views
neil_rutland
Contributor I

I have been using the MBD Toolbox with a S32K144 EVB and Matlab R2018b Prerelease. Now I am using R2018b and when I build a model I get multiple CGIR assertions in the Diagnostic Viewer, see the attached file for the details. The model still builds and runs but I am concerned something won't work or is broken. I tried a fresh install of the toolbox with R2018b on another machine and get the same issue.

I understand that the toolbox only supports up to R2018a but it needs to work with R2018b soon.

0 Kudos
11 Replies

1,559 Views
brianmckay
Contributor III

Hi neil.rutland@2infinity-control.com,

Can you please open a MathWorks Technical Support ticket for this issue.

I looked internally, but I cant tell if this is something new or something that has been previously solved. Our Tech Support staff will log the issue and either provide a fix or escalate to the correct Development team for review. 

Feel free to contact me if you encounter delays; I am happy to follow up internally on my side.

Cheers,

-Brian

0 Kudos

1,559 Views
neil_rutland
Contributor I

Hi Brian,

I have created a ticket with number 03269508 and the same title as this one.

When I installed the toolbox in R2018b I had issues with the default GCC compiler location, because the toolbox now installs in a folder path that contains a space, i.e.,

C:\Users\NeilRutland\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx

In R2018b Prerelease it installed in a different folder, i.e.,

C:\Users\NeilRutland\Documents\MATLAB\Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx\

Most of the build process handled the space in the path, but in the linking phase (from memory) one of the options couldn’t handle it. I worked around it by copying the folder

..\tools\gcc-6.3-arm32-eabi

to

C:\NXP\gcc-6.3-arm32-eabi

and setting the environment variable

GCC_S32K_TOOL=C:\NXP\gcc-6.3-arm32-eabi

I also had to add

C:\NXP\gcc-6.3-arm32-eabi\bin

to the end of the PATH environment variable otherwise gmake failed in the build process.

Best regards,

Neil

0 Kudos

1,559 Views
brianmckay
Contributor III

Hi Neil,

Did you get helpful response from MathWorks Tech Support?  I looked internally, and I see the case was closed, but spawned an escalation response and then an internal development request; so best I can tell there is a bug fix needed from the MathWorks side. 

Thanks,

-Brian

0 Kudos

1,559 Views
neil_rutland
Contributor I

Hi Brian,

The response I got was:

“Thank you for taking the time to report this bug and helping to make MATLAB better.

I have brought this issue to the notice our developers. They will investigate the matter further with a view to resolving the issue in one of our future releases.

I regret the inconvenience caused.”

Polite but not very helpful…

Best regards,

Neil

0 Kudos

1,559 Views
brianmckay
Contributor III

Neil Rutland

Hi neil.rutland@2infinity-control.com

Please try this workaround.

Run the following commands after loading the model:

>> slfeature('TraceabilityRepository', -1)
>> set_param(modelName, 'SimulinkBlockComments', 'off')
>> set_param(modelName, 'InsertBlockDesc', 'off')
>> set_param(modelName, 'ReqsInCode', 'off')
>> set_param(modelName, 'InsertPolySpaceComments', 'off')

 

Note: For model references, you may need to set_param for all models in the model reference hierarchy.

 

Side effects of this workaround:

  • Level-level traceability in Code Generation report and Code View Report is not available.
  • Some of the Simulink Block traceability comments and the associated comments for block description, requirements, and PolySpace annotations are not available.

I tested this and was able to get the model to build.  Daniel @ NXP confirmed the fix also worked for him.

Cheers,

-Brian

0 Kudos

1,559 Views
brianmckay
Contributor III

Hi Neil,

I dug a bit more on my side. Clearly looks like you are encountering a bug; it was analyzed and logged by tech support and is in process of an additional review with the development team. The devel team posted yesterday that they were missing a tlc file from the NXP support package yesterday, so I just provided it now. I'm not sure if the developer has been fully able to reproduce the error here.

Best case is that they figure out what is going on and provide a workaround; but this may take a couple weeks. Medium term, this is likely to get fixed in a future release.

Cheers,

-Brian

0 Kudos

1,559 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi brianmckay‌,

The issue is 100% reproducible on Matlab 2018b. We have tested on our side, but we could not find any problems with the models running with that issue. Apparently, even if the MATLAB Coder triggers that assertion, the generated code works as expected on 2018b.

neil.rutland@2infinity-control.com

If the assertion does not bother your too much, you can continue to use the 2018b and our toolbox until a fix will become available. Otherwise, perhaps you can switch back to 2018a.

Best regards,
Daniel

0 Kudos

1,559 Views
brianmckay
Contributor III

Hi dumitru-daniel.popa‌ & neil.rutland@2infinity-control.com

I was able to replicate the error on my laptop (late Friday afternoon in US). I am working with a developer to get the NXP Toolbox installed so he can examine the code generation with our development environment.

I'll provide updates when there is something tangible to report.

Cheers,

-Brian

0 Kudos

1,559 Views
constantinrazva
NXP Employee
NXP Employee

Hello neil.rutland@2infinity-control.com‌,

Please give me some extra information so I can find out where the problem lies:

First, I'd like to know if you have tried building a model on another MATLAB release, and if so, if that also failed.

Next, I'd like to know if your path to MATLAB or to our toolbox has special characters (e.g.: ä, ü, ö) in it.

Third, can you share a model on which you're getting this error?

I'm expecting it to be either a naming collision (between a Simulink Function Caller block function call and subsystem block name or a stateflow bus name and some other function name), either a path issue. But these are just assumptions so far. I'll be able to narrow it down after I get some more details.

Kind regards,

Razvan. 

0 Kudos

1,559 Views
neil_rutland
Contributor I

Hi Razvan,

I have built models with R2018b Prerelease and when I build the same ones in R2018b I get the issue. As I said the models build and run, but I don't expect to see assertions in the build process.

There are no special characters in the paths.

I get the assertions with the attached model that is a modified version of the example hello world example model in the toolbox. The only modification is that I replaced the Stateflow blocks because I do not have a Stateflow license.

Best regards,

Neil

0 Kudos

1,559 Views
dumitru-daniel_
NXP Employee
NXP Employee

Hi neil.rutland@2infinity-control.com‌,

Thank you for bringing this to our attention.

At this point this seems to be MATLAB issue introduced in 2018b. I checked on their website and i see similar issues reported on older version.

We are going to check with Mathworks to confirm this. Stay tuned!

brianmckay‌,

Are you aware of any issue like this introduced in 2018b ?

Attached is a zip folder with the generated code. Before we add a defect, can you ask someone to have a look and confirm our thoughts?

According with the build log console the issue seems to be related with MATLAB Coder Trace:

### TLC code generation complete. CGIR assertion 'begin != 0' failed in 'b:\matlab\toolbox\coder\trace\src\trace\traceutil.cpp:302' [ 0] 0x000000037f4feabf bin\win64\libmwtrace.dll+00191167 mwboost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>+00002783 [ 1] 0x000000037f5a761b bin\win64\libmwtrace.dll+00882203 coder::trace::TraceInfoBuilder::setTraceDelim+00088731 [ 2] 0x000000037f59d8c0 bin\win64\libmwtrace.dll+00841920 coder::trace::TraceInfoBuilder::setTraceDelim+00048448 [ 3] 0x000000037f57fbf7 bin\win64\libmwtrace.dll+00719863 coder::trace::TraceInfoBuilder::extractTraceInfo+00000263 [ 4] 0x000000037f5c6706 bin\win64\libmwtrace.dll+01009414 coder::trace::TraceInfoBuilder::setTraceDelim+00215942 [ 5] 0x000000000e023c60 bin\win64\pgo\mcos_impl.dll+00408672 [ 6] 0x000000000e023232 bin\win64\pgo\mcos_impl.dll+00406066 [ 7] 0x000000000e02234b bin\win64\pgo\mcos_impl.dll+00402251 [ 8] 0x000000000e020d12 bin\win64\pgo\mcos_impl.dll+00396562 [ 9] 0x000000000e076f30 bin\win64\pgo\mcos_impl.dll+00749360 [ 10] 0x000000000e273585 bin\win64\pgo\mcos_impl.dll+02831749 mwboost::serialization::singleton_module::unlock+01534417 [ 11] 0x000000000e27cf01 bin\win64\pgo\mcos_impl.dll+02871041 mwboost::serialization::singleton_module::unlock+01573709 [ 12] 0x00000000144b3655 bin\win64\mcos.dll+00144981 omDirectCallMethod+00000069 [ 13] 0x000000000a9975c2 bin\win64\pgo\libmwlxeindexing.dll+00357826 MathWorks::lxe::MatrixModuleImplementation::SetHeterogeneousArray+00014702 [ 14] 0x000000000aa18936 bin\win64\pgo\libmwlxeindexing.dll+00887094 MathWorks::lxe::assign_paren_shared_xvalue_ptr_uninitialized_to_struct+00006890 [ 15] 0x000000000a94c70f bin\win64\pgo\libmwlxeindexing.dll+00050959 MathWorks::lxe::at_rbrace_nargout+00006831 CGIR assertion 'begin != 0' failed in 'b:\matlab\toolbox\coder\trace\src\trace\traceutil.cpp:302' [ 0] 0x000000037f4feabf bin\win64\libmwtrace.dll+00191167 mwboost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>+00002783 [ 1] 0x000000037f5a761b bin\win64\libmwtrace.dll+00882203 coder::trace::TraceInfoBuilder::setTraceDelim+00088731 [ 2] 0x000000037f59d8c0 bin\win64\libmwtrace.dll+00841920 coder::trace::TraceInfoBuilder::setTraceDelim+00048448 [ 3] 0x000000037f57fbf7 bin\win64\libmwtrace.dll+00719863 coder::trace::TraceInfoBuilder::extractTraceInfo+00000263 [ 4] 0x000000037f5c6706 bin\win64\libmwtrace.dll+01009414 coder::trace::TraceInfoBuilder::setTraceDelim+00215942 [ 5] 0x000000000e023c60 bin\win64\pgo\mcos_impl.dll+00408672 [ 6] 0x000000000e023232 bin\win64\pgo\mcos_impl.dll+00406066 [ 7] 0x000000000e02234b bin\win64\pgo\mcos_impl.dll+00402251 [ 8] 0x000000000e020d12 bin\win64\pgo\mcos_impl.dll+00396562 [ 9] 0x000000000e076f30 bin\win64\pgo\mcos_impl.dll+00749360 [ 10] 0x000000000e273585 bin\win64\pgo\mcos_impl.dll+02831749 mwboost::serialization::singleton_module::unlock+01534417 [ 11] 0x000000000e27cf01 bin\win64\pgo\mcos_impl.dll+02871041 mwboost::serialization::singleton_module::unlock+01573709 [ 12] 0x00000000144b3655 bin\win64\mcos.dll+00144981 omDirectCallMethod+00000069 [ 13] 0x000000000a9975c2 bin\win64\pgo\libmwlxeindexing.dll+00357826 MathWorks::lxe::MatrixModuleImplementation::SetHeterogeneousArray+00014702 [ 14] 0x000000000aa18936 bin\win64\pgo\libmwlxeindexing.dll+00887094 MathWorks::lxe::assign_paren_shared_xvalue_ptr_uninitialized_to_struct+00006890 [ 15] 0x000000000a94c70f bin\win64\pgo\libmwlxeindexing.dll+00050959 MathWorks::lxe::at_rbrace_nargout+00006831 CGIR assertion 'begin != 0' failed in 'b:\matlab\toolbox\coder\trace\src\trace\traceutil.cpp:302' [ 0] 0x000000037f4feabf bin\win64\libmwtrace.dll+00191167 mwboost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>+00002783 [ 1] 0x000000037f5a761b bin\win64\libmwtrace.dll+00882203 coder::trace::TraceInfoBuilder::setTraceDelim+00088731 [ 2] 0x000000037f59d8c0 bin\win64\libmwtrace.dll+00841920 coder::trace::TraceInfoBuilder::setTraceDelim+00048448 [ 3] 0x000000037f57fbf7 bin\win64\libmwtrace.dll+00719863 coder::trace::TraceInfoBuilder::extractTraceInfo+00000263 [ 4] 0x000000037f5c6706 bin\win64\libmwtrace.dll+01009414 coder::trace::TraceInfoBuilder::setTraceDelim+00215942 [ 5] 0x000000000e023c60 bin\win64\pgo\mcos_impl.dll+00408672 [ 6] 0x000000000e023232 bin\win64\pgo\mcos_impl.dll+00406066 [ 7] 0x000000000e02234b bin\win64\pgo\mcos_impl.dll+00402251 [ 8] 0x000000000e020d12 bin\win64\pgo\mcos_impl.dll+00396562 [ 9] 0x000000000e076f30 bin\win64\pgo\mcos_impl.dll+00749360 [ 10] 0x000000000e273585 bin\win64\pgo\mcos_impl.dll+02831749 mwboost::serialization::singleton_module::unlock+01534417 [ 11] 0x000000000e27cf01 bin\win64\pgo\mcos_impl.dll+02871041 mwboost::serialization::singleton_module::unlock+01573709 [ 12] 0x00000000144b3655 bin\win64\mcos.dll+00144981 omDirectCallMethod+00000069 [ 13] 0x000000000a9975c2 bin\win64\pgo\libmwlxeindexing.dll+00357826 MathWorks::lxe::MatrixModuleImplementation::SetHeterogeneousArray+00014702 [ 14] 0x000000000aa18936 bin\win64\pgo\libmwlxeindexing.dll+00887094 MathWorks::lxe::assign_paren_shared_xvalue_ptr_uninitialized_to_struct+00006890 [ 15] 0x000000000a94c70f bin\win64\pgo\libmwlxeindexing.dll+00050959 MathWorks::lxe::at_rbrace_nargout+00006831 CGIR assertion 'begin != 0' failed in 'b:\matlab\toolbox\coder\trace\src\trace\traceutil.cpp:302' [ 0] 0x000000037f4feabf bin\win64\libmwtrace.dll+00191167 mwboost::archive::codecvt_null<wchar_t>::codecvt_null<wchar_t>+00002783 [ 1] 0x000000037f5a761b bin\win64\libmwtrace.dll+00882203 coder::trace::TraceInfoBuilder::setTraceDelim+00088731 [ 2] 0x000000037f59d8c0 bin\win64\libmwtrace.dll+00841920 coder::trace::TraceInfoBuilder::setTraceDelim+00048448 [ 3] 0x000000037f57fbf7 bin\win64\libmwtrace.dll+00719863 coder::trace::TraceInfoBuilder::extractTraceInfo+00000263 [ 4] 0x000000037f5c6706 bin\win64\libmwtrace.dll+01009414 coder::trace::TraceInfoBuilder::setTraceDelim+00215942 [ 5] 0x000000000e023c60 bin\win64\pgo\mcos_impl.dll+00408672 [ 6] 0x000000000e023232 bin\win64\pgo\mcos_impl.dll+00406066 [ 7] 0x000000000e02234b bin\win64\pgo\mcos_impl.dll+00402251 [ 8] 0x000000000e020d12 bin\win64\pgo\mcos_impl.dll+00396562 [ 9] 0x000000000e076f30 bin\win64\pgo\mcos_impl.dll+00749360 [ 10] 0x000000000e273585 bin\win64\pgo\mcos_impl.dll+02831749 mwboost::serialization::singleton_module::unlock+01534417 [ 11] 0x000000000e27cf01 bin\win64\pgo\mcos_impl.dll+02871041 mwboost::serialization::singleton_module::unlock+01573709 [ 12] 0x00000000144b3655 bin\win64\mcos.dll+00144981 omDirectCallMethod+00000069 [ 13] 0x000000000a9975c2 bin\win64\pgo\libmwlxeindexing.dll+00357826 MathWorks::lxe::MatrixModuleImplementation::SetHeterogeneousArray+00014702 [ 14] 0x000000000aa18936 bin\win64\pgo\libmwlxeindexing.dll+00887094 MathWorks::lxe::assign_paren_shared_xvalue_ptr_uninitialized_to_struct+00006890 [ 15] 0x000000000a94c70f bin\win64\pgo\libmwlxeindexing.dll+00050959 MathWorks::lxe::at_rbrace_nargout+00006831

0 Kudos