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

sdModel.v keeps busy #10

Open
t123yh opened this issue Apr 4, 2021 · 2 comments
Open

sdModel.v keeps busy #10

t123yh opened this issue Apr 4, 2021 · 2 comments

Comments

@t123yh
Copy link

t123yh commented Apr 4, 2021

Hi,

I am trying to simulate using the exampe software and sdcard model. In sdModel.v#L377, OCR[31] gets the reversed value of Busy. In L104, it says that Busy should be 0 when busy, so OCR[31] is 1 when Busy.

By the definition of OCR register (refer to this spec Page 17), OCR[31] is “0” = Busy “1” = Ready, the reversion is wrong.

I think L377 should be OCR[31]<=Busy;, removing the reversion.

@mczerski
Copy link
Owner

mczerski commented Apr 4, 2021

The sdMode.v file is a heritage from the original project that I based my work on (http://opencores.org/project,sdcard_mass_storage_controller). I took all the tests of the original project as they were and reimplemented the core so I'm not very familiar with this part of the code. I think that You may get more help from the author of the original project. But, it seems that You are right about the Busy signal although the proposed change make simulation hang for the test.sd_controller_top_tb. I will try to look into it.

@t123yh
Copy link
Author

t123yh commented Apr 5, 2021

It seems that the testbench you mentioned checks if the card is busy on startup, and waits for it to be idle (code). I believe it's done in a reversed polarity just as the sdModel.v. Although not tested, I believe that If you correct the check, it will continue to run.

The problem is discovered while I am trying to do simulation using mmc.c. The same check is done in mmc.c#L185, in the correct polarity. So if the busy polarity is wrong in sdModel.v, mmc.c will hang forever.

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