From 8168a8eea6c3465966081c5acd0347e09791361c Mon Sep 17 00:00:00 2001 From: Richard Lin Date: Thu, 5 Oct 2017 12:13:27 -0700 Subject: the cloneType and chiselCloneType hot mess 🔥 (#653) Addresses #419 cloneType is now marked (through comments only) as an internal API. chiselCloneType deprecated (and changed to cloneTypeFull internally, analogous to cloneTypeWidth). chiselTypeOf(data) introduced as the external API to get a chisel type from a hardware object Intended usage: cloning is an implementation detail, and chisel types and hardware objects both should act as immutable types, with operations like Input(...), Reg(...), etc returning a copy and leaving the original unchanged. Hence, the clone operations are all deprecated. Deletes what appears to be an unused Bundle companion object. Input(...), Output(...), Flipped(...) require the object to be unbound--- src/test/scala/chiselTests/Module.scala | 2 +- src/test/scala/chiselTests/Vec.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/test') diff --git a/src/test/scala/chiselTests/Module.scala b/src/test/scala/chiselTests/Module.scala index 432cd278..e84e6a02 100644 --- a/src/test/scala/chiselTests/Module.scala +++ b/src/test/scala/chiselTests/Module.scala @@ -41,7 +41,7 @@ class ModuleVecTester(c: ModuleVec) extends Tester(c) { class ModuleWire extends Module { val io = IO(new SimpleIO) - val inc = Wire(Module(new PlusOne).io.chiselCloneType) + val inc = Wire(chiselTypeOf(Module(new PlusOne).io)) inc.in := io.in io.out := inc.out } diff --git a/src/test/scala/chiselTests/Vec.scala b/src/test/scala/chiselTests/Vec.scala index 9b8855c4..6c62ab26 100644 --- a/src/test/scala/chiselTests/Vec.scala +++ b/src/test/scala/chiselTests/Vec.scala @@ -145,7 +145,7 @@ class ZeroEntryVecTester extends BasicTester { require(bundleWithZeroEntryVec.asUInt.getWidth == 1) val m = Module(new Module { - val io = IO(Output(bundleWithZeroEntryVec.cloneType)) + val io = IO(Output(bundleWithZeroEntryVec)) }) WireInit(m.io.bar) -- cgit v1.2.3