8000 Add resetType to inline test TestParameters by tmckay-sifive · Pull Request #4789 · chipsalliance/chisel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add resetType to inline test TestParameters #4789

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

Merged

Conversation

tmckay-sifive
Copy link
Contributor
@tmckay-sifive tmckay-sifive commented Mar 12, 2025

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

  • API modification

Desired Merge Strategy

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

Release Notes

  • Add resetType to chisel3.experimental.inlinetest.TestParameters. It will now be easier to properly handle DUTs with uninferred resets.

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) and clean up the commit message.
    • Merge: Ensure that contributor has cleaned up their commit history, then merge with Create a merge commit.

Copy link
Contributor
@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

I haven't really thought deeply about this, but the implementation makes sense to me.

@mikeurbach
Copy link
Contributor

Copy link
Member
@seldridge seldridge left a comment

Choose a reason for hiding this comment

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

Is the code path involving a None reset type tested / can be tested?

I also think this approach makes sense.

What may help make this easier is if we had the ability to cast to whatever type of reset something will be. I.e., there is nothing wrong with driving an asynchronous reset with a synchronous reset. However, that will influence the inference algorithm which is what we don't want to do here.

I think maybe missing an import for the new tests?

generateFirrtlAndFileCheck(new ModuleWithTests(resetType = Module.ResetType.Synchronous))(
fileCheckString("UInt<1>")
)
Copy link
Member

Choose a reason for hiding this comment

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

I deleted these APIs and unified around one FileCheck API. The PR can use:

Suggested change
generateFirrtlAndFileCheck(new ModuleWithTests(resetType = Module.ResetType.Synchronous))(
fileCheckString("UInt<1>")
)
ChiselStage.emitCHIRRTL(new ModuleWithTests(resetType = Module.ResetType.Synchronous)).fileCheck()(
fileCheckString("UInt<1>")
)

8000
Copy link
Contributor
@jackkoenig jackkoenig left a comment

Choose a reason for hiding this comment

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

LGTM

@tmckay-sifive tmckay-sifive force-pushed the tmckay/inline-test-reset-type branch from e280d7b to 5d2d731 Compare March 12, 2025 21:01
@jackkoenig jackkoenig added the Feature New feature, will be included in release notes label Mar 13, 2025
@jackkoenig
Copy link
Contributor

Marking as Feature because the API this is modifying is not yet released

@jackkoenig jackkoenig merged commit 34fbd6c into chipsalliance:main Mar 13, 2025
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0