-
Notifications
You must be signed in to change notification settings - Fork 170
Support methods with multiple output ports #849
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
9894af8 to
41803eb
Compare
|
After further discussion with @nanavati, it seems that putting a port number in So instead I am going to add a notion of tuple types and selectors to the |
50e37eb to
f47fe91
Compare
b72ad43 to
7e6d754
Compare
68538e1 to
538f154
Compare
|
Update, I have Verilog and Bluesim working for methods with multiple output ports. |
|
For the sake of reviewing these output port splitting changes before #729 is merged, I created krame505#1. |
…sn't work b/c lambda bodies aren't partially evaluated before iExpandMethod.
…ment construction
d6f158c to
1566d62
Compare
|
As I feared, rebasing this on top of the |
…uses a type lacking a Bit or SplitPorts instance
1566d62 to
500a1d6
Compare
This module only exists so that AAddSchedAssumps can create an AVInst for mkRWire of size 1. We could consider eliminating it by having BSC construct the AVInst in a better way. Until then, the interface is at least unneeded, so remove it -- eliminating the need for RWireN. Also remove vMkUnsafeRWire1, which is unneeded and should not have been created (when adding unsafe versions of the real modules).
It may have been needed for the VModInfo created by vMkRWire1, but that has been removed and testing passes without the change. Plus, VName should not be qualified, so better to catch if we are creating a qualified name somewhere.
58f9b23 to
8ea4ba6
Compare
8ea4ba6 to
76a2d19
Compare
This is nowhere close to finished, but I've started working on adding support for methods with multiple output ports, as an extension of my previous work on input port splitting in #7291. The high-level idea is to make the port-splitting type classes allow the creation of wrapper methods that return tuples of
Bitvalues, makeAConvunderstandBittuples as synthesizable, and plumb this all the way through the rest of the compiler.AIDefandAIActionValueare changed to contain multipleADefs, andAMethCallandAMethValuenow contain an index of which output port's value is being accessed from the method.I've gotten quite a ways into implementing this -
bscmostly compiles except forAState.hs, which I am still trying to make sense of. The Bluesim, lambda calculus and SAL (what is that?) back ends are currently stubbed out and give an error when encounteringAIDef/AIActionValuewith multipleADefs. I think we only really care about supporting multiple output ports for the Verilog and Bluesim backends, the others may be left as future work.One question I have for @quark17 is what is the most straightforward path to make Bluesim support methods with multiple output ports - should we generate structs for these methods' sim functions to return, containing the output port values? Or just return all the port values as a big bit vector and do the appropriate slicing?
This is still a draft with much debugging to do, but I would appreciate any early feedback.
Footnotes
I'm not sure how to make that branch show up as the base of this pull request, since the port splitting branch is on my fork of the bsc repo, so all those changes show up here as well. You can see the diff with only my new output port splitting changes here. ↩