Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdram can miss command transitions #10

Closed
osresearch opened this issue Jul 10, 2018 · 2 comments
Closed

sdram can miss command transitions #10

osresearch opened this issue Jul 10, 2018 · 2 comments

Comments

@osresearch
Copy link
Contributor

It looks like the sdram_controller can miss read/write commands if they occur when a refresh is happening. It checks for edges on the enable pins only if state == IDLE:

  if (state == IDLE)
     if (rd_enable && !rd_enable_prev)
          begin
          next = READ_ACT;
          command_nxt = CMD_BACT;

but the rd_enable_prev and wr_enable_prev are updated on every clock cycle:

always @ (posedge clk)
   begin

    wr_enable_prev <= wr_enable;
    rd_enable_prev <= rd_enable;
osresearch added a commit to osresearch/BeagleWire that referenced this issue Jul 10, 2018
This addresses issue pmezydlo#10, where commands would be lost if they occured
during the refresh cycle, by adding an explicit ACK output that
indicates that the controller has started on the read or write.

It still fails the sdram-test, but actually seems to be almost working.
@osresearch
Copy link
Contributor Author

I changed sdram-controller to use a level-triggered rd/wr enable and have it signal when it has started the operation. This allows small read/write tests to work fairly reliably and avoids the missing commands:

osresearch@402d3d0

However, on a larger random read/write test it fails quite often. On a linear write and read back about 1.3% errors. On a random read/write there are around 99% errors, although the test followsup with re-reading the same address the error rate is around 0.7%.

@ombhilare999
Copy link
Collaborator

Now we are using litedram + serv for sdram, it passed the litex mem test.
https://twitter.com/QwertyEmbedded/status/1418128122042486787

regards,
omkar bhilare
ombhilare999@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants