From 815b1c3cb311b7f4dfb7a2f00e0e2d62795bdc6b Mon Sep 17 00:00:00 2001 From: Jack Date: Fri, 11 Nov 2016 14:37:03 -0800 Subject: Add checks for misuse or omission of Module() Implemented by adding a Boolean to check for alternating invocations of object Module.apply and the constructor of abstract class Module. Fixes #192 --- src/test/scala/chiselTests/AnnotatingExample.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test/scala/chiselTests/AnnotatingExample.scala') diff --git a/src/test/scala/chiselTests/AnnotatingExample.scala b/src/test/scala/chiselTests/AnnotatingExample.scala index c84edf86..04228d6b 100644 --- a/src/test/scala/chiselTests/AnnotatingExample.scala +++ b/src/test/scala/chiselTests/AnnotatingExample.scala @@ -141,5 +141,5 @@ object MyDriver extends BackendCompilationUtilities { /** * illustrates a chisel3 style driver that, annotations can only processed within this structure */ - def buildAnnotatedCircuit[T <: Module](gen: () => T): Map[String, String] = MyBuilder.build(Module(gen())) -} \ No newline at end of file + def buildAnnotatedCircuit[T <: Module](gen: () => T): Map[String, String] = MyBuilder.build(gen()) +} -- cgit v1.2.3 From b0cc0c93a80aec5bed54cfb11923636c09b7e180 Mon Sep 17 00:00:00 2001 From: ducky Date: Thu, 17 Nov 2016 11:21:59 -0800 Subject: SInt conversion finished, everything builds again --- src/test/scala/chiselTests/AnnotatingExample.scala | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/test/scala/chiselTests/AnnotatingExample.scala') diff --git a/src/test/scala/chiselTests/AnnotatingExample.scala b/src/test/scala/chiselTests/AnnotatingExample.scala index 04228d6b..0be3ba59 100644 --- a/src/test/scala/chiselTests/AnnotatingExample.scala +++ b/src/test/scala/chiselTests/AnnotatingExample.scala @@ -24,8 +24,8 @@ import scala.util.DynamicVariable class SomeSubMod(param1: Int, param2: Int) extends Module { val io = new Bundle { - val in = UInt(INPUT, 16) - val out = SInt(OUTPUT, 32) + val in = Input(UInt(16.W)) + val out = Output(SInt(32.W)) } val annotate = MyBuilder.myDynamicContext.annotationMap @@ -36,18 +36,18 @@ class SomeSubMod(param1: Int, param2: Int) extends Module { class AnnotatingExample extends Module { val io = new Bundle { - val a = UInt(INPUT, 32) - val b = UInt(INPUT, 32) - val e = Bool(INPUT) - val z = UInt(OUTPUT, 32) - val v = Bool(OUTPUT) + val a = Input(UInt(32.W)) + val b = Input(UInt(32.W)) + val e = Input(Bool()) + val z = Output(UInt(32.W)) + val v = Output(Bool()) val bun = new Bundle { - val nested_1 = UInt(INPUT, 12) - val nested_2 = Bool(OUTPUT) + val nested_1 = Input(UInt(12.W)) + val nested_2 = Output(Bool()) } } - val x = Reg(UInt(width = 32)) - val y = Reg(UInt(width = 32)) + val x = Reg(UInt(32.W)) + val y = Reg(UInt(32.W)) val subModule1 = Module(new SomeSubMod(1, 2)) val subModule2 = Module(new SomeSubMod(3, 4)) -- cgit v1.2.3