Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Internal Error when using the loadMemoryFromFileInline #2649

Open
5 tasks done
xlgforever opened this issue Jul 19, 2023 · 0 comments
Open
5 tasks done

Internal Error when using the loadMemoryFromFileInline #2649

xlgforever opened this issue Jul 19, 2023 · 0 comments

Comments

@xlgforever
Copy link

xlgforever commented Jul 19, 2023

Checklist

  • Did you specify the current behavior?
  • Did you specify the expected behavior?
  • Did you provide a code example showing the problem?
  • Did you describe your environment?
  • Did you specify relevant external information?

What is the current behavior?

When I use the loadMemoryFromFileInline, The firrtl raises a internal error.

What is the expected behavior?

I want to use the txt file to inital the RAM.

Steps to Reproduce

	val mem = SyncReadMem(tile_width, Vec(matrix_width, UInt(byte_width.W)))
	if (init_file.trim().nonEmpty) {
              loadMemoryFromFileInline(mem, init_file_name)
  	}

and the debug info in console is:

[error] firrtl.FirrtlInternalException: Internal Error! Please file an issue at https://github.com/ucb-bar/firrtl/issues
[error]         at firrtl.Utils$.error(Utils.scala:471)
[error]         at firrtl.Utils$.throwInternalError(Utils.scala:175)
[error]         at firrtl.stage.phases.CatchExceptions.transform(CatchExceptions.scala:31)
[error]         at firrtl.stage.phases.CatchExceptions.transform(CatchExceptions.scala:10)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]         at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]         at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]         at firrtl.stage.FirrtlStage.run(FirrtlStage.scala:38)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]         at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]         at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]         at logger.Logger$.makeScope(Logger.scala:135)
[error]         at firrtl.options.Stage.transform(Stage.scala:47)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.$anonfun$transform$2(MaybeFirrtlStage.scala:22)
[error]         at scala.Option.getOrElse(Option.scala:189)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.transform(MaybeFirrtlStage.scala:22)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.transform(MaybeFirrtlStage.scala:13)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]         at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]         at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]         at chisel3.stage.ChiselStage.run(ChiselStage.scala:45)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]         at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]         at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]         at logger.Logger$.makeScope(Logger.scala:135)
[error]         at firrtl.options.Stage.transform(Stage.scala:47)
[error]         at firrtl.options.Stage.execute(Stage.scala:58)
[error]         at chisel3.stage.ChiselStage.emitVerilog(ChiselStage.scala:101)
[error]         at chisel3.emitVerilog$.apply(verilog.scala:34)
[error]         at empty.TPUMain$.delayedEndpoint$empty$TPUMain$1(TPU.scala:79)
[error]         at empty.TPUMain$delayedInit$body.apply(TPU.scala:77)
[error]         at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]         at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]         at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]         at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]         at scala.collection.immutable.List.foreach(List.scala:431)
[error]         at scala.App.main(App.scala:80)
[error]         at scala.App.main$(App.scala:78)
[error]         at empty.TPUMain$.main(TPU.scala:77)
[error]         at empty.TPUMain.main(TPU.scala)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] Caused by: java.lang.RuntimeException: [module WeightBuffer] Cannot initialize memory mem of non ground type UInt<8>[16]
[error]         at firrtl.passes.LowerTypes$.onStatement(LowerTypes.scala:179)
[error]         at firrtl.passes.LowerTypes$.$anonfun$onStatement$11(LowerTypes.scala:202)
[error]         at firrtl.ir.Block.mapStmt(IR.scala:653)
[error]         at firrtl.passes.LowerTypes$.onStatement(LowerTypes.scala:202)
[error]         at firrtl.passes.LowerTypes$.$anonfun$onModule$1(LowerTypes.scala:116)
[error]         at firrtl.ir.Module.mapStmt(IR.scala:1198)
[error]         at firrtl.passes.LowerTypes$.onModule(LowerTypes.scala:116)
[error]         at firrtl.passes.LowerTypes$.$anonfun$execute$4(LowerTypes.scala:86)
[error]         at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
[error]         at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
[error]         at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
[error]         at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
[error]         at scala.collection.TraversableLike.map(TraversableLike.scala:286)
[error]         at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
[error]         at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error]         at firrtl.passes.LowerTypes$.execute(LowerTypes.scala:86)
[error]         at firrtl.Transform.transform(Compiler.scala:280)
[error]         at firrtl.Transform.transform$(Compiler.scala:280)
[error]         at firrtl.passes.LowerTypes$.transform(LowerTypes.scala:41)
[error]         at firrtl.stage.transforms.ExpandPrepares.execute(ExpandPrepares.scala:19)
[error]         at firrtl.Transform.transform(Compiler.scala:280)
[error]         at firrtl.Transform.transform$(Compiler.scala:280)
[error]         at firrtl.stage.transforms.ExpandPrepares.transform(ExpandPrepares.scala:7)
[error]         at firrtl.stage.transforms.CatchCustomTransformExceptions.execute(CatchCustomTransformExceptions.scala:10)
[error]         at firrtl.Transform.transform(Compiler.scala:280)
[error]         at firrtl.Transform.transform$(Compiler.scala:280)
[error]         at firrtl.stage.transforms.CatchCustomTransformExceptions.transform(CatchCustomTransformExceptions.scala:7)
[error]         at firrtl.stage.transforms.UpdateAnnotations.internalTransform(UpdateAnnotations.scala:22)
[error]         at firrtl.stage.transforms.UpdateAnnotations.internalTransform(UpdateAnnotations.scala:8)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.stage.transforms.UpdateAnnotations.transform(UpdateAnnotations.scala:8)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]         at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]         at firrtl.stage.TransformManager.transform(TransformManager.scala:14)
[error]         at firrtl.stage.phases.Compiler.$anonfun$internalTransform$6(Compiler.scala:138)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.stage.phases.Compiler.f$1(Compiler.scala:138)
[error]         at firrtl.stage.phases.Compiler.$anonfun$internalTransform$8(Compiler.scala:143)
[error]         at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
[error]         at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
[error]         at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
[error]         at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
[error]         at scala.collection.TraversableLike.map(TraversableLike.scala:286)
[error]         at scala.collection.TraversableLike.map$(TraversableLike.scala:279)
[error]         at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error]         at firrtl.stage.phases.Compiler.internalTransform(Compiler.scala:143)
[error]         at firrtl.stage.phases.Compiler.internalTransform(Compiler.scala:53)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.stage.phases.Compiler.transform(Compiler.scala:53)
[error]         at firrtl.stage.phases.CatchExceptions.transform(CatchExceptions.scala:23)
[error]         at firrtl.stage.phases.CatchExceptions.transform(CatchExceptions.scala:10)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]         at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]         at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]         at firrtl.stage.FirrtlStage.run(FirrtlStage.scala:38)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]         at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]         at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]         at logger.Logger$.makeScope(Logger.scala:135)
[error]         at firrtl.options.Stage.transform(Stage.scala:47)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.$anonfun$transform$2(MaybeFirrtlStage.scala:22)
[error]         at scala.Option.getOrElse(Option.scala:189)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.transform(MaybeFirrtlStage.scala:22)
[error]         at chisel3.stage.phases.MaybeFirrtlStage.transform(MaybeFirrtlStage.scala:13)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$5(DependencyManager.scala:280)
[error]         at firrtl.Utils$.time(Utils.scala:181)
[error]         at firrtl.options.DependencyManager.$anonfun$transform$3(DependencyManager.scala:280)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.DependencyManager.transform(DependencyManager.scala:269)
[error]         at firrtl.options.DependencyManager.transform$(DependencyManager.scala:255)
[error]         at firrtl.options.PhaseManager.transform(DependencyManager.scala:443)
[error]         at chisel3.stage.ChiselStage.run(ChiselStage.scala:45)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.Stage$$anon$1.transform(Stage.scala:43)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:38)
[error]         at firrtl.options.phases.DeletedWrapper.internalTransform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Translator.transform(Phase.scala:248)
[error]         at firrtl.options.Translator.transform$(Phase.scala:248)
[error]         at firrtl.options.phases.DeletedWrapper.transform(DeletedWrapper.scala:15)
[error]         at firrtl.options.Stage.$anonfun$transform$5(Stage.scala:47)
[error]         at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
[error]         at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
[error]         at scala.collection.immutable.List.foldLeft(List.scala:91)
[error]         at firrtl.options.Stage.$anonfun$transform$3(Stage.scala:47)
[error]         at logger.Logger$.$anonfun$makeScope$2(Logger.scala:137)
[error]         at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error]         at logger.Logger$.makeScope(Logger.scala:135)
[error]         at firrtl.options.Stage.transform(Stage.scala:47)
[error]         at firrtl.options.Stage.execute(Stage.scala:58)
[error]         at chisel3.stage.ChiselStage.emitVerilog(ChiselStage.scala:101)
[error]         at chisel3.emitVerilog$.apply(verilog.scala:34)
[error]         at empty.TPUMain$.delayedEndpoint$empty$TPUMain$1(TPU.scala:79)
[error]         at empty.TPUMain$delayedInit$body.apply(TPU.scala:77)
[error]         at scala.Function0.apply$mcV$sp(Function0.scala:39)
[error]         at scala.Function0.apply$mcV$sp$(Function0.scala:39)
[error]         at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:17)
[error]         at scala.App.$anonfun$main$1$adapted(App.scala:80)
[error]         at scala.collection.immutable.List.foreach(List.scala:431)
[error]         at scala.App.main(App.scala:80)
[error]         at scala.App.main$(App.scala:78)
[error]         at empty.TPUMain$.main(TPU.scala:77)
[error]         at empty.TPUMain.main(TPU.scala)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] stack trace is suppressed; run last Compile / runMain for the full output
[error] (Compile / runMain) firrtl.FirrtlInternalException: Internal Error! Please file an issue at https://github.com/ucb-bar/firrtl/issues

Your environment

  • Chisel Verions: 3.5.6
  • OS: Linux xlgnuc 5.4.0-139-generic 18.04.1-Ubuntu SMP Wed Jan 25 15:56:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • Verilator version: NO

External Information

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant