Matlab function block optimization (HDL Coder)
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Girish Venkataramani
il 3 Mar 2014
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
il 10 Mar 2014
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 Commenti
Vedere anche
Categorie
FPGA, ASIC, and SoC Development
HDL Coder
HDL Code Generation from MATLAB
Speed and Area Optimization
Mostra altro
Scopri di più su Optimization in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!