-
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
Compat compile options macro #1253
Conversation
This switches from using an implicit val that required awkward suppression (as illustrated in CompileOptionsSpec) to allowing overriding in the same way as done in "import chisel3._" via the creation of an implicit val in lexical scope.
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.
lgtm
Unfortunately, this seems to cause rocket-chip regression tests to fail:
|
uh oh. I'll debug |
@ucbjrl this did not make it into 3.2.1 right? |
Correct. It's been back-ported to 3.2.x so it would go out in 3.2.2. |
It looks like the |
Alright so the issue then is that by removing the implicit val, |
It's worse than that, some parts are using the implicit from the macro, others are pulling from This pulls from implicit class AddDirectionToData[T<:Data](target: T) {
def asInput: T = Input(target)
def asOutput: T = Output(target)
def flip(): T = Flipped(target)
} This gets the macro in object Wire extends WireFactory {
import chisel3.CompileOptions
def apply[T <: Data](dummy: Int = 0, init: T)(implicit compileOptions: CompileOptions): T = {
println(s"compileOptions = $compileOptions")
chisel3.WireDefault(init)
}
def apply[T <: Data](t: T, init: T)(implicit compileOptions: CompileOptions): T =
chisel3.WireDefault(t, init)
}
|
I think this is fixable, but I don't have the time to do it thoroughly at the moment so I'm going to revert. |
This reverts commit 85fe90d.
This switches from using an implicit val that required awkward
suppression (as illustrated in CompileOptionsSpec) to allowing
overriding in the same way as done in "import chisel3._" via the
creation of an implicit val in lexical scope.
The motivation is attempting to partially migrate Diplomatic stuff in rocket-chip to
import chisel3._
. I currently have to do the following:It would be nice if we could just write
This is probably backportable to
3.2.x
, although if so we should (probably) exclude the deprecation ofChisel.defaultCompileOptions
.Related issue:
Type of change: other enhancement
Impact: API modification
Development Phase: implementation
Release Notes
Chisel.defaultCompileOptions
with a low-priority macroChisel.defaultCompileOptions