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
remove DefRegInit, change DefReg API with option definition. #1944
Conversation
61b96c9
to
62d5220
Compare
case class DefReg(sourceInfo: SourceInfo, id: Data, clock: Arg) extends Definition | ||
case class DefRegInit(sourceInfo: SourceInfo, id: Data, clock: Arg, reset: Arg, init: Arg) extends Definition | ||
case class DefReg(sourceInfo: SourceInfo, id: Data, clock: Arg, reset: Option[Arg], init: Option[Arg]) extends Definition { | ||
assert((reset.isDefined && init.isDefined) || (reset.isEmpty && init.isEmpty)) |
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.
what is the user experience if this fails? whats an example error message that they will get?
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.
User will never touch this code, since it's internal API. I'll add a error message if some-devs come into this.
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.
error message added in commit 919e965
d398e9e
to
919e965
Compare
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.
This saves some line count by changing an internal API. That seems fine to me.
I'd prefer to use Option[(Arg, Arg)]
to avoid the need for a possible assertion failure (which admittedly should never occur).
919e965
to
4a753f0
Compare
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.
If I recall correctly, there was some issue with either chiseltest or chisel-testers. Can you check if they both compile with this change @sequencer? And if not, please file corresponding PR(s) on the broken repo(s).
ask for review again by @jackkoenig |
Related chisel-testers PR: freechipsproject/chisel-testers#318 |
I'm currently working on cleaning chisel ir, I found it is strange to map both
chisel3.internal.firrtl.DefRegInit
andchisel3.internal.firrtl.DefReg
tofirrtl.ir.DefRegister
. This PR corrects this.Contributor Checklist
docs/src
?Type of Improvement
API Impact
None
Backend Code Generation Impact
None
Desired Merge Strategy
f- Rebase: You will rebase the PR onto master and it will be merged with a merge commit.
Release Notes
None
Reviewer Checklist (only modified by reviewer)
Please Merge
?