Excessive use of resources by vhdl converted file from MATLAB (HDL CODER)

조회 수: 1 (최근 30일)
Mohammad Rafi Lone
Mohammad Rafi Lone 2014년 8월 25일
댓글: Tim McBrayer 2014년 8월 26일
The function that I input to the hdlcoder provided by matlab is of the form function y = add_images(a,b) a = reshape(a,256,256); b = reshape(b,256,256); y = a + b; y = reshape(y,1,65536); the resulting hdl code utilises 65536 adders!!! which is too high,, I want just one adder that adds up the input values repetitively... I mean it should consider just one value for a and b each at a time.... How is that possible??? Please help
  댓글 수: 2
Mohammad Rafi Lone
Mohammad Rafi Lone 2014년 8월 26일
Do U mean like this >> function y = add_images(a,b) a = reshape(a,256,256); b = reshape(b,256,256); for i = 1:256 for j = 1:256 y(i,j) = a(i,j) + b(i,j); y = reshape(y,1,65536);<< It still yield same number of adders... and if we take a,b as one pixel and try to update, we need to initialize the matrices in the function in order to store previous values,,, but I am not able to do so as well....... Thank You for your suggestion sir
Tim McBrayer
Tim McBrayer 2014년 8월 26일
I'm sorry that I wasn't clear. If loop streaming does not take effect on your matrix add as originally written, then you need to try loop streaming on the explicit loop version. The code you have written has 64K adders, in either form. HDL Coder needs to be instructed that you want some lesser number of adders, with a corresponding increase in the required clock speed. The way to do this is via the loop streaming feature.

댓글을 달려면 로그인하십시오.

답변 (1개)

Tim McBrayer
Tim McBrayer 2014년 8월 25일
You can investigate Loop Streaming to see if it will address your issue. If it does not do so using the native matrix '+', you may need to write the nested for loops explicitly.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by