From b572319a15bfdbefd535c0ea5c3767535c19707c Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Fri, 17 Mar 2017 14:43:38 -0700 Subject: Add single arg constructor back to compatibility reg (#553) --- src/main/scala/chisel3/compatibility.scala | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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 -- cgit v1.2.3