diff options
| author | Richard Lin | 2017-03-17 14:43:38 -0700 |
|---|---|---|
| committer | GitHub | 2017-03-17 14:43:38 -0700 |
| commit | b572319a15bfdbefd535c0ea5c3767535c19707c (patch) | |
| tree | d9a145b739668718569643f0b07be155fbe1cf64 /src/main/scala/chisel3 | |
| parent | a6798adbf7567cf105f8190ebd293a4cfb3aeb11 (diff) | |
Add single arg constructor back to compatibility reg (#553)
Diffstat (limited to 'src/main/scala/chisel3')
| -rw-r--r-- | src/main/scala/chisel3/compatibility.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/scala/chisel3/compatibility.scala b/src/main/scala/chisel3/compatibility.scala index 17fd1fee..40fbe9bf 100644 --- a/src/main/scala/chisel3/compatibility.scala +++ b/src/main/scala/chisel3/compatibility.scala @@ -171,6 +171,12 @@ package object Chisel { // scalastyle:ignore package.object.name import chisel3.core.{Binding, CompileOptions} import chisel3.internal.sourceinfo.SourceInfo + // Passthrough for chisel3.core.Reg + // Single-element constructor to avoid issues caused by null default args in a type + // parameterized scope. + def apply[T <: Data](t: T)(implicit sourceInfo: SourceInfo, compileOptions: CompileOptions): T = + chisel3.core.Reg(t) + /** Creates a register with optional next and initialization values. * * @param t: data type for the register |
