summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSchuyler Eldridge2018-10-29 13:56:37 -0400
committerAdam Izraelevitz2018-10-29 10:56:37 -0700
commit012c503044b35fb7a432b39a769cd06e29ace2eb (patch)
treefe679e6b33c2d0cf5f09ae0009041268188e36bf
parent44124f2ec92cf24814a8343ae3faef9abe916626 (diff)
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 <schuyler.eldridge@ibm.com>
-rw-r--r--src/main/scala/chisel3/util/experimental/LoadMemoryTransform.scala3
1 files changed, 2 insertions, 1 deletions
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))
}
}