-
Notifications
You must be signed in to change notification settings - Fork 895
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
Produce $bmux
cells in shiftmul transformation
#3880
base: main
Are you sure you want to change the base?
Conversation
I took on a little exercise in Tcl writing and produced the graph below, comparing the gate cost on one testcase, switching between doing nothing, testcase.v
sweep.tcl
Commands:
|
So, I propose, let's just produce bmuxes up to some high |
Let's make sure that jump isn't a bug in the transformation code... |
It is, it fails equivalence checking around that edge |
Which edge are you talking about, the one around 105-ish or the one around 170-ish? |
105-ish (FWIW the drop in muxes around 170 is compensated by other gates which is the new yellow line) |
I am going to assume the jump is at exactly 102, correct? |
Yes, though it starts failing at 69 already, one above 34*2 |
Ah I see the bug |
OK, generating a new graph |
I hogged one of the ETH servers overnight and created a larger sweep, note that the color-scale of the reference (untransformed) is different: Both bmux and wshift look well behaved and pretty much identical. From a Quality-of-Results perspective I think this PR is ready, the two things left are:
|
I'm going to give this a little bit of a bump; is anything blocking this? |
There are still some changes to be made. In one of the dev JFs we have decided on the following:
Personally I also want to add a way to specify a numeric |
This sounds like an excellent opportunity to use the scratchpad. |
Genuinely curious: How is that better than having a command option? With scratchpad it's more cumbersome to invoke. Is the argument along the lines that scratchpad configuration is exposed from synth scripts without any extra work? |
I am pretty strongly against flag proliferation in synthesis scripts; I've written cookbooks to explain the purpose of the variety of flags in Yes, doing That way you have the same command for every synthesis flow, instead of needing to file a PR that adds your flag to every synthesis flow. |
@povik could you rebase this PRs branch ontop of your peepopt-work branch? The default of As for the options: The additional options like forcing only |
Drop code that was once used by the 'dffmux' pattern but now is unused after that pattern has been obsoleted by the 'opt_dff' pass.
No functional change intended.
The `opt_expr` pass running before `peepopt` can interfere with the detection of a shiftmul pattern due to some of the bottom bits of the shift amount being replaced with constant zero. Extend the detection to cover those situations as well.
Add a separate shiftmul pattern to match on left shifts which implement demuxing. This mirrors the right shift pattern matcher but is probably best kept separate instead of merging the two into a single matcher. In any case the diff of the two matchers should be easily readable.
@phsauter Done! Rebased on the other PR. |
Prompted by the discussion in #3873 I played around with changing the right shiftmul transformation to either (1) produce
$bmux
cells; (2) produce a number of independent shift cells. For now these are special modes conditioned on a-bmux
or-wshift
option, and in contrast to the original shiftmul transformation in those modes we allow for what we call theW2>W
case over at #3873.The code here is on top of the other PR, but the last commit is where the focus is.
Cc: @phsauter