M
Marios Barlas
Guest
Dear all,
I'm trying to figure out how to speed up my computation on the following algorithm:
Following my previous post, I wrote a code that implements an FSMD of 3 states calculating the square root of a number according to a clock. All is working fine, but i'lm trying to figure out if I can make it more efficient by making more calculations on the same clock cycle.
I have a process and in this a case statement with me FSMD states. Since I can't use the for...generate command inside the process I tried to use some buffer variables like this :
res_buff <= (res_c-(root_c + delta_c)) when (((root_c + delta_c) <= res_c) ) else
res_c;
root_buff <= shift_right(root_c + shift_left(delta_c,1),1) when ((root_c + delta_c) <= res_c) else
shift_right(root_c,1);
delta_buff <= shift_right(delta_c,2);
-- Parallelization
res_next <= (res_buff-(root_buff + delta_buff)) when (((root_buff + delta_buff) <= res_buff) ) else
res_buff;
root_next <= shift_right(root_buff + shift_left(delta_buff,1),1) when ((root_buff + delta_buff) <= res_buff) else
shift_right(root_buff,1);
delta_next <= shift_right(delta_buff,2);
but it seems to mess up my results. From the little I know I think this is pipelining but I'm not sure how to infer this logic in VHDL. Anyone could give me an idea?
Thanks in Advance,
Marios Barlas
I'm trying to figure out how to speed up my computation on the following algorithm:
Following my previous post, I wrote a code that implements an FSMD of 3 states calculating the square root of a number according to a clock. All is working fine, but i'lm trying to figure out if I can make it more efficient by making more calculations on the same clock cycle.
I have a process and in this a case statement with me FSMD states. Since I can't use the for...generate command inside the process I tried to use some buffer variables like this :
res_buff <= (res_c-(root_c + delta_c)) when (((root_c + delta_c) <= res_c) ) else
res_c;
root_buff <= shift_right(root_c + shift_left(delta_c,1),1) when ((root_c + delta_c) <= res_c) else
shift_right(root_c,1);
delta_buff <= shift_right(delta_c,2);
-- Parallelization
res_next <= (res_buff-(root_buff + delta_buff)) when (((root_buff + delta_buff) <= res_buff) ) else
res_buff;
root_next <= shift_right(root_buff + shift_left(delta_buff,1),1) when ((root_buff + delta_buff) <= res_buff) else
shift_right(root_buff,1);
delta_next <= shift_right(delta_buff,2);
but it seems to mess up my results. From the little I know I think this is pipelining but I'm not sure how to infer this logic in VHDL. Anyone could give me an idea?
Thanks in Advance,
Marios Barlas