grt.tlc compiling error
显示 更早的评论
Hi,
I created a mdl model that runs fine but, while compiling (grt.tlc), I get the error as at the end of the message. I know the error is caused by an embedded matlab function but I can't solve the problem because is completely unlogical to me. In particular, in my model I have two identical subsystems (that simulate airplanes) in the root system. If I delete one of them, the model compiles fine. If I replicate the airplane-subsystem I get the error below (while it still can run). Inside the air-subsystems there is an embedded matlab function. The code lines that seem to cause the problem are:
coder.varsize('StructAirOthers', [10 1]);
StructAirOthers = struct('P', zeros(3,1), 'Vel', zeros(3,1));
for i=1:n (n<=10)
StructAirOthers(i).P = ...
StructAirOthers(i).Vel =
end
followed by a loop that dynamically fills the array of structs. By removing the use of this struct inside one of the embedded matlab function (no need to remove it in both) it compiles fine. In addition,the cause it is not the coder.varsize istruction as the sole struct() function is enough to cause the issue. I am really frustrated because of this problem.
Thanks,
Alessandro
CGIR assertion 'sym==scope->head()' failed in '.\classic\cg_scope.cpp:605'
[ 0] 0x6b9027fb C:/Program Files/MATLAB/R2011a/bin/win32/cg_ir.dll+00075771 ( cg_const_move_to_new_scope+000059 )
[ 1] 0x6b922899 C:/Program Files/MATLAB/R2011a/bin/win32/cg_ir.dll+00207001 ( cg_symbol_move_to_new_scope+000089 )
[ 2] 0x6a0d95da C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+00759258 ( CG::ScopeLowering::prune+000410 )
[ 3] 0x6a0ffcb6 C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+00916662 ( CG::TypedScopeLowering::pruneConstants+000054 )
[ 4] 0x6a16e824 C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+01370148 ( CG::FunctionInlining::transform+020532 )
[ 5] 0x6a16e88a C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+01370250 ( CG::FunctionInlining::transform+020634 )
[ 6] 0x6a21163c C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+02037308 ( CG::transform::MatrixFlattening::processScope+000012 )
[ 7] 0x6a21279e C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+02041758 ( CG::ScopeTransform::processScopeWithService+000014 )
[ 8] 0x6a212805 C:/Program Files/MATLAB/R2011a/bin/win32/cgir_xform.dll+02041861 ( CG::ScopeTransform::apply+000053 )
[ 9] 0x6a504c4b C:/Program Files/MATLAB/R2011a/bin/win32/rtwcg.dll+00674891 ( RTWCG::RTWFcnConst::CommonTransformsToOptimizeAndEmitCode+004827 )
[ 10] 0x6a50690c C:/Program Files/MATLAB/R2011a/bin/win32/rtwcg.dll+00682252 ( RTWCG::RTWFcnConst::OptimizeAndEmitCode+002828 )
[ 11] 0x6a4c8901 C:/Program Files/MATLAB/R2011a/bin/win32/rtwcg.dll+00428289 ( RTWCG::RTWCGModule::OptimizeAndEmitCode+000161 )
[ 12] 0x6beb668d C:/Program Files/MATLAB/R2011a/bin/win32/libmwsimulink.dll+02188941 ( BlockSetCheckVarDimsInputEmpty+066765 )
[ 13] 0x6beb360e C:/Program Files/MATLAB/R2011a/bin/win32/libmwsimulink.dll+02176526 ( BlockSetCheckVarDimsInputEmpty+054350 )
[ 14] 0x6bf07776 C:/Program Files/MATLAB/R2011a/bin/win32/libmwsimulink.dll+02520950 ( SlCosSFunc::operator=+002854 )
[ 15] 0x6bf07cff C:/Program Files/MATLAB/R2011a/bin/win32/libmwsimulink.dll+02522367 ( SlCosSFunc::operator=+004271 )
### Build procedure for model: 'MainModel' aborted due to an error.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink Coder 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!