- Joined
- Mar 17, 2012
- Messages
- 3
- Reaction score
- 0
Hi everybody! I have a question about coding&timing/delay relationship.
Considering a code like this
If these two codes have different hardware mapping, which of these two codes are faster?
Code 1 implies a register (thus a delay) for every created variable?
Code 2 implies only that a "wire" is taken from a source?
Sorry if it sounds a bit messy
Considering a code like this
where i create a variable for every accessed array element , and considering this codefor index 0 to MAX_N loop
varMatrix:= CONV_INTEGER(matrix(index));
diff := a-varMatrix;
if(diff < VAL) then
c:= coeff(diff);
else
c := 1;
end if;
prod := ker(index)*c;
...
end loop;
where i use every time that i need the "whole" indexed-array element.for index 0 to MAX_N loop
if( abs(a-CONV_INTEGER(matrix(index))) < VAL) then
prod := ker(index)*coeff( a-CONV_INTEGER(matrix(index)) );
else
prod := ker(index);
end if;
...
end loop;
If these two codes have different hardware mapping, which of these two codes are faster?
Code 1 implies a register (thus a delay) for every created variable?
Code 2 implies only that a "wire" is taken from a source?
Sorry if it sounds a bit messy