From 012c503044b35fb7a432b39a769cd06e29ace2eb Mon Sep 17 00:00:00 2001 From: Schuyler Eldridge Date: Mon, 29 Oct 2018 13:56:37 -0400 Subject: Fix LoadMemoryTransform for Instance Annotations (#914) Quickfix for LoadMemoryTransform that gets this to work with Instance Annotations. The new Instance Annotations caused a corner case where a LoadMemoryAnnotation would be duplicated (via update/renaming) and the resulting annotation would differ from the original in only their originalMemoryNameOpt field. This corrects that by having the ChiselLoadMemoryAnnotation also emit the originalMemoryNameOpt field where it did not previously. First part of a fix for freechipsproject/firrtl#922. Signed-off-by: Schuyler Eldridge --- src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala b/src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala index 04a01fe9..e8967601 100644 --- a/src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala +++ b/src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala @@ -36,7 +36,8 @@ case class ChiselLoadMemoryAnnotation[T <: Data]( def transformClass: Class[LoadMemoryTransform] = classOf[LoadMemoryTransform] def toFirrtl: LoadMemoryAnnotation = { - LoadMemoryAnnotation(target.toNamed.asInstanceOf[ComponentName], fileName, hexOrBinary) + val tx = target.toNamed.asInstanceOf[ComponentName] + LoadMemoryAnnotation(tx, fileName, hexOrBinary, Some(tx.name)) } } -- cgit v1.2.3