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

Re: [partial-reconfig] Resp.: icap of Virtex-II Pro



Hi,

Ricardo Jardel Nunes da Silveira wrote:
Dear Gyorgy,

 What exactly does ulzag ?

Thanks.

Jardel.

2006/7/24, Gyorgy Horvath <horvaath@xxxxxxxxxxxxxxxxx>:

Here it is:
-- -- -- -- -- -- -- --
#define ulzag(  ul ) (unsigned long)(    \
(((unsigned long)(ul)&0x80000000LU)>> 7) |\
(((unsigned long)(ul)&0x40000000LU)>> 5) |\
(((unsigned long)(ul)&0x20000000LU)>> 3) |\
(((unsigned long)(ul)&0x10000000LU)>> 1) |\
(((unsigned long)(ul)&0x08000000LU)<< 1) |\
(((unsigned long)(ul)&0x04000000LU)<< 3) |\
(((unsigned long)(ul)&0x02000000LU)<< 5) |\
(((unsigned long)(ul)&0x01000000LU)<< 7) |\
(((unsigned long)(ul)&0x00800000LU)>> 7) |\
(((unsigned long)(ul)&0x00400000LU)>> 5) |\
(((unsigned long)(ul)&0x00200000LU)>> 3) |\
(((unsigned long)(ul)&0x00100000LU)>> 1) |\
(((unsigned long)(ul)&0x00080000LU)<< 1) |\
(((unsigned long)(ul)&0x00040000LU)<< 3) |\
(((unsigned long)(ul)&0x00020000LU)<< 5) |\
(((unsigned long)(ul)&0x00010000LU)<< 7) |\
(((unsigned long)(ul)&0x00008000LU)>> 7) |\
(((unsigned long)(ul)&0x00004000LU)>> 5) |\
(((unsigned long)(ul)&0x00002000LU)>> 3) |\
(((unsigned long)(ul)&0x00001000LU)>> 1) |\
(((unsigned long)(ul)&0x00000800LU)<< 1) |\
(((unsigned long)(ul)&0x00000400LU)<< 3) |\
(((unsigned long)(ul)&0x00000200LU)<< 5) |\
(((unsigned long)(ul)&0x00000100LU)<< 7) |\
(((unsigned long)(ul)&0x00000080LU)>> 7) |\
(((unsigned long)(ul)&0x00000040LU)>> 5) |\
(((unsigned long)(ul)&0x00000020LU)>> 3) |\
(((unsigned long)(ul)&0x00000010LU)>> 1) |\
(((unsigned long)(ul)&0x00000008LU)<< 1) |\
(((unsigned long)(ul)&0x00000004LU)<< 3) |\
(((unsigned long)(ul)&0x00000002LU)<< 5) |\
(((unsigned long)(ul)&0x00000001LU)<< 7) )
-- -- -- -- -- -- -- --
Note that the order of bit and bytes is heavily depend on
the controller architecture...

The macro above simply reverses the bit order on a
by byte bases (keeps the byte order).
Of curse it can be done much easier in VHDL :-)

Best regards
Gyuri

___________________________
partial-reconfig mailing list
partial-reconfig@xxxxxxxxxxxxxx
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/partial-reconfig/