FX2 GPIF FIFO read: How to get only data at corresponding valid signal?

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

cross mob
holh
Level 1
Level 1
5 replies posted 5 sign-ins First reply posted

Dear community,

I have a project that need to interface FPGA with USB FX2 via GPIF FIFO read, FX2 then retrieve all valid data and display it in PC.

FPGA sends data to FX2 with corresponding datavalid (READY2) signal.

I have configured the GPIF interface as shown below:

block_diagram.png

And here is the waveform:

gpif2.png

The problem is I always:

+ Missing and the 2 first package(1)

+ Receive redundant package at the end of cycle (2)

because GPIF always checks the condition at the end of the clock cycle (although decision points are placed at the beginning of the state in which they occur, not end).

Here is the FPGA waveform:

fpga.png

I solved (1) by adding 2 clock cycles after asserting CTRL [1: 0] then getting data , it's just a temporary solution. (2) still exists.

gpif.png

Can you please give me the best solution? I just want to get data at signal datavalid (READY2).

Thanks very much!

Best regards,

Ho.

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

PranavaYN_0-1616743411080.png


As you see from timing diagram, valid RDY signal should be asserted atleast 9ns (tSRY) before the clock. Please make sure all signals comply with setup and hold times as specified in datasheet.

Best regards,
Pranava

View solution in original post

0 Likes
9 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

It looks like there is timing issue in RDY signal.

Are you sampling RDY signals synchronously or asynchronously? Can you please specify the GPIFREADYCFG register value you are using in your firmware?

Best regards,
Pranava
0 Likes

Hi,

I kept the default configuration of GPIFREADYCFG:

GPIF.png

After exporting to gpif.c, I found that GPIFREADYCFG register value is 0x00 (I cannot understand this point, where we can change this value in GPIF designer?), then I modified to 0x40 (SAS = 1'b1) and run but no luck!

code.png

Please help!

Thanks,

Ho.

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

GPIFREADYCFG is assigned with the InitData[0] so it is 0xE0 in your code. You need not modify 0x00 to 0x40 as you have done. 0xE0 imply SAS = 1, so it should be sampling synchronously.

Can you please make sure the setup time of RDY signal complies with the Table 18 and Table 19 of the FX2LP datasheet (https://www.cypress.com/file/138911/download)

Best regards,
Pranava
0 Likes

Hi,

I misunderstood the position of GPIFREADYCFG , so thank you for your comment.

Regarding the setup time of the RDY signal, do you mean the setup time FPGA and FX2LP RDY should match?

Could you please give me your advice on it?

Thank you!

Ho.

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

PranavaYN_0-1616743411080.png


As you see from timing diagram, valid RDY signal should be asserted atleast 9ns (tSRY) before the clock. Please make sure all signals comply with setup and hold times as specified in datasheet.

Best regards,
Pranava
0 Likes

Hi,

Thanks for your suggestion! Is there any way to resolve this from the FX2LP side? Because in the FPGA, valid signals are always accompanied by data, and generating an earlier valid signal is not easy!

Thanks,

Ho.

0 Likes

Hi,

Updated: I tried to invert IFCLK but no change!

INVERT.png

Best regards,

Ho.

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

There is no other way other than satisfying respective setup times of data and ready signals.

Also you can try to capture waveforms of GSTATE pins to verify the state machine behavior.

If possible please do share your firmware project

Best regards,
Pranava
0 Likes

Hi,

I changed FPGA code to generate RDY2 one lock earlier and it run properly!

Thank you very much!

Best regards,

Ho.

0 Likes