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 panama binding and converter framwork #3754

Merged
merged 5 commits into from
Jan 22, 2024
Merged

Conversation

sequencer
Copy link
Member

@sequencer sequencer commented Jan 20, 2024

This PR contains API modifications, but won't affect normal users.

In my original design, I thought the binding framework was trivial, and we may maintain other converter like JNAConverter or JNIConveter, however after 3 months work, I realize I was too native, I don't think it's valuable to devote another intern or master student to work on another implementation. So I removed those abstract deceleration from the main chisel project, to remove the dependency from OM to chiesl.

After this refactor, there are 4 modules to be traced:

  • circtpanamabinding is the JavaModule store all CIRCT C-API
  • panamalib is the ScalaModule maintaining a internal Scala API for all panama dependencies.
  • panamaom is the standalone OMEvaulator, which can be used for parsing mlirbc and providing a Scala API to access all Property generated from Chisel. It won't depend on chisel.
  • panamaconverter is the Converter which directly visit the internal ChiselIR, and creating inmemory-MLIRBlock. It is subject to replace the current firrtl serializer in chisel in the future chisel versions. But we may continue maintaining them together in a relative long time.

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)
  • API modification
  • API deprecation
  • Backend code generation
  • Performance improvement
  • Bugfix
  • Documentation or website-related
  • Dependency update
  • Internal or build-related (includes code refactoring/cleanup)

Desired Merge Strategy

  • Squash: The PR will be squashed and merged (choose this if you have no preference).
  • Rebase: You will rebase the PR onto master and it will be merged with a merge commit.

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.5.x, 3.6.x, or 5.x depending on impact, API modification or big change: 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.

@sequencer sequencer added the Internal Internal change, does not affect users, will be included in release notes label Jan 20, 2024
@sequencer sequencer force-pushed the panama-refactor branch 2 times, most recently from 5a9e75b to 7175d67 Compare January 22, 2024 12:41
@sequencer sequencer added API Modification and removed Internal Internal change, does not affect users, will be included in release notes labels Jan 22, 2024
- split binder into two projects: Java Module circtpanamabinding and
  ScalaModule panamaconverter, in the future, OMEvaultor will be split
  from converter and get rid of dependency from chisel.
- remove original test, add a small lit+FileCheck test in
  lit/tests/PanamaConveter to show how to write test.
In the future, we should rename them to org.chipsalliance...
But for now, since we need to access internal API of chisel, panama is
using the prefix of chisel3
@sequencer
Copy link
Member Author

Just slip it since it doesn't affect any downstream users(SiFive, UCB, Xiangshan) other than T1, fell free to revert ;p

@sequencer sequencer merged commit b37180d into main Jan 22, 2024
14 checks passed
@sequencer sequencer deleted the panama-refactor branch January 22, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant