if-else equivalent block for hdl code generation

hello,I want to use if-else block in my simulink model to generate hdl code but when i am using if-else simulink block and trying to use hdl coder then it is showing an error that,"if-else block is unsupported for hdl code generation",then i tried to use matlab function block and within matlab function i have written logic of if-else then it is showing an error that"MATLAB function block is unsupported for hdl code generation while using floating data type" So plz suggest which block(hdl supported block) can be used in place of if-else simulink block.

댓글 수: 4

Rewrite the MATLAB Function Block to avoid using floating point data.
DEEKSHA GUPTA
DEEKSHA GUPTA 2018년 3월 25일
편집: DEEKSHA GUPTA 2018년 3월 25일
actually i am using 'data-type conversion' block within my simulink model for that i have choosen native floating point data type because without this native floating point mode i am unable to get hdl code error is that."Illegal conversion to/from floating point and fixed-point in hdl_non_overlapped/Data Type Conversion. Consider selecting 'Native Floating Point' as the Floating Point IP Library to enable this conversion."
Birdman
Birdman 2018년 3월 25일
Can you share your model?
I need to see the MATLAB Function Block code.

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

 채택된 답변

Kiran Kintali
Kiran Kintali 2018년 3월 26일
편집: Walter Roberson 2018년 3월 26일

2 개 추천

MATLAB Function block does not yet support Native Floating Point. This is a future enhancement under consideration.
https://www.mathworks.com/videos/hdl-coder-native-floating-point-123505.html please watch the video to see how to enable native floating point mode in the GUI to generate HDL for data type conversion block.

추가 답변 (1개)

Vijayasagar Kommu
Vijayasagar Kommu 2018년 3월 27일

0 개 추천

If you want to model if else equivalent in HDL coder you have to use switch block. For nested if else ,you have to Cascade switch blocks in priority order.

질문:

2018년 3월 25일

답변:

2018년 3월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by