Skip to content

Conversation

mikeurbach
Copy link
Contributor

Contributor Checklist

  • Did you add Scaladoc to every public function/method?
  • Did you add at least one test demonstrating the PR?
  • Did you delete any extraneous printlns/debugging code?
  • Did you specify the type of improvement?
  • Did you add appropriate documentation in docs/src?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • Bugfix

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).

Release Notes

This follows up on #3960 to address the behavior at the final module for the sink being driven. We already have special handling for boring out from the original source, and we need the inverse here. When we reach the final sink, if it is an input port, we should use it, rather than boring into the module and connecting to it.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels? (Select the most appropriate one based on the "Type of Improvement")
  • Did you mark the proper milestone (Bug fix: 3.6.x, 5.x, or 6.x depending on impact, API modification or big change: 7.0)?
  • Did you review?
  • Did you check whether all relevant Contributor checkboxes have been checked?
  • Did you do one of the following when ready to merge:
    • Squash: You/ the contributor Enable auto-merge (squash), clean up the commit message, and label with Please Merge.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

This follows up on #3960
to address the behavior at the final module for the sink being
driven. We already have special handling for boring out from the
original source, and we need the inverse here. When we reach the final
sink, if it is an input port, we should return it, rather than boring
into the module and connecting to it.
@mikeurbach mikeurbach added the Bugfix Fixes a bug, will be included in release notes label Apr 15, 2024
@@ -254,8 +257,9 @@ object BoringUtils {
path.zip(connectionLocation).foldLeft(source) {
case (rhs, (module, conLoc)) if (module.isFullyClosed) => boringError(module); DontCare.asInstanceOf[A]
case (rhs, (module, _))
if (up && module == path(0) && isPort(rhs) && (!createProbe.nonEmpty || !createProbe.get.writable)) => {
// When drilling from the original source, if it's already a port just return it.
if ((up || isDriveDone(rhs)) && module == path(0) && isPort(rhs) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This diff isn't great due to line wrapping, but the change was up -> (up || isDriveDone(rhs)), which has the logic to know if we need to stop at the last boundary or go inside it. We stop on an input, but we go inside on an output. The tests show what I mean. Previously, we'd always go inside, which creates illegal FIRRTL for driving and input.

Copy link
Member

Choose a reason for hiding this comment

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

Aside to I suppose mostly myself: We could probably change the RWProbe bores from inside behavior now, actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This logic could use a cleanup in general... I've only made it worse. So maybe settling on the final RWProbe behavior could be done as part of that.

Copy link
Member

@dtzSiFive dtzSiFive left a comment

Choose a reason for hiding this comment

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

LGTM!

@@ -254,8 +257,9 @@ object BoringUtils {
path.zip(connectionLocation).foldLeft(source) {
case (rhs, (module, conLoc)) if (module.isFullyClosed) => boringError(module); DontCare.asInstanceOf[A]
case (rhs, (module, _))
if (up && module == path(0) && isPort(rhs) && (!createProbe.nonEmpty || !createProbe.get.writable)) => {
// When drilling from the original source, if it's already a port just return it.
if ((up || isDriveDone(rhs)) && module == path(0) && isPort(rhs) &&
Copy link
Member

Choose a reason for hiding this comment

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

Aside to I suppose mostly myself: We could probably change the RWProbe bores from inside behavior now, actually.

@mikeurbach mikeurbach merged commit a9b1017 into main Apr 15, 2024
@mikeurbach mikeurbach deleted the mikeurbach/boring-drive-stop-at-instance branch April 15, 2024 23:55
SpriteOvO pushed a commit that referenced this pull request Apr 20, 2024
…3998)

This follows up on #3960
to address the behavior at the final module for the sink being
driven. We already have special handling for boring out from the
original source, and we need the inverse here. When we reach the final
sink, if it is an input port, we should use it, rather than boring
into the module and connecting to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix Fixes a bug, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants