-
Notifications
You must be signed in to change notification settings - Fork 342
[FIRRTL] Implement intrinsic module pla
#6381
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
base: main
Are you sure you want to change the base?
Conversation
I'm assuming this will have a more descriptive name if it is proposed. |
It's not obvious this should be an intrinsic rather than a chisel library. Intrinsics are generally reserved for things which require either implementation knowledge (e.g. sizeof needs to reason about the post-inferred type of it's argument), or need to produce specific non-standard output which is hard to constrain existing constructs to (e.g. muxcell must map to mux cell libraries). |
This was discussed in the Chisel dev meeting, sorry for not updating the detail documentation here. The reason implementing PLA is that Chisel wants to migrate decoding logic from Scala to CIRCT in the near feature, since the decoder circuit backend in Chisel is PLA, the first step of migration is implementing a PLA intmodule which allows the Decoder intmodule(in the following PR) being able to be lowered to PLA intmodule in the CIRCT pass. Here is the migrating step in my mind:
After finishing this, we can provide other backend, e.g. |
The goal is not to implement a bunch of piece-wise ops matching various parts of the chisel library, the goal is to provide a set of building blocks to construct interesting things. The basic operation needed seems to be match on a bitpat. From this you can build all kinds of decoders. You can also build plenty of optimizers since walking a mux structure of matches is straight-forward (only issue may be that this encodes priority). A generic wild-card match operation would also help LTL expressions I suspect. You also want to design the IR such that you get good output no mater the input. The more ways of expressing equivalent functionality, the more the output will depend on accidents of the input. Code generation falls in to a very EDA-style pattern-match heavy approach which provides a very inconsistent user experience. It is valid to capture higher-level constructs if reconstructing them is hard and you are optimizing on properties of those which are hard to reconstruct once lowered, but this is a tradeoff (against consistent output quality). @fabianschuiki should be involved (due to LTL and verif constructs) to help make sure we don't wind up with redundant representations. |
Hey @SpriteOvO, @sequencer! Thanks for starting an effort to move the synthesis pieces from Chisel into CIRCT. That's very exciting 🥳 It would be great if we could somehow get the Espresso/QMC interaction represented in CIRCT through some dedicated operation that encapsulates a region of There is a lot of value in having a good representation for lookup tables and these PLA-style DNFs in CIRCT. Other dialects and tools likely want to take advantage of those as well! For example, the Arc dialect has an My suggestion would be to not have a PLA FIRRTL intrinsic, because all the intrinsic does right now is get converted to the Disjunctive Normal Form in Just some random thoughts. It's very exciting that we start pushing into the EDA/synthesis/optimization territory! 🥳 |
Currently this PR just shows what it looks like, it is not tested and may not work as expected.