Simulink block for switching: Multiport switch block not supported in HDL Coder

3 ビュー (過去 30 日間)
Pooja
Pooja 2013 年 10 月 7 日
回答済み: Tim McBrayer 2013 年 10 月 7 日
Hello, I am using Matlab 2011a. In simulink when i use Multiport Switch block, the HDL Compatibility test gives following Error:" "Specify indices" is not supported by the Multi Port Switch block parameter "Data Port Order" for HDL code generation ".
But the switch is found in hdllib.
I need to use the switch with "Specify indices", as i have input data of different ranges which are to be switched.
Kindly let me know how it canbe done to use with HDL coder.
Thank you in anticiaption.

採用された回答

Tim McBrayer
Tim McBrayer 2013 年 10 月 7 日
As the error message states, the 'Specify Indices' mode of the MultiPort Switch block is not supported for HDL code generation. To implement this behavior you will need to decompose the logic you want to use blocks in their supported modes. If you have a small number of contiguous ranges this task is not overly difficult. If you have a large number of potential outputs, or the values to select a particular index are non-contiguous, the task becomes more challenging.
For example: if you want to select signal A when your select signal is 1-4, B when it's 5-8, and C if it's > 8, then you can implement this with 2 Switch blocks, 3 Compare to Constant blocks, and a handful of Boolean operators. If your selection logic is more complex, then the required design is more complex.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCode Generation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by