Matlab function block optimization (HDL Coder)
6 次查看(过去 30 天)
显示 更早的评论
I would like to know which would be the best way of optimizing (in terms of speed) a moving average filter written as a Matlab function with 8 parallel channels at the input and one output channel. Concretely my question targets pipelining, I/O pipeline registers, loop unrolling, etc.
Regards.
0 个评论
回答(2 个)
Girish Venkataramani
2014-3-3
Which version of MATLAB are you using? Assuming it is a fixed-point algorithm, you can right click on the MATLAB function block, and choose 'HDL Code -> HDL Block Properties'. In this dialog, you can set input/output pipelining. If you also set 'LoopOptimization' to 'Unroll Loops' and turn on 'Distributed Pipelining', then the output pipelines are retimed to inside the MATLAB algorithm. If you really want to control the placement of registers, you can call out the MATLAB variables in your code on which you want to place registers by typing them in to the 'VariablesToPipeline' field.
Some of these features may not be available to you depending on the release of MATLAB you are using. Hope this works.
Girish Venkataramani
2014-3-10
Yes, with 12a, you will not have the 'VariablesToPipeline' feature. But still you can use the the parameters you have mentioned, i.e., input/output pipelining, loop unrolling and distributed pipelining (keep balance-delays = on for the whole model). You need to set DistrbutedPipelining on the MATLAB block (through the right-click menu I mentioned in my previous reply). If you set it on the subsystem containing the MATLAB block it won't work. As long as your code does not have too much control flow, this should help.
0 个评论
另请参阅
类别
FPGA, ASIC, and SoC Development
HDL Coder
HDL Code Generation from MATLAB
Speed and Area Optimization
显示更多
在 Help Center 和 File Exchange 中查找有关 Optimization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!