[gem5-users] X86 full system simulation---about m5term

2024-01-11 Thread hu miao via gem5-users
Hello everyone,

I am new to gem5 and I have been trying to use gem5 for X86 dual-core full
system simulation, following the steps in this tutorial:
https://www.gem5.org/documentation/gem5-stdlib/x86-full-system-tutorial.
However, I encountered some issues during the process. I am unable to use
m5term as described in the tutorial. I executed ./build/X86/gem5.opt
configs/humiao/double.py as instructed but when I open a new terminal and
run ./m5term localhost 3456, nothing happens. I would greatly appreciate it
if someone could help me with this.

Thank you very much.

I use docker images to build and run my gem5(version 20.04). My ubuntu is
22.04. Here is the logs.

Terminal 1===

root@f7f0fce50861:/# gem5/gem5/build/X86/gem5.opt
gem5/gem5/configs/humiao2/double.py

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

gem5 is copyrighted software; use the --copyright option for details. gem5
version 22.1.0.0 gem5 compiled Jan 8 2024 08:58:24 gem5 started Jan 12 2024
00:53:21 gem5 executing on f7f0fce50861, pid 16 command line:
gem5/gem5/build/X86/gem5.opt gem5/gem5/configs/humiao2/double.py warn: An
ISA for the SimpleSwitchableProcessor was not set. This will result in
usage of `runtime.get_runtime_isa` to obtain the ISA. This function is
deprecated and will be removed in future releases of gem5. Please
explicitly state the ISA via the processor constructor. 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. 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. warn: The simulate package is still in a beta state. The
gem5 project does not guarantee the APIs within this package will remain
consistent across upcoming releases. Global frequency set at 1
ticks per second build/X86/mem/dram_interface.cc:690: warn: DRAM device
capacity (8192 Mbytes) does not match the address range assigned (2048
Mbytes) build/X86/sim/kernel_workload.cc:46: info: kernel located at:
/root/.cache/gem5/x86-linux-kernel-5.4.49 build/X86/base/statistics.hh:280:
warn: One of the stats is a legacy stat. Legacy stat is a stat that does
not belong to any statistics::Group. Legacy stat is deprecated. 0:
board.pc.south_bridge.cmos.rtc: Real-time clock set to Sun Jan 1 00:00:00
2012 board.pc.com_1.device: Listening for connections on port 3456
build/X86/dev/intel_8254_timer.cc:128: warn: Reading current count from
inactive timer. 0: board.remote_gdb: listening for remote gdb on port 7000
build/X86/sim/simulate.cc:192: info: Entering event queue @ 0. Starting
simulation... build/X86/mem/ruby/system/Sequencer.cc:613: warn: Replacement
policy updates recently became the responsibility of SLICC state machines.
Make sure to setMRU() near callbacks in .sm files!
build/X86/arch/x86/cpuid.cc:180: warn: x86 cpuid family 0x:
unimplemented function 6 build/X86/arch/x86/cpuid.cc:180: warn: x86 cpuid
family 0x: unimplemented function 6 build/X86/arch/x86/cpuid.cc:180:
warn: x86 cpuid family 0x: unimplemented function 6
build/X86/arch/x86/generated/exec-ns.cc.inc:27: warn: instruction 'fninit'
unimplemented build/X86/dev/x86/pc.cc:117: warn: Don't know what interrupt
to clear for console.

Terminal 2==

root@070f5b3cf62e:/# cd gem5/gem5/util/term
root@070f5b3cf62e:/gem5/gem5/util/term#
./m5term localhost 3456 root@070f5b3cf62e:/gem5/gem5/util/term# ./m5term
localhost 3456
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re?? About kvm-x86 in SE mode

2024-01-11 Thread ChenShixuan via gem5-users
Hi muke101,

I followed the tutorial of Gem5 (using kvm) to add my user to the 
kvmandlibvirt groups. And I have been running gem5 under root user 
all along.

Thank you for your reply??

 Original Message 
??: 
   "muke101"

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: About kvm-x86 in SE mode

2024-01-11 Thread sx Chen via gem5-users
Hi muke101,

I followed the tutorial of Gem5 (using kvm) to add my user to the kvm and 
libvirt groups. And I have been running gem5 under root user all along.

Thank you for your reply!
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: About kvm-x86 in SE mode

2024-01-11 Thread muke101 via gem5-users
Might not be it but are you part of the KVM user group? Does it work if you run 
gem5 under sudo?

Sent from Proton Mail mobile

 Original Message 
On 12 Jan 2024, 02:46, ChenShixuan via gem5-users wrote:

> Hi all,
>
> I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" 
> and switch to timing cpu in SE simulation but it seems to be not working. And 
> I am getting an error that I dont understand.
>
> Here are the errors that I am getting:
>
> ~~~
> src/sim/simulate.cc:199: info: Entering event queue @ 0. Starting 
> simulation...
> src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
> src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
> Memory Usage: 8527892 KBytes
> ~~~
>
> I am certain that my computer supports and has KVM virtualization enabled. 
> And my computer's architecture is also X86.
>
> I cloned the latest version of gem5. And the python script I used is:
>
> ~~~
> cache_hierarchy = NoCache()
> memory = SingleChannelDDR3_1600()
> processor = SimpleProcessor(
> cpu_type=CPUTypes.KVM,
> isa=ISA.X86,
> num_cores=1,
> )
> motherboard = SimpleBoard(
> clk_freq="3GHz",
> processor=processor,
> memory=memory,
> cache_hierarchy=cache_hierarchy,
> )
> binary = obtain_resource("x86-hello64-static")
> motherboard.set_se_binary_workload(binary)
> simulator = Simulator(board=motherboard)
> simulator.run()
> print(
> "Exiting @ tick {} because {}.".format(
> simulator.get_current_tick(), simulator.get_last_exit_event_cause()
> )
> )
> ~~~
>
> At the same time, I run the sample script “x86-ubuntu-run-with-kvm.py” will 
> get stuck in this:
>
> ~~~
> in gem5/:
> src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported 
> by gem5. Skipping.
> src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported 
> by gem5. Skipping.
> 200620: board.pc.com_1.device: attach terminal 0
>
> in gem5/util/term:
> ./m5term 3456
>  m5 terminal: Terminal 0 
> ~~~
>
> And this simulation never run it again.
>
> Thank you very much if you could help me answer my questions!
>
> Best,
> Chen SX___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] About kvm-x86 in SE mode

2024-01-11 Thread ChenShixuan via gem5-users
Hi all,


I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and 
switch to timing cpu in SE simulation but it seems to be not working. And 
I am getting an error that I dont understand.


Here are the errors that I am getting:


~~~
src/sim/simulate.cc:199: info: Entering event queue @ 0. Starting 
simulation...
src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
Memory Usage: 8527892 KBytes

~~~


I am certain that my computer supports and has KVM virtualization enabled. And 
my computer's architecture is also X86.


I cloned the latest version of gem5. And the python script I used is:


~~~
cache_hierarchy = NoCache()
memory = SingleChannelDDR3_1600()
processor = SimpleProcessor(
  cpu_type=CPUTypes.KVM,
  isa=ISA.X86,
  num_cores=1,
)
motherboard = SimpleBoard(
  clk_freq="3GHz",
  processor=processor,
  memory=memory,
  cache_hierarchy=cache_hierarchy,
)
binary = obtain_resource("x86-hello64-static")

motherboard.set_se_binary_workload(binary)
simulator = Simulator(board=motherboard)
simulator.run()
print(
  "Exiting @ tick {} because {}.".format(
simulator.get_current_tick(), 
simulator.get_last_exit_event_cause()
  )
)










~~~


At the same time, I run the sample script ??x86-ubuntu-run-with-kvm.py?? 
will get stuck in this:


~~~
in gem5/:
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported 
by gem5. Skipping.
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported 
by gem5. Skipping.
200620: board.pc.com_1.device: attach terminal 0



in gem5/util/term:
./m5term 3456
 m5 terminal: Terminal 0 

~~~


And this simulation never run it again.


Thank you very much if you could help me answer my questions??


Best,
Chen SX___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] How to Profiling Memory Access for Specific Malloc Data Structure In gem5?

2024-01-11 Thread wanli990802--- via gem5-users
Let's say I create two arrays A and B in my program, and these address space is 
kept unchanged during the execution of the program. How should I expose the 
addresses of these two arrays to gem5 and then profile the access information 
of these addresses in the cache of gem5.

Any help would be greatly appreciated!
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: ARM SVE ISA

2024-01-11 Thread Nazmus Sakib via gem5-users
Not compiling with -msve-vector-bits did the trick. It runs perfectly, whether 
I set the cpu[0].isa[0].sve_vl_se to 4 or keep it to 1.
Thank you for the suggestions !!
One last thing, the starter_se.py does not seem to have support for 
--cpu-type=ArmO3CPU (or am I missing something) ?


From: Giacomo Travaglini 
Sent: 11 January 2024 12:16
To: The gem5 Users mailing list 
Cc: Jason Lowe-Power ; Nazmus Sakib 
Subject: Re: ARM SVE ISA

You don't often get email from giacomo.travagl...@arm.com. Learn why this is 
important
WARNING This email originated external to the NMSU email system. Do not click 
on links or open attachments unless you are sure the content is safe.

Hi Nazmus,



I can see from what you posted you are compiling the testcase with 512b vector 
width. I believe you should amend the gem5 VL accordingly… Basically writing up 
in the gem5 config:



cpu.isa[0].sve_vl_se = 4



According to [1].

This should fix your problem. Another solution I believe would be to compile 
without specifying the VL. Then it should be VL agnostic code I presume.



Anyway, I also recommend you use configs/example/arm/starter_se.py as se.py is 
per se deprecated



Kind Regards



Giacomo



[1]: https://github.com/gem5/gem5/blob/stable/src/arch/arm/ArmISA.py#L179



From: Nazmus Sakib via gem5-users 
Date: Thursday, 11 January 2024 at 17:54
To: gem5-users@gem5.org 
Cc: Jason Lowe-Power , Nazmus Sakib 
Subject: [gem5-users] ARM SVE ISA

Hello.
I am trying to run a simple program with SVE instructions on gem5. However, the 
output with debug flag ExecALL suggests there is a issue with the decoder.
Here is the test code:

#define STREAM_ARRAY_SIZE 16
void main()

{

for (int j=0; j___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: ARM SVE ISA

2024-01-11 Thread Giacomo Travaglini via gem5-users
Hi Nazmus,

I can see from what you posted you are compiling the testcase with 512b vector 
width. I believe you should amend the gem5 VL accordingly… Basically writing up 
in the gem5 config:

cpu.isa[0].sve_vl_se = 4

According to [1].
This should fix your problem. Another solution I believe would be to compile 
without specifying the VL. Then it should be VL agnostic code I presume.

Anyway, I also recommend you use configs/example/arm/starter_se.py as se.py is 
per se deprecated

Kind Regards

Giacomo

[1]: https://github.com/gem5/gem5/blob/stable/src/arch/arm/ArmISA.py#L179

From: Nazmus Sakib via gem5-users 
Date: Thursday, 11 January 2024 at 17:54
To: gem5-users@gem5.org 
Cc: Jason Lowe-Power , Nazmus Sakib 
Subject: [gem5-users] ARM SVE ISA
Hello.
I am trying to run a simple program with SVE instructions on gem5. However, the 
output with debug flag ExecALL suggests there is a issue with the decoder.
Here is the test code:
#define STREAM_ARRAY_SIZE 16
void main()
{
for (int j=0; j___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] ARM SVE ISA

2024-01-11 Thread Nazmus Sakib via gem5-users
Hello.
I am trying to run a simple program with SVE instructions on gem5. However, the 
output with debug flag ExecALL suggests there is a issue with the decoder.
Here is the test code:
#define STREAM_ARRAY_SIZE 16
void main()
{
for (int j=0; j___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] About kvm-x86 in SE mode

2024-01-11 Thread 太阳王 via gem5-users
Hi all,


I am a beginner to use the Gem5. I am using kvm to run "x86-hello64-static" and 
switch to timing cpu in SE simulation but it seems to be not working. And 
I am getting an error that I dont understand.


Here are the errors that I am getting:


~~~
src/sim/simulate.cc:199: info: Entering event queue @ 0. Starting 
simulation...
src/arch/x86/kvm/x86_cpu.cc:542: warn: tr: S flag is set
src/cpu/kvm/base.cc:866: panic: KVM: Failed to set guest special registers
Memory Usage: 8527892 KBytes

~~~


I am certain that my computer supports and has KVM virtualization enabled. And 
my computer's architecture is also X86.


I cloned the latest version of gem5. And the python script I used is:


~~~
cache_hierarchy = NoCache()
memory = SingleChannelDDR3_1600()
processor = SimpleProcessor(
  cpu_type=CPUTypes.KVM,
  isa=ISA.X86,
  num_cores=1,
)
motherboard = SimpleBoard(
  clk_freq="3GHz",
  processor=processor,
  memory=memory,
  cache_hierarchy=cache_hierarchy,
)
binary = obtain_resource("x86-hello64-static")

motherboard.set_se_binary_workload(binary)
simulator = Simulator(board=motherboard)
simulator.run()
print(
  "Exiting @ tick {} because {}.".format(
simulator.get_current_tick(), 
simulator.get_last_exit_event_cause()
  )
)










~~~


At the same time, I run the sample script ??x86-ubuntu-run-with-kvm.py?? 
will get stuck in this:


~~~
in gem5/:
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0xc0010015) unsupported 
by gem5. Skipping.
src/arch/x86/kvm/x86_cpu.cc:1653: warn: kvm-x86: MSR (0x4b564d05) unsupported 
by gem5. Skipping.
200620: board.pc.com_1.device: attach terminal 0



in gem5/util/term:
./m5term 3456
 m5 terminal: Terminal 0 

~~~


And this simulation never run it again.


Thank you very much if you could help me answer my questions??


Best,
Chen SX___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org