필터 지우기
필터 지우기

Hardware implementation: support long long

조회 수: 4 (최근 30일)
Yohann GOYER
Yohann GOYER 2018년 11월 16일
댓글: Yohann GOYER 2018년 11월 19일
Hello,
I'm using an infineon C166 target (HW). This exist in the pre define HW configuration in matlab.
The "support long long" option is not checked and in fact, my compilator doesn't support long long. So that is correct.
But the advisor still wants me to check the "support long long" option (because of my objectives).
The results is that my generation in not "all green checked" just for this warning.
Of course I can't accept this modification (The compilation of generated code failed as long long is not supported in reality).
How can I indicate to the advisor that this can not be done and in the same time conserve the same objectives?
  댓글 수: 2
John D'Errico
John D'Errico 2018년 11월 16일
MATLAB offers no support at all for long long arithmetic. At best you could use tools like the symbolic toolbox for higher precision, or my own HPF toolbox. But either of those options will be very slow compared to MATLAB computations done using doubles.
Walter Roberson
Walter Roberson 2018년 11월 16일
long long is matlab's int64 except for saturation behavior .

댓글을 달려면 로그인하십시오.

채택된 답변

Yohann GOYER
Yohann GOYER 2018년 11월 16일
What I didn't anderstand is that this option "Support Long long" is: Me as developper indicate to Matlab that my compiler doesn't support long long (or yes it is supported).
I give here the option description (2018a):
"Specify whether the C compiler for production hardware supports long long.
Most C99 compilers support long long."
How can the advisor say that for efficiency the generated code shall use long long? => Hey, use long long, it will not work as you say your compiler doesn't support it but YOLO!
I think matlab belives that my compiler is C99 (I got a warning for simulation advisor that suggest me to select C99 instead of C90). But in fact my compiler is C90 (without long long introduced in C99).
It is in fact a bug in the algorithm for this advise. This shall be reported, and I hope fixed.
I don't know the way to do that.
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 11월 19일
Were you able to find a way to deal with the situation?
Yohann GOYER
Yohann GOYER 2018년 11월 19일
I juste hope that Mathworks will fix the bug.
until the fix, I will just continue to ignor the warning and have repport of generated code with warning (not completly green => need to add more documentation to explain why).
Wait and see.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Yohann GOYER
Yohann GOYER 2018년 11월 16일
In fact when the option is checked, the generated code use long long variables that are not recognized by my compilator (2018a).
The problem is more that the code advisor want me to check the option (even if the generated code doesn't work) and that create a warn in the advisor log (and make the advisor panel stay open at the end of the code generation that is a problem for my script).
My question is how to indicate to the code advisor that the proposition is not correct and that it shalls ignor this option?

Community Treasure Hunt

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

Start Hunting!

Translated by