Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error facing while compiling the Tiny Rocket Core #1579

Open
3 tasks done
cygwin24 opened this issue Aug 22, 2023 · 8 comments
Open
3 tasks done

Error facing while compiling the Tiny Rocket Core #1579

cygwin24 opened this issue Aug 22, 2023 · 8 comments
Labels

Comments

@cygwin24
Copy link

cygwin24 commented Aug 22, 2023

Background Work

Current Behavior

I am trying to run the Tiny Rocket Core in Xilinx zcu102 FPGA. I tried with Default Rocket Core and it is working fine.
Is this Tiny Core required additional changes in the Scala Files.

Expected Behavior

I am using this configuration for Tiny Rocket Core.

image

Error I am getting

zcu102.ZCU102FPGATestHarness.RISCVTinyZCU102Config --name chipyard.fpga.zcu102.ZCU102FPGATestHarness.RISCVTinyZCU102Config --top-module chipyard.fpga.zcu102.ZCU102FPGATestHarness --legacy-configs chipyard.fpga.zcu102:RISCVTinyZCU102Config
make[1]: Entering directory '/home/ssddls1/ashutosh/ashufpga/fpga/src/main/resources/zcu102/sdboot'
make[1]: Nothing to be done for 'bin'.
make[1]: Leaving directory '/home/ssddls1/ashutosh/ashufpga/fpga/src/main/resources/zcu102/sdboot'
ZCU102 FPGA Base Clock Freq: 100.0 MHz
[error] (run-main-0) java.lang.reflect.InvocationTargetException
[error] java.lang.reflect.InvocationTargetException
[error] 	at ... ()
[error] 	at freechips.rocketchip.stage.phases.PreElaboration.$anonfun$transform$1(PreElaboration.scala:36
[error] 	at ... ()
[error] 	at ... (Stack trace trimmed to user code only. Rerun with --full-stacktrace to see the full stack trace)
[error] Caused by: java.util.NoSuchElementException: None.get
[error] 	at scala.None$.get(Option.scala:529)
[error] 	at scala.None$.get(Option.scala:527)
[error] 	at chipyard.fpga.zcu102.ZCU102FPGATestHarness.<init>(TestHarness.scala:84)
[error] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[error] 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
[error] 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[error] 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[error] 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[error] 	at freechips.rocketchip.stage.phases.PreElaboration.$anonfun$transform$1(PreElaboration.scala:36
[error] 	at chisel3.Module$.do_apply(Module.scala:53)
[error] 	at chisel3.stage.phases.Elaborate.$anonfun$transform$2(Elaborate.scala:33)
[error] 	at chisel3.internal.Builder$.$anonfun$build$1(Builder.scala:720)
[error] 	at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
[error] 	at chisel3.internal.Builder$.build(Builder.scala:715)
[error] 	at chisel3.stage.phases.Elaborate.$anonfun$transform$1(Elaborate.scala:33)
[error] 	at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:245)
[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.flatMap(TraversableLike.scala:245)
[error] 	at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:242)
[error] 	at scala.collection.AbstractTraversable.flatMap(Traversable.scala:108)
[error] 	at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:28)
[error] 	at chisel3.stage.phases.Elaborate.transform(Elaborate.scala:21)
[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:89)
[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:89)
[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.transform(Stage.scala:17)
[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:89)
[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:89)
[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 firrtl.options.StageMain.main(Stage.scala:71)
[error] 	at chipyard.Generator.main(Generator.scala)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[error] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[error] stack trace is suppressed; run last Compile / bgRunMain for the full output
[error] Nonzero exit code: 1
[error] (Compile / runMain) Nonzero exit code: 1
[error] Total time: 7 s, completed 17-Aug-2023, 1:54:27 pm
make: *** [/home/ssddls1/ashutosh/ashufpga/common.mk:107: /home/ssddls1/ashutosh/ashufpga/fpga/generated-src/chipyard.fpga.zcu102.ZCU102FPGATestHarness.RISCVTinyZCU102Config/chipyard.fpga.zcu102.ZCU102FPGATestHarness.RISCVTinyZCU102Config.fir] Error 1

Other Information

No response

@cygwin24 cygwin24 added the bug label Aug 22, 2023
@jerryz123
Copy link
Contributor

This is a very old Chipyard (1.5.0), and our ability to support it is limited. Can you try again with the most recent version?

@cygwin24
Copy link
Author

@jerryz123
I am using chipard version 1.9.1

@jerryz123
Copy link
Contributor

Did you add ZCU102 support to your own branch? I don't believe the upstream has that board supported.

@cygwin24
Copy link
Author

@jerryz123
Yes. I have add ZCU102 supported files. I have also tested Rocket Core in FPGA and it is working also .
The command I am using to rocket core on FPGA is make SUB_PROEJECT=zcu102 verilog and it is working.
Similarly I have tested different configuration.

But in Tiny core even the default configuration is not working . Here I am giving make SUB_PROEJECT=zcu102 CONFIG=TInyRocketConfig verilog but it is giving me error. I am not able to find out what is the error .

@jerryz123
Copy link
Contributor

It is difficult for others to help you without being able to see what you implemented.
[error] at chipyard.fpga.zcu102.ZCU102FPGATestHarness.<init>(TestHarness.scala:84) suggests that line 84 in a TestHarness.scala you implemented is the source of the problem.

@cygwin24
Copy link
Author

But if this would be the case, then my different configuration is working ? Not only this I changed configuration from big core to Medium core , thats also working.
Only it is getting problem while running in Tiny Core.

I found somewhere that Rocket TinyCore uses a default scratchpad instead of a backing memory. This scratchpad 0x80000000 to 0x80003fff is overlapping with the memport's address range and I have remove the backing memory and L2 cache as well. like

class TinyRocketConfig extends Config(
  new chipyard.config.WithTLSerialLocation(
    freechips.rocketchip.subsystem.FBUS,
    freechips.rocketchip.subsystem.PBUS) ++                          // attach TL serial adapter to f/p busses
  new freechips.rocketchip.subsystem.WithIncoherentBusTopology ++    // use incoherent bus topology
  new freechips.rocketchip.subsystem.WithNBanks(0) ++                // remove L2$
  new freechips.rocketchip.subsystem.WithNoMemPort ++                // remove backing memory
  new freechips.rocketchip.subsystem.With1TinyCore ++                // single tiny rocket-core
  new chipyard.config.AbstractConfig)

But still not able to figure out what is the issue.
Note :
My design is compiling using verilator.

@T-K-233
Copy link
Member

T-K-233 commented Dec 18, 2023

I have run into similar issue when building for Arty FPGA designs.

I think TinyCore requires a vastly different configuration for the memory system compared to other Core Configs. If the resource is limited, could you try use the SmallCore?

class XXXConfig extends Config(
  ...
  new freechips.rocketchip.subsystem.WithNSmallCores(1)
  ...
)

It's still larger than TinyCore, but it shares the same system configuration as Medium and Big.

Hope this is helpful.

@lyxxcz
Copy link

lyxxcz commented Jan 29, 2024

Hello,I have a Xilinx ZCU102 and want to run the Rocket Core on it ,but don't know how to support it,can you tell me how you did it? Thank you.

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

No branches or pull requests

4 participants