Matlab function block optimization (HDL Coder)
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Girish Venkataramani
am 3 Mär. 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
am 10 Mär. 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 Kommentare
Siehe auch
Kategorien
FPGA, ASIC, and SoC Development
HDL Coder
HDL Code Generation from MATLAB
Speed and Area Optimization
Mehr anzeigen
Mehr zu Optimization finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!