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

Add higher level explanations of RoCC + more resources #1486

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

nikhiljha
Copy link
Member

@nikhiljha nikhiljha commented May 26, 2023

Small PR based on feedback from EE194 (tapeout) to explain what RoCC is at a higher level, and some resources for actually using the RoCC interface.

Type of change:

  • Other enhancement (Documentation)

Impact:

  • Other (Documentation)

Contributor Checklist:

  • Did you set main as the base branch?
  • Is this PR's title suitable for inclusion in the changelog and have you added a changelog:<topic> label?
  • Did you state the type-of-change/impact?
  • Did you delete any extraneous prints/debugging code?
  • Did you mark the PR with a changelog: label?

docs/Customization/RoCC-Accelerators.rst Outdated Show resolved Hide resolved

At a high level, you must tag requests that you send across this interface using the ``io.mem.req.tag``, and the tag will be returned to you when the data is ready.
Responses may come back out of order if you issue multiple requests, so you can use these tags to tell what data came back.
Note that the top two bits of the tag are reserved, and MUST be set to zero, or the interface will exhibit undefined behavior.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. I think that might actually be a bug somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been a minute but from what I recall:

What happens is SimpleHellaCacheIF puts the entire tag into its replay queue, but the actual memory IF drops the top two bits... so when the data returns the tag is missing the top two bits and SimpleHellaCacheIF won't remove it from the nack queue (since it sees that it got a message with a different tag). This leads to the nack queue filling up and simplehellacacheif permanently asserting not ready.

If you look at the two rocc accelerators in chipyard they both set the top two bits to zero presumably for this reason. That's why I mentioned SimpleHellaCacheIF-- even if it should be an implementation detail you may need to inspect it to have working code 🥲

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the actual number of tag bits available to use? Is it 6?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's

(coreParams.dcacheReqTagBits + log2Ceil(dcacheArbPorts)

so maybe the top log2Ceil(dcacheArbPorts) bits of the tag are supposed to be the port that the request came in from and that's why they need to be zeroed(?)... I'll try to figure this out again 🤔

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might just be dcachereqtagbits

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated this so we can get these docs in. Let me know if this still seems unclear.

docs/Customization/RoCC-Accelerators.rst Outdated Show resolved Hide resolved
@jerryz123 jerryz123 merged commit d72158e into ucb-bar:main Jun 13, 2023
50 checks passed
@nikhiljha nikhiljha deleted the rocc-doc branch February 5, 2024 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants