Simulate Gemmini with FireSim

317 views
Skip to first unread message

Yu Zeng

unread,
Mar 31, 2022, 4:18:19 PM3/31/22
to Chipyard
Hi,

I am working on simulating Gemmini with FireSim. I have followed the first 3 chapters of the FireSim documents, but that document is mainly for a Rocket chip. I found the "sample_config_build_recipes.ini" file in the firesim folder. In the file there is a configuration for "Single-core, Rocket-based recipes with Gemmini", called: [firesim-rocket-singlecore-gemmini-no-nic-l2-llc4mb-ddr3]. I tried to modify the "defaulthwconfig" of config_runtime.ini file to "firesim-rocket-singlecore-gemmini-no-nic-l2-llc4mb-ddr3", but error is reported:

Fatal error.
Traceback (most recent call last):
  File "/home/centos/firesim/deploy/firesim", line 344, in <module>
    main(args)
  File "/home/centos/firesim/deploy/firesim", line 290, in main
    simconf = RuntimeConfig(args)
  File "/home/centos/firesim/deploy/runtools/runtime_config.py", line 382, in __init__
    self.innerconf.print_cycle_prefix)
  File "/home/centos/firesim/deploy/runtools/firesim_topology_with_passes.py", line 68, in __init__
    self.phase_one_passes()
  File "/home/centos/firesim/deploy/runtools/firesim_topology_with_passes.py", line 361, in phase_one_passes
    self.pass_apply_default_hwconfig()
  File "/home/centos/firesim/deploy/runtools/firesim_topology_with_passes.py", line 281, in pass_apply_default_hwconfig
    defaulthwconfig_obj = self.hwdb.get_runtimehwconfig_from_name(self.defaulthwconfig)
  File "/home/centos/firesim/deploy/runtools/runtime_config.py", line 234, in get_runtimehwconfig_from_name
    return self.hwconf_dict[name]
KeyError: 'firesim-rocket-singlecore-gemmini-no-nic-l2-llc4mb-ddr3'

I guess I need some other changes to the config_runtime.ini file, does anyone know what else should I do? Thanks!

Hasan Genc

unread,
Mar 31, 2022, 4:23:01 PM3/31/22
to chip...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Chipyard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chipyard+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chipyard/53881f31-542f-46fc-a16c-6b5cef164dc7n%40googlegroups.com.

Yu Zeng

unread,
Mar 31, 2022, 10:26:15 PM3/31/22
to Chipyard
 Hi Hasan,

Thank you for your help!

I have followed the instructions you gave. But there are some weird problems: when I ran the "./marshal -v --workdir /home/centos/firesim/target-design/chipyard/generators/gemmini/software build gemmini-tests.json", it reports: "EBUG: cp: error writing ‘/home/centos/firesim/target-design/chipyard/software/firemarshal/disk-mount/root/imagenet/resnet50-linux’: No space left on device. But I have checked my disk, the total is 500GB and only 91GB are used. I have also checked the i-nodes, there are a lot of free.

I feel like the command  is just trying to copy "/home/centos/firesim/target-design/chipyard/generators/gemmini/software/overlay/root"(which contains "imagenet", "mlps", etc.)  to /home/centos/firesim/target-design/chipyard/software/firemarshal/disk-mount/, so I tried to manually do the copy, and it worked. Is this right? Which files should be generated by "./marshal -v --workdir /home/centos/firesim/target-design/chipyard/generators/gemmini/software build gemmini-tests.json"?

Then I followed the instructions, ran ./marshal -v --workdir /home/centos/firesim/target-design/chipyard/generators/gemmini/software install gemmini-tests.json, no error is reported. And I followed the following instructions, and another error is report when running firesim buildafi:

[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] 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: 22 s, completed Apr 1, 2022 2:06:13 AM
/home/centos/firesim/sim/src/main/makefrag/firesim/Makefrag:43: recipe for target '/home/centos/firesim/sim/generated-src/f1/FireSim-DDR3FRFCFSLLC4MB_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.GemminiRocketConfig-F30MHz_BaseF1Config/firesim.firesim.FireSim.DDR3FRFCFSLLC4MB_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.GemminiRocketConfig.fir' failed
make: *** [/home/centos/firesim/sim/generated-src/f1/FireSim-DDR3FRFCFSLLC4MB_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.GemminiRocketConfig-F30MHz_BaseF1Config/firesim.firesim.FireSim.DDR3FRFCFSLLC4MB_WithDefaultFireSimBridges_WithFireSimConfigTweaks_chipyard.GemminiRocketConfig.fir] Error 1

I spent a lot of time but had no idea how to fix this. Have you experienced such error before? Thanks!

Hasan Genc

unread,
Mar 31, 2022, 10:44:12 PM3/31/22
to chip...@googlegroups.com
I'm not familiar with the "buildafi" error you reported. Can you try copying the full output to a Gist? There might be a more descriptive error message in there somewhere.

As for the marshal command running out of space, try adding:
  "rootfs-size" : "16384MiB",
to "gemmini-tests.json". (Or try an even larger size). Let me know if that works, and I'll make that the default option.

Regards,
Hasan


Yu Zeng

unread,
Apr 1, 2022, 12:00:30 AM4/1/22
to Chipyard
Hi Hasan,

Thank you for your help! Adding  "rootfs-size" : "16384MiB" does solve the out-of-space problem. But the buildafi error still happened. Here is the gist for the output:

Hasan Genc

unread,
Apr 1, 2022, 12:05:57 AM4/1/22
to chip...@googlegroups.com
This is the relevant error: "The Chisel compiler plugin is now required for compiling Chisel code."

Most likely, this means that your FireSim/Chipyard/Gemmini repos are out-of-sync with each other.
  1. Can you check if you also get this error when building non-Gemmini projects?
  2. Which commits are you on for Firesim, Chipyard, and Gemmini?
Regards,
Hasan


Yu Zeng

unread,
Apr 1, 2022, 7:54:12 PM4/1/22
to Chipyard
Hi Hasan,

You are right, the problem is the commit of the shipyard I used. When I built Gemmini tools, I checkouted the commits according to the Gemmini github page, which is different than the commits required by FireSim.
I fixed this problem by using the commits required by FireSim, and the buildafi works. After waiting for a few hours, the build for [firesim-rocket-singlecore-gemmini-no-nic-l2-llc4mb-ddr3] finished.
But when I ran "firesim launchrunfarm", another error is reported:

Do you have any idea how to fix this problem? Thanks!

Hasan Genc

unread,
Apr 1, 2022, 7:57:18 PM4/1/22
to chip...@googlegroups.com
Sorry, I’m not familiar enough with Firesim’s internals to say why the “launchrunfarm” may have failed.

You might just want to try again later though. Sometimes, there’s just not enough FPGA instances available.

Regards,
Hasan

Yu Zeng

unread,
Apr 2, 2022, 11:41:05 AM4/2/22
to Chipyard
Hi Hasan,

I have solved the problem. It turns out the agfi id has some problems. I fixed this with the help of this link: https://groups.google.com/g/firesim/c/E2_DWmNsv04/m/VavRx3G9DAAJ

Many thanks to your kind help!

On Thursday, March 31, 2022 at 4:23:01 PM UTC-4 hng...@berkeley.edu wrote:

Hasan Genc

unread,
Apr 2, 2022, 2:34:22 PM4/2/22
to chip...@googlegroups.com
No problem!

Regards,
Hasan

Reply all
Reply to author
Forward
0 new messages