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

3 views (last 30 days)
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.

Accepted Answer

Tim McBrayer
Tim McBrayer on 7 Oct 2013
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.

More Answers (0)

Categories

Find more on Code Generation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!