Skip to content

Conversation

rwy7
Copy link
Contributor

@rwy7 rwy7 commented Nov 14, 2024

The InlineInstance trait can be attached to a module, to cause firtool to inline instance of that module. The inline annotation is tricky to wield because, if an inline module dedups with another module, we will inline all instances of both modules.

To make InlineInstance easier to use, whenever we mark a module as inline, we also mark it as "no dedup".

This of course does not work well when we have a module which we want to inline AND dedup. So, this PR adds a new InlineInstanceAllowDedup trait which allows a module to be marked inline without blocking dedup.

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

  • Feature (or new API)

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.

@seldridge seldridge added the Feature New feature, will be included in release notes label Nov 14, 2024
The InlineInstance trait can be attached to a module, to cause firtool to
inline instance of that module. The inline annotation is tricky to wield
because, if an inline module dedups with another module, we will inline all
instances of both modules.

To make InlineInstance easier to use, whenever we mark a module as inline, we
also mark it as "no dedup".

This of course does not work well when we have a module which we want to inline
AND dedup. So, this PR adds a new InlineAllInstances trait which allows a
module to be marked inline without blocking dedup.
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.

LGTM

@seldridge seldridge enabled auto-merge (squash) November 14, 2024 20:04
@seldridge seldridge merged commit 4fa08f8 into chipsalliance:main Nov 14, 2024
14 checks passed
@rwy7 rwy7 changed the title Add new InlineAllInstances trait Add new InlineInstanceAllowDedup trait Nov 14, 2024
@rwy7 rwy7 deleted the main branch November 14, 2024 21:15
tymcauley added a commit to tymcauley/rocket-chip that referenced this pull request Mar 9, 2025
The `ChiselAnnotation` API is going away in Chisel 7. Also in Chisel 7,
this trait can be replaced by
`chisel3.util.experimental.InlineInstanceAllowDedup`:
chipsalliance/chisel#4508
tymcauley added a commit to tymcauley/rocket-chip that referenced this pull request Mar 9, 2025
The `ChiselAnnotation` API is going away in Chisel 7. Also in Chisel 7,
this trait can be replaced by
`chisel3.util.experimental.InlineInstanceAllowDedup`:
chipsalliance/chisel#4508
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.

2 participants