gem5-users@gem5.org

The gem5 Users mailing list

View all threads

About using gem5 with RISCV arch.

E
eliovinciguerra22@gmail.com
Mon, Oct 16, 2023 9:05 AM

Hello everyone, I should use gem5 to emulate the execution of programs written in C language on RISCV architecture.

I use a docker container, inside of which I have created a "hello.c" file that prints "Hello World!" on the screen, and then generate the executable with "riscv64-linux-gnu-gcc".

Next I should use gem5, how can I do this?

I saw that se.py and fs.py have been deprecated, I don't know how to generate my RISCV configuration.

Trying with "./gem5/build/RISCV/gem5.opt ./gem5/configs/example/riscv/fs_linux.py --script ./hello"

It returns the following error:

"gem5 Simulator System. https://www.gem5.org

gem5 is copyrighted software; use the --copyright option for details.

gem5 version 23.0.1

gem5 compiled Oct 15 2023 12:49:03

gem5 started Oct 16 2023 09:01:02

gem5 executing on 84727e90922b, pid 1761

command line: ./gem5/build/RISCV/gem5.opt ./gem5/configs/example/riscv/fs_linux.py --script ./hello

warn: The `get_runtime_isa` function is deprecated. Please migrate away from using this function.

warn: The `get_runtime_isa` function is deprecated. Please migrate away from using this function.

Global frequency set at 1000000000000 ticks per second

warn: No dot file generated. Please install pydot to generate the dot file and pdf.

src/mem/dram_interface.cc:690: warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)

src/base/loader/image_file_data.cc:110: fatal: fatal condition fd < 0 occurred: Failed to open file None.

This error typically occurs when the file path specified is incorrect.

Memory Usage: 99768 KBytes”

What can I do?

Hello everyone, I should use gem5 to emulate the execution of programs written in C language on RISCV architecture. I use a docker container, inside of which I have created a "hello.c" file that prints "Hello World!" on the screen, and then generate the executable with "riscv64-linux-gnu-gcc". Next I should use gem5, how can I do this? I saw that se.py and fs.py have been deprecated, I don't know how to generate my RISCV configuration. Trying with "./gem5/build/RISCV/gem5.opt ./gem5/configs/example/riscv/fs_linux.py --script ./hello" It returns the following error: "gem5 Simulator System. https://www.gem5.org gem5 is copyrighted software; use the --copyright option for details. gem5 version 23.0.1 gem5 compiled Oct 15 2023 12:49:03 gem5 started Oct 16 2023 09:01:02 gem5 executing on 84727e90922b, pid 1761 command line: ./gem5/build/RISCV/gem5.opt ./gem5/configs/example/riscv/fs_linux.py --script ./hello warn: The \`get_runtime_isa\` function is deprecated. Please migrate away from using this function. warn: The \`get_runtime_isa\` function is deprecated. Please migrate away from using this function. Global frequency set at 1000000000000 ticks per second warn: No dot file generated. Please install pydot to generate the dot file and pdf. src/mem/dram_interface.cc:690: warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes) src/base/loader/image_file_data.cc:110: fatal: fatal condition fd < 0 occurred: Failed to open file None. This error typically occurs when the file path specified is incorrect. Memory Usage: 99768 KBytes” What can I do?
B
bbruce@ucdavis.edu
Wed, Oct 18, 2023 7:10 PM

You’re trying to run a full-system simulation there and that requires specifying a disk image. The `src/base/loader/image_file_data.cc:110: fatal: fatal condition fd < 0 occurred: Failed to open file None.` error you are receiving is because you didn’t specify this.

I’d recommend using the gem5 standard library: https://www.gem5.org/documentation/gem5-stdlib/overview. If you go through this tutorial you can see how to setup a gem5 simulation and run some simple binaries in SE mode.

You’re trying to run a full-system simulation there and that requires specifying a disk image. The \`src/base/loader/image_file_data.cc:110: fatal: fatal condition fd < 0 occurred: Failed to open file None.\` error you are receiving is because you didn’t specify this. I’d recommend using the gem5 standard library: https://www.gem5.org/documentation/gem5-stdlib/overview. If you go through this tutorial you can see how to setup a gem5 simulation and run some simple binaries in SE mode.
E
eliovinciguerra22@gmail.com
Sun, Oct 22, 2023 5:20 PM

Thank you, now it works.

Thank you, now it works.