FX3 firmware file cyfxtx.c : bits beyond valid memory

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hello, I want to know the bit ordering of FX3

======================================================

Update : Sorry,  I mean CyU3PDmaBufferInit  actually, not CyU3PDmaBufferDeInit.

======================================================

at  the function   CyU3PDmaBufferInit the source file   cyfxtx.c,

there is a comment  says

"make those bits beyond valid memory range as unavailable."

========================================================

For example :

If I set my heap size to  2292 byte , then

   2292/32 =71 bit , 71 status bits are required , and also

         71 mod 32 = 7 .

7 bits are in     glBufferManager.usedStatus[size - 1]

and there is a local variable

     temp = 32 -7 = 25,

so i have 25 bits beyond valid memory range.

and finally the masking

glBufferManager.usedStatus[size - 1]       = ~((1 << 25) - 1)

 

  then i set the highest  7 bits of

glBufferManager.usedStatus[size - 1]   to 1.

========================================================

please correct me if I'm wrong.

訊息由此人編輯:學人 楊

0 Likes
1 Solution
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hi,

When the CY_U3P_BUFFER_HEAP_SIZE sets to 2292 and FX3_CACHE_LINE_SZ sets to 32, size is 72.

(On the line 723 in cyfxtx.c, (2292+31 & ~31) / 32 = 72)

> tmp = 32 - 7 = 25

That's correct.

> glBufferManager.usedStatus[size - 1] = ~((1 << 25) - 1)

That's correct.

> then i set the highest 7 bits of glBufferManager.usedStatus[size - 1] to 1.

That's correct.

Best regards,

Hirotaka Takayama

View solution in original post

2 Replies
HirotakaT_91
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

Hi,

When the CY_U3P_BUFFER_HEAP_SIZE sets to 2292 and FX3_CACHE_LINE_SZ sets to 32, size is 72.

(On the line 723 in cyfxtx.c, (2292+31 & ~31) / 32 = 72)

> tmp = 32 - 7 = 25

That's correct.

> glBufferManager.usedStatus[size - 1] = ~((1 << 25) - 1)

That's correct.

> then i set the highest 7 bits of glBufferManager.usedStatus[size - 1] to 1.

That's correct.

Best regards,

Hirotaka Takayama

Anonymous
Not applicable

  Thank  you for the helping (and the correction) .

0 Likes