-
Notifications
You must be signed in to change notification settings - Fork 615
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
deprecate WireInit #2764
base: 3.5.x
Are you sure you want to change the base?
deprecate WireInit #2764
Conversation
a19e841
to
c43962a
Compare
How does this relate to |
What is the incentive for removing WireInit? Many existing projects use WireInit extensively. |
In a SiFive repo, both WireInit and WireDefault are used extensively, but WireInit is by far the more popular choice. |
Now I feel less bad about using |
i feel like we bikeshedded this already, but we already have all the *Init why introduce a new word Default? |
i have no problem if we agree WireDefault is the right name to globally find and replace |
I don't want to debate whether I just want to point out that maintaining the |
It's not zero burden for Chisel in testing, for onboarding Chisel users, and readability of existing Chisel libraries, though. If there's one function for creating a wire with an initial (or default) value that seems like a good language design principle to me. I hope that we can all agree that having one way of doing this would benefit Chisel as a language, even if it requires users to update their code. Analogously, the LLVM project has always had
I think these types of questions should be evaluated in terms of the language: Does having one way of initializing a wire make Chisel better? I'm not saying backwards compatibility is bad to aim for, but we need a cost metric other than "anything that requires an existing project to change anything is bad". Other, much larger and much more widely used projects (e.g. LLVM) go through this kind of healthy activity and continuous improvement/refinement at a surprising pace. |
Given that we accept the premise that it is justifiable to deprecate things, why are we choosing to deprecate the version that people have spoken up in favor of using (and is easier to type)? |
I don't think this API relate to
The incentive is keeping two same APIs is misleading to new users, since
Agree, but after #986 was in, I switch to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A SiFive-internal discussion considered the merits of Init
vs. Default
in this context. There was sympathy for the notion that WireInit
and RegInit
are not actually symmetric. But there was also some agreement that VecInit
is consistent with WireInit
, and it would be even more inconsistent to deprecate WireInit
without also creating VecDefault
and deprecating VecInit
.
My opinion is that we should make no changes until we've thought through how to name all of these constructs, weighing Init
vs. Default
(vs. Reset
vs ...
) for each API. Then, we can do the new-API creation and old-API deprecation in bulk. I suspect we'll cause less churn that way.
(Other maintainers should feel free to dismiss this review if there's sufficient agreement to the contrary.)
Given that
The
Fair point. Although in that case, LLVM changed to conform to existing patterns in the STL and C++ community. I don't think the benefit is quite as clear-cut here.
I agree, but that does not imply the cost metric shouldn't consider backwards compatibility as a factor at all. It ought to be considered that there is a growing collection of chisel generators without active maintainers, or maintainers who are interested in keeping up with the latest chisel. Preserving backwards compatibility such that these packages can be used in projects with newer chisel versions is good for the chisel community in general. |
It is hard to fix namings after a product is in use. I still strongly support the "default" name, as we say when describing combinational circuits: "we assign a default value to a combinational circuit, especially to avoid describing latches" (not in Chisel but in V). We "initialize" a register on reset. Yes, When we talk about naming things: I don't like |
My opinion is: bad names doesn't matter, |
This is much stronger than considering the cost of changes to code. This is a very strong premise of "I will be able to compile a long dead project and an active, live project together with the newest version of Chisel." It then follows that any backwards-incompatible change to Chisel, however trivial, will violate this premise. I am arguing that this premise is wrong. A long dead project stuck on an old version of Chisel should be able to be used in a new project with a newer version of Chisel, but they should be separately compiled and linked at the FIRRTL/MLIR or Verilog levels. The version of Chisel used to generate FIRRTL/Verilog is then per-project as opposed to the lowest common denominator (or the newest version, but requiring forever backwards compatibility). Admittedly, Chisel has never provided a good answer to how to do this and, in consequence, projects have commonly chosen monolithic compilation and assemblage via submodules (e.g., Rocket Chip, Chipyard, etc.). Additionally, libraries have been built on top of Chisel that assume monolithic compilation. Definition/Instance was an approach to help with this, ideas like WDYT? (Thanks for this comment, though! I've had a very hard time articulating why seemingly innocuous changes like this are easy for other projects and hard for Chisel. I think your comment sheds a lot of light on the problem.) |
WireInit
andWireDefault
stayed together for almost 3 years, see #959It's reasonable to deprecate one of which and remove
WireInit
in the next Chisel major version.Contributor Checklist
docs/src
?Type of Improvement
API Impact
Backend Code Generation Impact
Desired Merge Strategy
Release Notes
deprecate
WireInit
Reviewer Checklist (only modified by reviewer)
3.4.x
, [small] API extension:3.5.x
, API modification or big change:3.6.0
)?Enable auto-merge (squash)
, clean up the commit message, and label withPlease Merge
.Create a merge commit
.