[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [f-cpu] What's wrong here?



Hello,

Etienne LABARRE wrote:

>On Tue, Jul 30, 2002 at 07:01:10PM +0200, Just an Illusion wrote:
>
>>Hello,
>>
>>The variable H and L can't be used to calculate the size of B, more they 
>>are unnecessary.
>>
>>When you call the function inv_word with a vector, the A'HIGH and the 
>>A'LOW aren't referred to the real size of the vecteur, but the part 
>>connected.
>>
>>The good version is more like :
>>
>>function inv_word (A : in std_ulogic_vector) return std_ulogic_vector is
>>   variable B : std_ulogic_vector ( A'HIGH downto 0);
>>begin
>>    for i in 0 to B'HIGH loop
>>           B(i)=A(A'HIGH-i);
>>    end loop;
>>end inv_word;
>>
>>or
>>
>>function inv_word (A : in std_ulogic_vector) return std_ulogic_vector is
>>   variable B : std_ulogic_vector ( A'LENGHT-1 downto 0);
>>begin
>>    for i in 0 to B'LENGHT-1 loop
>>           B(i)=A(A'LENGHT-1-i);
>>    end loop;
>>end inv_word;
>>
>>Or any combinaison of both.
>>
>
>My problem is :
>Input vector maybe 0 to length-1, but low index can be not null. And i
>want a output vector with same range as input.
>
 From the point of view of the function, the size of the input vector 
isn't given by index.

Take the following exemple :

....
signal input,result1, result2 : std_ulogic_vector (4 downto 0);
signal other_input : std_ulogic_vector(7 downto 0);
....

result1 <= inv_word(input);
result2 <= inv_word(other_input(6 downto 2);
....

In that both case (result1 and result2), the function see only a vector 
of size 5-bits, whatever index values.

>
>And i don't see what's wrong, it's works fine with simili. Is it luke ?
>
Perhaps. Or perhaps you have see something wrong that are lucky 
equivalent to what you want.

>
>Etienne.
>*************************************************************
>To unsubscribe, send an e-mail to majordomo@seul.org with
>unsubscribe f-cpu       in the body. http://f-cpu.seul.org/
>
Just an Illusion

-- 
______________________________
"The matrix is my world, I am a shadow.
Shadow in world, shadow in life. Don't try to keep me,
I am a Corpo's Killer.
Don't follow me or die..."
		The KingWalker - 1996



*************************************************************
To unsubscribe, send an e-mail to majordomo@seul.org with
unsubscribe f-cpu       in the body. http://f-cpu.seul.org/