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

fix: evaluate target lazily in Path #4543

Merged
merged 2 commits into from
Dec 5, 2024

Conversation

unlsycn
Copy link
Contributor

@unlsycn unlsycn commented Dec 2, 2024

At the moment toTarget does not work properly with the D/I system, seeing that we cannot get the instanceName of a module when evaluating it, and even if we call toTarget in atModuleBodyEnd we will get the wrong circuit name since the definition of the module's parent is still in construction.

In order to construct Path properly, we need to defer the evaluation of target to the IR generation time in the isMember constructor, just as the other constructors already do.

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

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.

@unlsycn unlsycn marked this pull request as ready for review December 2, 2024 03:37
At the moment `toTarget` does not work properly with the D/I system,
seeing that we cannot get the instanceName of a module when evaluating
it, and even if we call `toTarget` in `atModuleBodyEnd` we will get the
wrong circuit name since the definition of the module's parent is still
in construction.

In order to construct `Path` properly, we need to defer the evaluation
of `target` to the IR generation time in the `isMember` constructor,
just as the other constructors already do.

Signed-off-by: unlsycn <unlsycn@unlsycn.com>
@sequencer sequencer added the Bugfix Fixes a bug, will be included in release notes label Dec 2, 2024
@jackkoenig
Copy link
Contributor

Please add a test

Signed-off-by: unlsycn <unlsycn@unlsycn.com>
@unlsycn unlsycn mentioned this pull request Dec 5, 2024
14 tasks
@jackkoenig jackkoenig enabled auto-merge (squash) December 5, 2024 06:34
@jackkoenig jackkoenig merged commit 429cc7a into chipsalliance:main Dec 5, 2024
14 checks passed
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.

3 participants