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

Refactor TruthTable.apply and add factory method for Espresso #2612

Merged
merged 10 commits into from
Jul 6, 2022

Conversation

adkian-sifive
Copy link
Contributor

@adkian-sifive adkian-sifive commented Jul 1, 2022

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 state the API impact?
  • Did you specify the code generation impact?
  • Did you request a desired merge strategy?
  • Did you add text to be included in the Release Notes for this change?

Type of Improvement

  • performance improvement
  • code refactoring
  • new feature/API

API Impact

Add new factory method for TruthTable which allows using Espresso's fd formatting for truth tables

Backend Code Generation Impact

Desired Merge Strategy

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

Release Notes

Optimize TruthTable.apply by refactoring string processing to bitwise operations. Add new factory method for TruthTable to allow calling TruthTable.apply with Espresso's fd format.

Reviewer Checklist (only modified by reviewer)

  • Did you add the appropriate labels?
  • Did you mark the proper milestone (Bug fix: 3.4.x, [small] API extension: 3.5.x, API modification or big change: 3.6.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.

@adkian-sifive adkian-sifive force-pushed the truthtable-refactor branch 2 times, most recently from f13e0c6 to f178c89 Compare July 6, 2022 00:12
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.

One last nit but otherwise LGTM!

@jackkoenig jackkoenig added this to the 3.5.x milestone Jul 6, 2022
Co-authored-by: Jack Koenig <jack.koenig3@gmail.com>
@jackkoenig jackkoenig enabled auto-merge (squash) July 6, 2022 17:51
@jackkoenig jackkoenig added the Feature New feature, will be included in release notes label Jul 6, 2022
@jackkoenig jackkoenig merged commit 231f14e into chipsalliance:master Jul 6, 2022
mergify bot pushed a commit that referenced this pull request Jul 6, 2022
Improves performance of creating TruthTables by processing entire BitPats
rather than individual bits. New TruthTable factory method enables
constructing TruthTables with semantics of OR-ing output BitPats together
rather than erroring when multiple terms have the same input BitPat.
This alternative factory method matches semantics for the output format
of Espresso.

Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit 231f14e)

# Conflicts:
#	src/main/scala/chisel3/util/BitPat.scala
@mergify mergify bot added the Backported This PR has been backported label Jul 6, 2022
mergify bot added a commit that referenced this pull request Jul 6, 2022
#2612) (#2620)

* Refactor TruthTable.apply and add factory method for Espresso (#2612)

Improves performance of creating TruthTables by processing entire BitPats
rather than individual bits. New TruthTable factory method enables
constructing TruthTables with semantics of OR-ing output BitPats together
rather than erroring when multiple terms have the same input BitPat.
This alternative factory method matches semantics for the output format
of Espresso.

Co-authored-by: Megan Wachs <megan@sifive.com>
Co-authored-by: Jack Koenig <koenig@sifive.com>
(cherry picked from commit 231f14e)

# Conflicts:
#	src/main/scala/chisel3/util/BitPat.scala

* Resolve backport conflicts

Co-authored-by: Aditya Naik <91489422+adkian-sifive@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backported This PR has been backported Feature New feature, will be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants