remove DefRegInit, change DefReg API with option definition.#1944
remove DefRegInit, change DefReg API with option definition.#1944mergify[bot] merged 4 commits intomasterfrom
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.
what is the user experience if this fails? whats an example error message that they will get?
There was a problem hiding this comment.
User will never touch this code, since it's internal API. I'll add a error message if some-devs come into this.
d398e9e to
919e965
Compare
seldridge
left a comment
There was a problem hiding this comment.
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
jackkoenig
left a comment
There was a problem hiding this comment.
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.DefRegInitandchisel3.internal.firrtl.DefRegtofirrtl.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?