Matlab function block optimization (HDL Coder)
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (2)
Girish Venkataramani
el 3 de Mzo. de 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
el 10 de Mzo. de 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 comentarios
Ver también
Categorías
FPGA, ASIC, and SoC Development
HDL Coder
HDL Code Generation from MATLAB
Speed and Area Optimization
Mostrar más
Más información sobre Optimization en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!