[gem5-users] Re: Segmentation fault when restoring checkpoint in with DerivO3CPU

2021-10-05 Thread Đức Anh via gem5-users
Hi Eliot,

How could you restore the checkpoint with fs.py? What command option did
you use? I read through the fs.py file so I
believed m5.instatiate() is enough. I am using
- gem5 version [DEVELOP-FOR-V21.2]
- commit 6811158b28bd293487fb5e4bbbfb4bc2d5c259cb
- GCC version 7.5.0 and 11.1.0 (I tried both)
- Ubuntu 18.04

Best regards,
Duc Anh

On Tue, 5 Oct 2021 at 03:43, Eliot Moss  wrote:

> On 10/4/2021 4:46 PM, Đức Anh via gem5-users wrote:
> > Dear all,
> >
> > I am trying to use the checkpoint feature to skip the long and tired
> Linux booting part of the ARM
> > FS simulation. However, Gem5 throws the Segmentation fault when I try to
> restore the checkpoint. It
> > works fine with AtomicSimpleCPU, though.
> >
> > Here is the script I used to take the checkpoint
> > - run ./m5 checkpoint through the connected terminal
> > - in the python script, run m5.checkpoint("m5out/cpt.%d") and
> m5.simulate() again.
> >
> > Then I restore the checkpoint by:
> > m5.instantiate()
> > m5.simulate()
> >
> > There is no CPU switching. I used DeriveO3CPU
> >
> > I also tried the fs.py script with --checkpoint-restore option but the
> problem persists. Here is the
> > error log:
> >
> > --- BEGIN LIBC BACKTRACE ---
> > build/ARM/gem5.opt(_ZN4gem515print_backtraceEv+0x2c)[0x55a2b680abec]
> > build/ARM/gem5.opt(+0x1c346ef)[0x55a2b68266ef]
> > /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7fa8ee493980]
> > --- END LIBC BACKTRACE ---
> > Segmentation fault (core dumped)
> >
> > I read in one of the older emails that fs.py is outdated. Perhaps
> dealing with checkpoint and
> > DerivO3CPU need another way?
>
> See recent posts - folks are on the trail of a bug in either
> the C++ code, C/C++ libraries, or C++ compiler / tool chain.
> If it's the same bug then it has to do with the simulator's
> memory management somehow (or a pointer gets zapped) - the
> result is a bad free.  This may NOT be the same issue.  The
> backtrace I get from gem5.opt indicates a bad free with
> tcmalloc reporting it.
>
> fs.py has worked for me, maybe with some customizations.
> I think that the wording about it is trying to suggest that
> it's perhaps a bit rigid or limiting for things a lot of people
> may want to do ...
>
> Regards - Eliot Moss
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Segmentation fault when restoring checkpoint in with DerivO3CPU

2021-10-04 Thread Đức Anh via gem5-users
Dear all,

I am trying to use the checkpoint feature to skip the long and tired Linux
booting part of the ARM FS simulation. However, Gem5 throws the
Segmentation fault when I try to restore the checkpoint. It works fine with
AtomicSimpleCPU, though.

Here is the script I used to take the checkpoint
- run ./m5 checkpoint through the connected terminal
- in the python script, run m5.checkpoint("m5out/cpt.%d") and m5.simulate()
again.

Then I restore the checkpoint by:
m5.instantiate()
m5.simulate()

There is no CPU switching. I used DeriveO3CPU

I also tried the fs.py script with --checkpoint-restore option but the
problem persists. Here is the error log:

--- BEGIN LIBC BACKTRACE ---
build/ARM/gem5.opt(_ZN4gem515print_backtraceEv+0x2c)[0x55a2b680abec]
build/ARM/gem5.opt(+0x1c346ef)[0x55a2b68266ef]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7fa8ee493980]
--- END LIBC BACKTRACE ---
Segmentation fault (core dumped)

I read in one of the older emails that fs.py is outdated. Perhaps dealing
with checkpoint and DerivO3CPU need another way?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Run Gem5 multithreading or multicore

2021-07-30 Thread Đức Anh via gem5-users
Dear all,

I am looking for a way to run Gem5 in parallel (not simulating multicore,
but parallelize the Gem5 itself). So far I see I can have different
eventq_index for each SimObject, and they will run on different threads.
But when I tried it with 2 O3CPU I got an error:

gem5.opt: build/ARM/cpu/o3/lsq_unit.cc:1245: bool
> o3::LSQUnit::trySendPacket(bool, PacketPtr): Assertion `state->request() ==
> storeWBIt->request()' failed


 And I don't see anywhere in the doc mention about this. So, is the Gem5
parallel feature developed yet? If yes then how can I do it?

Thank you,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Đức Anh via gem5-users
Hi Gabriel,

Thanks for your help. This way is much simpler than trying to get a true
random generator in the C++ workload.

Best,
Duc Anh

On Tue, 20 Jul 2021 at 15:40, Gabriel Busnot via gem5-users <
gem5-users@gem5.org> wrote:

> Indeed, gem5 is designed to be deterministic so all random number
> generation should rely on a deterministically seeded random number
> generator. This random number generator normally is 'random_mt' located in
> src/base/random.cc. However not all random number generated in gem5 relies
> on this generator, yet.
>
> Looking at syscall emulation implementations, it looks like a dedicated
> random generator is used here for emulating a read to /dev/urandom:
> src/kern/linux/linux.cc:126. You could replace "random.random(0,
> 255)" with "random_mt.random(0, 255)" to use the main random
> number generator. Not tested but should work. Then, you can seed random_mt
> from your python script using "seedRandom(int())". seedRandom is
> from the m5.core module. I personally like to use a --seed command line
> option to set the seed more conveniently.
>
> Gabriel
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Đức Anh via gem5-users
Hi Gabriel,

It was indeed the output is stuck in the stdout buffer because the program
ran too long. When I increase the >> 25 to >> 45 I can see it works fine.
It was quite fast on the host, I just don't think it would be that slow on
the simulator.

I generate random numbers by std::random_device,  std::mt19937,
and std::uniform_int_distribution. and bound them
inside the 64-bit range. However, the randomized number is the same between
every invocation of Gem5, is this due to the deterministic property of Gem5?

Best,
Duc Anh

On Tue, 20 Jul 2021 at 14:24, Gabriel Busnot via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Duc,
>
> Having the print not displayed on screen does not necessarily mean that it
> has not been executed. It could just have been stuck in stdout buffer which
> was not flush because of an abnormal program termination.
>
> If you initialize you data with truly random and unbounded data, "number =
> block.number[i] >> 25" could be as big as (2^(64-25)-1) which is... huge,
> even taking the sqrt.
> If you have not already done so, you should check that cap is not to big
> in some cases and that the program takes a reasonable amount of time when
> running natively on your host. By reasonable, I mean a couple of ms for a
> less than a minute simulation on gem5.
>
> And as a side note, if you want to stress your caches, you can have a look
> at the MemTest cpu in gem5. It is purposely built to generate back to back
> memory accesses with controlled line sharing.
>
> Best,
> Gabriel
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Gem5 stuck when simulate C++ workload in SE mode

2021-07-20 Thread Đức Anh via gem5-users
Hi all,

I am running into a strange problem when simulating a C++ program in SE
mode. In short, when I comment a for loop in 1 of my function, gem5 works.
Otherwise, when I uncomment the for loop (the empty for loop, nothing in
the body) gem5 stucks after startup. It likes Gem5 cannot find where the
entry of the program is. I have a printf at the start and it does not print
out. Below I will provide more detail about my setup

Gem5 develop branch, commit 94d44ada63e217ae3d2a43a612622a0c46642206
> Host OS: Ubuntu 18.04
> Python: 3.8.8
> C++ compiler: aarch64-none-linux-gnu-g++ (GNU Toolchain for the A-profile
> Architecture 10.2-2020.11 (arm-10.16)) 10.2.1 20201103


The python config file: It's pretty long if I paste everything here.
Basically, it's just an AtomicSimpleCPU -> l2bus -> l2cache -> membus ->
mem_ctrl

C++ file: I simplify the file content and only show the part producing the
bug

// 8 * 8 bytes = 64 bytes in size
typedef struct {
uint64_t number[8];
} LineSizedStruct;

alignas(64) LineSizedStruct data[129];

/ The main actor here ***/
void random_latency_operation(LineSizedStruct block) {
for (int i = 0; i < 8; ++i) {
if (block.number[i] > 1) {
uint64_t number = block.number[i] >> 25;
int cap = (int) std::sqrt(number);

/ BUG PART /
for (int j = 1; j < cap; ++j) {
// if (number / j == j) {
// // we just want the division operation, so we are
done
// break;
// }
}
   /**/
}
block.number[i] = generate_random_uint64();
}
}

int main(int argc, char const *argv[]) {
printf("Hello world\n");

// generate the data array with random number
init_random_data();

random_latency_operation(data[0]);

return 0;
}

__
The compile command: aarch64-none-linux-gnu-g++ src/cache-stress.cc -o
bin/cache-stress -static
I highlight the for loop that produces the bug. When I comment that for
loop, everything is fine, but when I uncomment that for loop, Gem5 stuck
and can't execute the C++ program. The Hello world is never printed.

Does anyone know what happened?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Qemu equivalent command/simulation to Gem5

2021-05-12 Thread Đức Anh via gem5-users
Hi,

Thanks for the information.

Best,
Duc Anh

Vào Th 3, 11 thg 5, 2021 vào lúc 15:15 Eliot Moss via gem5-users <
gem5-users@gem5.org> đã viết:

> On 5/11/2021 8:33 AM, Đức Anh via gem5-users wrote:
> > Dear all,
> >
> > I have a Linux kernel v5.10.27 build for arm64 architecture that is
> runnable on Gem5. Now I want to
> > run it on Qemu-system-aarch64, but I haven't figure out the proper
> command and parameters yet. Here
> > is the few things I have tried:
> > - qemu-system-aarch64 -M vexpress-a15 --cpu cortex-a15 -m 2048 --kernel
> output/vmlinux
> >  From the Gem5 source code, I know Gem5 implements Arm CoreTile Express
> A15x2 (V2P-CA15) (from the
> > comment in src/dev/arm/RealView.py). It has Cortex-A15. So I chose the
> parameters like above.
> > However, it showed the following error:
> >
> > qemu-system-aarch64: Trying to execute code outside RAM or ROM at
> 0x0400
> >
> > The reason I think is vexpress-a15 and cortex-a15 are arm architecture,
> not arm64. I tried a few
> > other parameters like cortex-a53, cortex-a57, versatileab, versatilepb,
> but all of them do not work.
> >
> > So how can I run the kernel on Qemu?
> >
> > And besides, I wonder how Gem5 implements Arm CoreTile Express A15x2
> (ARM arch) and supports ARMv8
> > (arm64 arch) at the same time?
>
> Maybe post to the qemu mailing lists?   EM
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Qemu equivalent command/simulation to Gem5

2021-05-11 Thread Đức Anh via gem5-users
Dear all,

I have a Linux kernel v5.10.27 build for arm64 architecture that is
runnable on Gem5. Now I want to run it on Qemu-system-aarch64, but I
haven't figure out the proper command and parameters yet. Here is the few
things I have tried:
- qemu-system-aarch64 -M vexpress-a15 --cpu cortex-a15 -m 2048 --kernel
output/vmlinux
>From the Gem5 source code, I know Gem5 implements Arm CoreTile Express
A15x2 (V2P-CA15) (from the comment in src/dev/arm/RealView.py). It has
Cortex-A15. So I chose the parameters like above. However, it showed the
following error:

qemu-system-aarch64: Trying to execute code outside RAM or ROM at
0x0400

The reason I think is vexpress-a15 and cortex-a15 are arm architecture, not
arm64. I tried a few other parameters like cortex-a53, cortex-a57,
versatileab, versatilepb, but all of them do not work.

So how can I run the kernel on Qemu?

And besides, I wonder how Gem5 implements Arm CoreTile Express A15x2 (ARM
arch) and supports ARMv8 (arm64 arch) at the same time?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Booting Rtems OS in Gem5 ARM FS mode

2021-04-07 Thread Đức Anh via gem5-users
Dear all,

I am looking for a way to run RTEMS 5 OS in Gem5 ARM FS simulation.
Previously, it was possible by booting with RealViewPBX machine-type (guide
) but the RealViewPBX
device was removed from Gem5 since 10-2019. So now I need to find another
way to do it. Can someone give me some suggestions on what to do?

- What do I need to do if I want to use a new OS/kernel in Gem5, like which
config I need to be aware of?
- Is there a Qemu counterpart of Gem5 machine-type? Like, if a kernel can
boot on that Qemu type then it can boot on Gem5.
- Just curious, but which real device does VExpress_GEM5_ platform
model? I found that VExpress probably refers to the Arm Versatile Express
Juno Development board, but what about the term after it (V1, Base,
HDLcd,...)

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Building ARM disk image by Packer

2021-03-20 Thread Đức Anh via gem5-users
Hi Hoa,

Thanks for the response. However, I haven't succeeded in trying out the
packer arm plugin yet. I am also trying to use qemu-system-aarch64 to build
the image, but I haven't figureed out the correct way. On the Gem5 website
there are some prebuilt ARM images. Can you share how you build those
images?

Best regards,
Duc Anh

Vào Th 5, 18 thg 3, 2021 vào lúc 16:47 Hoa Nguyen 
đã viết:

> Hi Duc Anh,
>
> I'm not sure the setup laid out in the tutorial would work for arm
> system as we only tested it on x86 arch. However, I believe there are
> forks of packer that would work with arm arch
> (https://www.packer.io/community-tools), and there are also tutorials
> for using packer to build disk images for arm devices, such as
> Raspberry Pi.
>
> arm also provides documentation of building Linux kernels
> (
> https://www.gem5.org/documentation/general_docs/fullsystem/building_arm_kernel
> )
> as well as offers built disk images/Linux
> kernels(
> https://www.gem5.org/documentation/general_docs/fullsystem/guest_binaries
> ).
>
> Regards,
> Hoa Nguyen
>
> On 3/17/21, Đức Anh via gem5-users  wrote:
> > Dear all,
> >
> > I am building an ARM64 disk image by Packer. However, I ran into the
> > following error
> >
> > 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr: WARNING:
> Image
> >> format was not specified for '/tmp/packer554386766' and probing guessed
> >> raw.
> >> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
> >>  Automatically detecting the format is dangerous for raw images, write
> >> operations on block 0 will be restricted.
> >> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
> >>  Specify the 'raw' format explicitly to remove the restrictions.
> >> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
> >> qemu-system-aarch64: -drive
> >>
> file=/home/dauto98/Repositories/gem5/configs/thesis/arm/disks/packer_cache/d60fab3d2cbda6b0379a55b2ab92292fe6342d41.iso,index=0,media=cdrom:
> >> drive with bus=0, unit=0 (index=0) exists
> >> 2021/03/17 17:11:44 packer-builder-qemu plugin: failed to unlock port
> >> lockfile: close tcp 127.0.0.1:5945: use of closed network connection
> >> 2021/03/17 17:11:44 packer-builder-qemu plugin: failed to unlock port
> >> lockfile: close tcp 127.0.0.1:4188: use of closed network connection
> >
> >
> > I am using ubuntu-18.04.2-server-arm64, QEMU emulator version
> 2.11.1(Debian
> > 1:2.11+dfsg-1ubuntu7.36) to build the image. The preseed.cfg and
> > serial-getty@.service file are the same as the one on this
> > <
> https://gem5art.readthedocs.io/en/latest/tutorials/boot-tutorial.html#creating-a-disk-image
> >
> > tutorial
> >
> > I attach the packer json config file in the email, please have a look.
> >
> > How can I remove this error and build an image for ARM system?
> >
> > Best regards,
> > Duc Anh
> >
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Building ARM disk image by Packer

2021-03-17 Thread Đức Anh via gem5-users
Dear all,

I am building an ARM64 disk image by Packer. However, I ran into the
following error

2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr: WARNING: Image
> format was not specified for '/tmp/packer554386766' and probing guessed raw.
> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
>  Automatically detecting the format is dangerous for raw images, write
> operations on block 0 will be restricted.
> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
>  Specify the 'raw' format explicitly to remove the restrictions.
> 2021/03/17 17:11:44 packer-builder-qemu plugin: Qemu stderr:
> qemu-system-aarch64: -drive
> file=/home/dauto98/Repositories/gem5/configs/thesis/arm/disks/packer_cache/d60fab3d2cbda6b0379a55b2ab92292fe6342d41.iso,index=0,media=cdrom:
> drive with bus=0, unit=0 (index=0) exists
> 2021/03/17 17:11:44 packer-builder-qemu plugin: failed to unlock port
> lockfile: close tcp 127.0.0.1:5945: use of closed network connection
> 2021/03/17 17:11:44 packer-builder-qemu plugin: failed to unlock port
> lockfile: close tcp 127.0.0.1:4188: use of closed network connection


I am using ubuntu-18.04.2-server-arm64, QEMU emulator version 2.11.1(Debian
1:2.11+dfsg-1ubuntu7.36) to build the image. The preseed.cfg and
serial-getty@.service file are the same as the one on this

tutorial

I attach the packer json config file in the email, please have a look.

How can I remove this error and build an image for ARM system?

Best regards,
Duc Anh


boot-exit.json
Description: application/json
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: Running ARM FS mode

2021-03-17 Thread Đức Anh via gem5-users
Thank you, adding --disk-image option solves the problem.

Vào Th 4, 17 thg 3, 2021 vào lúc 00:25 Giacomo Travaglini via gem5-users <
gem5-users@gem5.org> đã viết:

> Hi,
>
> You are not providing a --disk-image option to fs.py
>
> You should download the latest AArch32 disk image from the link you
> mentioned and pass it to the command line:
>
> https://www.gem5.org/documentation/general_docs/fullsystem/guest_binaries
>
> Kind Regards
>
> Giacomo
>
> > -----Original Message-
> > From: Đức Anh via gem5-users 
> > Sent: 16 March 2021 15:44
> > To: gem5 users mailing list 
> > Cc: Đức Anh 
> > Subject: [gem5-users] Running ARM FS mode
> >
> > Dear all,
> >
> > I am trying to run the Gem5 simulation in FS mode and ARM architecture
> with
> > the resource provided from the repo. However, I am running into this
> error
> >
> >
> > No filesystem could mount root, tried:
> >  ext3
> >   ext4
> >   ext2
> >  squashfs
> >   vfat
> >   fuseblk
> >
> > Kernel panic - not syncing: VFS: Unable to mount root fs on
> > unknown-block(1,0)
> >
> >
> > The error occurred in both stable and develop branch. The command I use
> it:
> >
> >
> > ./build/ARM/gem5.opt configs/example/fs.py
> > --kernel=configs/thesis/arm/binaries/vmlinux.arm
> > --machine-type=VExpress_GEM5_V1
> > --dtb-file=system/arm/dt/armv7_gem5_v1_1cpu.dtb
> > --bootloader=system/arm/bootloader/arm/boot.arm
> > --command-line 'earlyprintk=pl011,0x1c09 lpj=19988480 rw
> > loglevel=8 mem=256MB root=/dev/ram0 console_msg_format=syslog
> > nokaslr norandmaps panic=-1 printk.devkmsg=on printk.time=y rw
> > console=ttyAMA0 - lkmc_home=/lkmc'
> >
> >
> > The kernel and bootloader I got from the guest binaries page
> > <https://www.gem5.org/documentation/general_docs/fullsystem/guest_bi
> > naries> , latest Linux Kernel Image / Bootloader (recommended). DTB file
> is
> > generated by the command make -C system/arm/dt.
> >
> >
> > Before I used this command line instead
> >
> > ./build/ARM/gem5.opt configs/example/fs.py
> > --kernel=configs/thesis/arm/binaries/vmlinux.arm
> > --machine-type=VExpress_GEM5_V1
> > --dtb-file=system/arm/dt/armv7_gem5_v1_1cpu.dtb
> > --bootloader=system/arm/bootloader/arm/boot.arm
> >
> >
> > The same as the above except for the command-line arg. I got the
> following
> > error
> >
> >
> > VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
> > [0.764532] Please append a correct "root=" boot option; here are
> > the available partitions:
> > [0.764537] 01004096 ram0
> > [0.764538]  (driver?)
> > [0.764545] 01014096 ram1
> > [0.764546]  (driver?)
> > [0.764552] 01024096 ram2
> > [0.764553]  (driver?)
> > [0.764560] 01034096 ram3
> > [0.764561]  (driver?)
> > [0.764567] 01044096 ram4
> > [0.764569]  (driver?)
> > [0.764575] 01054096 ram5
> > [0.764576]  (driver?)
> > [0.764583] 01064096 ram6
> > [0.764584]  (driver?)
> > [0.764590] 01074096 ram7
> > [0.764591]  (driver?)
> > [0.764598] 01084096 ram8
> > [0.764599]  (driver?)
> > [0.764605] 01094096 ram9
> > [0.764606]  (driver?)
> > [0.764613] 010a4096 ram10
> > [0.764614]  (driver?)
> > [0.764620] 010b4096 ram11
> > [0.764622]  (driver?)
> > [0.764628] 010c4096 ram12
> > [0.764629]  (driver?)
> > [0.764636] 010d4096 ram13
> > [0.764637]  (driver?)
> > [0.764643] 010e4096 ram14
> > [0.764644]  (driver?)
> > [0.764651] 010f4096 ram15
> > [0.764652]  (driver?)
> > [0.764662] Kernel panic - not syncing: VFS: Unable to mount root fs
> > on unknown-block(0,0)
> >
> >
> > That why I add the command-line option and specify ram0 as the root, but
> > the simulation is still not working.
> >
> > Can anyone help me with this?
> >
> > Thank you,
> > Duc Anh
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Running ARM FS mode

2021-03-16 Thread Đức Anh via gem5-users
Dear all,

I am trying to run the Gem5 simulation in FS mode and ARM architecture with
the resource provided from the repo. However, I am running into this error

No filesystem could mount root, tried:
>  ext3
>   ext4
>   ext2
>  squashfs
>   vfat
>   fuseblk
>
> Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(1,0)


The error occurred in both stable and develop branch. The command I use it:

./build/ARM/gem5.opt configs/example/fs.py
> --kernel=configs/thesis/arm/binaries/vmlinux.arm
> --machine-type=VExpress_GEM5_V1
> --dtb-file=system/arm/dt/armv7_gem5_v1_1cpu.dtb
> --bootloader=system/arm/bootloader/arm/boot.arm
> --command-line 'earlyprintk=pl011,0x1c09 lpj=19988480 rw
> loglevel=8 mem=256MB *root=/dev/ram0* console_msg_format=syslog nokaslr
> norandmaps panic=-1 printk.devkmsg=on printk.time=y rw console=ttyAMA0 -
> lkmc_home=/lkmc'


The kernel and bootloader I got from the guest binaries page
,
latest Linux Kernel Image / Bootloader (recommended). DTB file is generated
by the command *make -C system/arm/dt.*

Before I used this command line instead

> ./build/ARM/gem5.opt configs/example/fs.py
> --kernel=configs/thesis/arm/binaries/vmlinux.arm
> --machine-type=VExpress_GEM5_V1
> --dtb-file=system/arm/dt/armv7_gem5_v1_1cpu.dtb
> --bootloader=system/arm/bootloader/arm/boot.arm


The same as the above except for the command-line arg. I got the following
error

VFS: Cannot open root device "sda1" or unknown-block(0,0): error -6
> [0.764532] Please append a correct "root=" boot option; here are the
> available partitions:
> [0.764537] 01004096 ram0
> [0.764538]  (driver?)
> [0.764545] 01014096 ram1
> [0.764546]  (driver?)
> [0.764552] 01024096 ram2
> [0.764553]  (driver?)
> [0.764560] 01034096 ram3
> [0.764561]  (driver?)
> [0.764567] 01044096 ram4
> [0.764569]  (driver?)
> [0.764575] 01054096 ram5
> [0.764576]  (driver?)
> [0.764583] 01064096 ram6
> [0.764584]  (driver?)
> [0.764590] 01074096 ram7
> [0.764591]  (driver?)
> [0.764598] 01084096 ram8
> [0.764599]  (driver?)
> [0.764605] 01094096 ram9
> [0.764606]  (driver?)
> [0.764613] 010a4096 ram10
> [0.764614]  (driver?)
> [0.764620] 010b4096 ram11
> [0.764622]  (driver?)
> [0.764628] 010c4096 ram12
> [0.764629]  (driver?)
> [0.764636] 010d4096 ram13
> [0.764637]  (driver?)
> [0.764643] 010e4096 ram14
> [0.764644]  (driver?)
> [0.764651] 010f4096 ram15
> [0.764652]  (driver?)
> [0.764662] Kernel panic - not syncing: VFS: Unable to mount root fs on
> unknown-block(0,0)


That why I add the command-line option and specify ram0 as the root, but
the simulation is still not working.

Can anyone help me with this?

Thank you,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: How to get the execution time of each CPU?

2020-12-11 Thread Đức Anh via gem5-users
Hi Niko,

It seems to be a bug in DerivO3CPU. I have found a workaround. Here I will
explain my finding.

First, it looks like the numCycles variable is increased every tick,
whether is there an instruction to execute or not, in *src/cpu/o3/cpu.cc *line
515 function tick. But I noticed the committedInsts stat is correct, and it
is increased in a function deep down in the call chain starting from
*commit.tick()
*(in *src/cpu/o3/cpu.cc *line 529 function tick). So I guess the
*commit.tick()* function return early at line 662, file
*src/cpu/o3/commit_impl.hh*, before reaching the point where committedInsts
is increased.

So I made the following changes:
- Change the return type of function *template  void
DefaultCommit::tick() *at line 654 file *src/cpu/o3/commit_impl.hh *from
void to bool
- Make the corresponding change in the header file (*src/cpu/o3/commit.hh* line
212)
- Make function tick *return false* if it returns early at line 662, file
*src/cpu/o3/commit_impl.hh*, otherwise, *return true* at the end of the
function
- In the function tick of the O3CPU (line 507, file *src/cpu/o3/cpu.cc*),
catch the returned value from *commit.tick().* If it is false, decreased 1
from the numCycles, basically undo the increment at line 515. I could move
the ++numCycles line down and only do it if the *commit.tick()* return
true, but I don't know if it affects the *updateCycleCounters* function.

This workaround works for me. But I don't know if it breaks somethings, SMT
maybe?

Hope this help,
Duc Anh

Vào Th 6, 11 thg 12, 2020 vào lúc 09:13 POLYCHRONOU Nikolaos <
nikolaos.polychro...@cea.fr> đã viết:

> Hi,
>
> I will be very interested to know if this is a bug in Derive03CPU. I work
> with the stats file, with one CPU for the moment, but I never checked with
> 2cores.
>
> Regards
>
> Niko
>
>
>
> *From:* Đức Anh via gem5-users 
> *Sent:* Thursday, December 10, 2020 7:09 PM
> *To:* gem5 users mailing list 
> *Cc:* Đức Anh 
> *Subject:* [gem5-users] How to get the execution time of each CPU?
>
>
>
> Dear all,
>
>
>
> I have a system with 2 DerivO3CPU running 2 different workloads, and I
> want to measure the execution time of each CPU. How can I do it? In my
> case, 1 core always finish later because the workload is significantly
> bigger than the other.
>
>
>
> I have looked into stats.txt but the numCycles stat for each CPU is always
> equal. This is not the case if I use TimingSimpleCPU, where the numCycles
> is different, I can take it and divide it with the frequency to get the
> execution time. Is there any way I can infer the execution time through the
> available stats?
>
>
>
> Best regards,
>
> Duc Anh
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] How to get the execution time of each CPU?

2020-12-10 Thread Đức Anh via gem5-users
Dear all,

I have a system with 2 DerivO3CPU running 2 different workloads, and I want
to measure the execution time of each CPU. How can I do it? In my case, 1
core always finish later because the workload is significantly bigger than
the other.

I have looked into stats.txt but the numCycles stat for each CPU is always
equal. This is not the case if I use TimingSimpleCPU, where the numCycles
is different, I can take it and divide it with the frequency to get the
execution time. Is there any way I can infer the execution time through the
available stats?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: AttributeError: Class DDR3_1600_8x8 has no parameter port

2020-12-06 Thread Đức Anh via gem5-users
Hi Anthony,

Since gem5 version 20.1, the mem_ctrl API has changed, you can see the
changelog here .
The tutorial is a bit out of date about this. The Ayush's solution is a
correct one.

Best regards,
Duc Anh

Vào CN, 6 thg 12, 2020 vào lúc 22:46 Ayush Kumar Varshney via gem5-users <
gem5-users@gem5.org> đã viết:

> I think use it with a controller,
> system.mem_ctrl = MemCtrl()
> system.mem_ctrl.dram = DDR3_1600_8x8()
> system.mem_ctrl.dram.range = system.mem_ranges[0]
> system.mem_ctrl.port = system.membus.master
>
> It works for me!
>
> Regards
> Ayush
>
> On Sun, 6 Dec 2020 at 21:34, anthonyabeo--- via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> So after cloning and building X86/gem5.opt, I started following the
>> "Creating a simple configuration script" tutorial. I get the error when I
>> run "build/X86/gem5.opt configs/tutorial/simple.py"
>>
>> gem5 Simulator System.  http://gem5.org
>> gem5 is copyrighted software; use the --copyright option for details.
>>
>> gem5 version 20.1.0.2
>> gem5 compiled Dec  4 2020 14:31:20
>> gem5 started Dec  4 2020 14:32:24
>> gem5 executing on ubuntu-bionic, pid 9028
>> command line: ./gem5/build/X86/gem5.opt simple.py
>>
>> Here's the output log.
>>
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>> warn: membus.master is deprecated. `master` is now called `mem_side_ports`
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>> warn: interrupts.int_master is deprecated. `int_master` is now called
>> `int_requestor`
>> warn: membus.master is deprecated. `master` is now called `mem_side_ports`
>> warn: interrupts.int_slave is deprecated. `int_slave` is now called
>> `int_responder`
>> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
>> warn: membus.master is deprecated. `master` is now called `mem_side_ports`
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File "build/X86/python/m5/main.py", line 457, in main
>>   File "simple.py", line 36, in 
>> system.mem_ctrl = DDR3_1600_8x8()
>>   File "build/X86/python/m5/SimObject.py", line 1363, in __setattr__
>> AttributeError: Class DDR3_1600_8x8 has no parameter port
>> ___
>> gem5-users mailing list -- gem5-users@gem5.org
>> To unsubscribe send an email to gem5-users-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Gem5 FS - Kernel panic - not syncing: Fatal exception in interrupt

2020-11-21 Thread Đức Anh via gem5-users
Hello everyone,

I am new to running Gem5 in FS mode, and I'm trying to create a working
simulation but I got stuck with an error. Here is a part of the log, which
I believe is an error log (it's not obvious to me). Below the log, I will
give more info about my setup.
___output from m5term___
[6.760111]  setup_IO_APIC+0x34c/0x852
[6.761035]  ? clear_IO_APIC+0x39/0x60
[6.761984]  apic_intr_mode_init+0x100/0x102
[6.762832]  x86_late_time_init+0x24/0x35
[6.763683]  start_kernel+0x4fe/0x5c3
[6.764621]  x86_64_start_reservations+0x24/0x26
[6.765521]  x86_64_start_kernel+0x74/0x77
[6.766389]  secondary_startup_64+0xa4/0xb0
[6.767261] Modules linked in:
[6.767841] CR2: 0088
[6.768631] ---[ end trace cc3dac460086c1e2 ]---
[6.769560] RIP: 0010:tick_periodic+0x1b/0x80
[6.770426] Code: 41 5d 41 5e 41 5f 5d c3 0f 0b cc cc cc cc cc 66 66 66
66 90 55 39 3d 84 14 72 01 48 89 e5 74 26 65 48 8b 05 1f e8 ed 7e 31 ff
 80 88 00 00 00 03 40 0f 95 c7 e8 e5 fd fe ff bf 01 00 00 00 e8
[6.772347] RSP: :c9003e20 EFLAGS: 007c
[6.773213] RAX:  RBX: 827f46c0 RCX:

[6.774166] RDX:  RSI: 007c RDI:

[6.775150] RBP: c9003e20 R08:  R09:
88801ec016d0
[6.776136] R10:  R11: 8266ade8 R12:
7fff
[6.777103] R13:  R14: 0040 R15:
88801f12b600
[6.778135] FS:  () GS:88801f40()
knlGS:
[6.779193] CS:  0010 DS:  ES:  CR0: 80050033
[6.780038] CR2: 0088 CR3: 0260a000 CR4:
06b0
[6.780993] DR0:  DR1:  DR2:

[6.781949] DR3:  DR6: 0ff0 DR7:

[6.782862] Kernel panic - not syncing: Fatal exception in interrupt
[6.783865] ---[ end Kernel panic - not syncing: Fatal exception in
interrupt ]---
___
_output from gem5
warn: x86 cpuid: unknown family 0x4000 (a lot of this cpuid warning)
warn: x86 cpuid: unknown family 0x4000
warn: instruction 'sgdt_Ms' unimplemented
_
I am using
- Gem5 20.1.0.2 (stable branch)
- Python 2.7.17
- gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
- gem5 command: ./build/X86/gem5.opt configs/example/fs.py
--cpu-type="TimingSimpleCPU" --cpu-clock="1GHz"
--kernel="linux-5.9.9/vmlinux" --disk-image="disk-image/ubuntu-image/ubuntu"
- packer 1.6.5 to create disk-image
- QEMU emulator version 2.11.1(Debian 1:2.11+dfsg-1ubuntu7.33)
How I create linux kernel:
- Download linux 5.9.9 kernel from kernel.org
- unpack the tar file
- run cp -v /boot/config-$(uname -r) .config to generate the config file
- run make
- make still prompted me to do some long configuration setup, too long that
I just held enter to accept the default option
I attached all the relevant files to this email.

Thank you for your time.
Duc Anh
 m5 terminal: Terminal 0 
[0.00] Linux version 5.9.9 (dauto98@Dauto98-ROG-Strix-G531GD) (gcc 
(Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, GNU ld (GNU Binutils for Ubuntu) 2.30) #1 
SMP Sat Nov 21 17:25:25 CET 2020
[0.00] Command line: earlyprintk=ttyS0 console=ttyS0 lpj=723 
root=/dev/hda1
[0.00] KERNEL supported cpus:
[0.00]   Intel GenuineIntel
[0.00]   AMD AuthenticAMD
[0.00]   Hygon HygonGenuine
[0.00]   Centaur CentaurHauls
[0.00]   zhaoxin   Shanghai
[0.00] CPU: vendor_id 'M5 Simulator' unknown, using generic init.
[0.00] CPU: Your system may be unstable.
[0.00] x86/fpu: x87 FPU will use FXSAVE
[0.00] BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009fbff] usable
[0.00] BIOS-e820: [mem 0x0009fc00-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0x1fff] usable
[0.00] BIOS-e820: [mem 0x2000-0xbfff] reserved
[0.00] BIOS-e820: [mem 0x-0x] reserved
[0.00] printk: bootconsole [earlyser0] enabled
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.5 present.
[0.00] DMI:  , BIOS  06/08/2008
[0.00] tsc: Fast TSC calibration using PIT
[0.00] tsc: Detected 1000.059 MHz processor
[0.002022] last_pfn = 0x2 max_arch_pfn = 0x4
[0.005066] Disabled
[0.005452] x86/PAT: MTRRs disabled, skipping PAT initialization too.
[0.006130] CPU MTRRs all blank - virtualized system.
[0.006702] x86/PAT: Configuration [0-7]: WB  WT  UC- UC  WB  WT  UC- UC
[0.012806] found SMP MP-table at [mem 0x000f0050-0x000f005f]
[0.038881] check: Scanning 1 areas for low memory corruption
[0.104889] ACPI: Early table checksum verification disabled
[

[gem5-users] Re: How to simulate multithread, multicore and multiprocessor system ?

2020-11-15 Thread Đức Anh via gem5-users
tracev+0x2c)[0x5565d4f4958c]
> >> ./build/X86/gem5.opt(_Z12abortHandleri+0x4a)[0x5565d4f5c0aa]
> >> /lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7f51a53c58a0]
> >> /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f51a39a1f47]
> >> /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f51a39a38b1]
> >> /lib/x86_64-linux-gnu/libc.so.6(+0x3042a)[0x7f51a399342a]
> >> /lib/x86_64-linux-gnu/libc.so.6(+0x304a2)[0x7f51a39934a2]
> >>
> >>
> ./build/X86/gem5.opt(_ZN5Stats5Group12addStatGroupEPKcPS0_+0x16f)[0x5565d526a44f]
> >> ./build/X86/gem5.opt(_ZN5Stats5GroupC2EPS0_PKc+0xe8)[0x5565d526a908]
> >>
> >>
> ./build/X86/gem5.opt(_ZN11ThreadState16ThreadStateStatsC2EP7BaseCPUPS_+0x65)[0x5565d5335fc5]
> >>
> >>
> ./build/X86/gem5.opt(_ZN11ThreadStateC1EP7BaseCPUsP7Process+0x44)[0x5565d5336324]
> >>
> >>
> ./build/X86/gem5.opt(_ZN13O3ThreadStateI9O3CPUImplEC2EP9FullO3CPUIS0_EiP7Process+0x2f)[0x5565d515ed7f]
> >>
> >>
> ./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplEC1EP16DerivO3CPUParams+0x1a48)[0x5565d516d0d8]
> >>
> ./build/X86/gem5.opt(_ZN16DerivO3CPUParams6createEv+0x44)[0x5565d5137f94]
> >> ./build/X86/gem5.opt(+0xda6583)[0x5565d55bc583]
> >> ./build/X86/gem5.opt(+0x6ac8b9)[0x5565d4ec28b9]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x20a)[0x7f51a57e558a]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bec8)[0x7f51a574dec8]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2be)[0x7f51a574e2be]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2be)[0x7f51a574e2be]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2aa)[0x7f51a574e2aa]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba0f)[0x7f51a574da0f]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e)[0x7f51a574e4ce]
> >>
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b)[0x7f51a574f24b]
> >>
> /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18855d)[0x7f51a575a55d]
> >> --- END LIBC BACKTRACE ---
> >> Aborted (core dumped)
> >>
> >> Best regards,
> >> Duc Anh
> >>
> >> Vào Th 4, 11 thg 11, 2020 vào lúc 23:32 Hoa Nguyen <
> >> hoangu...@ucdavis.edu> đã viết:
> >>
> >>> Hi Duc Anh,
> >>>
> >>> I assume you want to enable SMT for X86. SMT for X86 has yet to be
> >>> supported, but there is progress on this recently. You can keep track
> >>> of the development via JIRA ticket
> >>> (https://gem5.atlassian.net/browse/GEM5-332) and via this relation
> >>> change (https://gem5-review.googlesource.com/c/public/gem5/+/35837).
> >>>
> >>> Regarding the stats error, can you be a little bit more specific about
> >>> the version of gem5 that you're using and the command that you used?
> >>> Are they the same as the ones in the first email
> >>> (https://www.mail-archive.com/gem5-users@gem5.org/msg18678.html)?
> >>>
> >>> Regards,
> >>> Hoa Nguyen
> >>>
> >>> On 11/10/20, Đức Anh via gem5-users  wrote:
> >>> > Hi Ayaz,
> >>> >
> >>> > Thanks for the help. I guess if we don't share anything between the
> >>> cores
> >>> > then it will be the multi-processor platform, right? Btw, how to
> >>> > enable
> >>> > SMT? I looked through the se.py then look like you only need to use
> >>> > DerivO3CPU and just pass an array of the process in. However, I got
> >>> > this
> >>> > error
> >>> > `gem5.opt: build/X86/base/stats/group.cc:115: void
> >>> > Stats::Group::add

[gem5-users] Should I use FS or SE mode when measuring execution time?

2020-11-12 Thread Đức Anh via gem5-users
Dear gem5 team,

I want to use gem5 to simulate a program to measure its execution time. My
goal is to measure the execution time as close as possible to the real
value, and that program is running in a heterogeneous platform, where other
programs on other CPUs can affect the program execution time (memory, bus
contention,...). I found this StackOverflow answer (
https://stackoverflow.com/a/56371006/9868917) states that it depends on
whether the kernel interaction and system noise matter to us. So in
general, will FS or SE mode gives more accurate execution time? And how the
syscall emulated in SE mode compare to the real syscall in FS mode in term
of speed? I mean, does the syscall in SE always has a fixed speed and
usually faster than FS?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: How to simulate multithread, multicore and multiprocessor system ?

2020-11-12 Thread Đức Anh via gem5-users
Hi Hoa Nguyen,

A bit sad when some features I want will only be supported from 20.2
version (SMT, multicore DerivO3CPU). Do the gem5 team have any plan on when
the next version will be released?

About the stats error, I use the same version and cmd as the first email. I
will retype it here for convenience.
Cmd: `./build/X86/gem5.opt configs/tutorial/two_core.py`
gem5 version 20.1
gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
python 2.7.17

The error log:
gem5.opt: build/X86/base/stats/group.cc:115: void
Stats::Group::addStatGroup(const char*, Stats::Group*): Assertion
`statGroups.find(name) == statGroups.end()' failed.
Program aborted at tick 0
--- BEGIN LIBC BACKTRACE ---
./build/X86/gem5.opt(_Z15print_backtracev+0x2c)[0x5565d4f4958c]
./build/X86/gem5.opt(_Z12abortHandleri+0x4a)[0x5565d4f5c0aa]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7f51a53c58a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f51a39a1f47]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f51a39a38b1]
/lib/x86_64-linux-gnu/libc.so.6(+0x3042a)[0x7f51a399342a]
/lib/x86_64-linux-gnu/libc.so.6(+0x304a2)[0x7f51a39934a2]
./build/X86/gem5.opt(_ZN5Stats5Group12addStatGroupEPKcPS0_+0x16f)[0x5565d526a44f]
./build/X86/gem5.opt(_ZN5Stats5GroupC2EPS0_PKc+0xe8)[0x5565d526a908]
./build/X86/gem5.opt(_ZN11ThreadState16ThreadStateStatsC2EP7BaseCPUPS_+0x65)[0x5565d5335fc5]
./build/X86/gem5.opt(_ZN11ThreadStateC1EP7BaseCPUsP7Process+0x44)[0x5565d5336324]
./build/X86/gem5.opt(_ZN13O3ThreadStateI9O3CPUImplEC2EP9FullO3CPUIS0_EiP7Process+0x2f)[0x5565d515ed7f]
./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplEC1EP16DerivO3CPUParams+0x1a48)[0x5565d516d0d8]
./build/X86/gem5.opt(_ZN16DerivO3CPUParams6createEv+0x44)[0x5565d5137f94]
./build/X86/gem5.opt(+0xda6583)[0x5565d55bc583]
./build/X86/gem5.opt(+0x6ac8b9)[0x5565d4ec28b9]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyCFunction_FastCallDict+0x20a)[0x7f51a57e558a]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17bec8)[0x7f51a574dec8]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2be)[0x7f51a574e2be]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2be)[0x7f51a574e2be]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17a803)[0x7f51a574c803]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17c2aa)[0x7f51a574e2aa]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(_PyEval_EvalFrameDefault+0x4ec3)[0x7f51a5754303]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x17ba0f)[0x7f51a574da0f]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCodeEx+0x3e)[0x7f51a574e4ce]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(PyEval_EvalCode+0x1b)[0x7f51a574f24b]
/usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0(+0x18855d)[0x7f51a575a55d]
--- END LIBC BACKTRACE ---
Aborted (core dumped)

Best regards,
Duc Anh

Vào Th 4, 11 thg 11, 2020 vào lúc 23:32 Hoa Nguyen 
đã viết:

> Hi Duc Anh,
>
> I assume you want to enable SMT for X86. SMT for X86 has yet to be
> supported, but there is progress on this recently. You can keep track
> of the development via JIRA ticket
> (https://gem5.atlassian.net/browse/GEM5-332) and via this relation
> change (https://gem5-review.googlesource.com/c/public/gem5/+/35837).
>
> Regarding the stats error, can you be a little bit more specific about
> the version of gem5 that you're using and the command that you used?
> Are they the same as the ones in the first email
> (https://www.mail-archive.com/gem5-users@gem5.org/msg18678.html)?
>
> Regards,
> Hoa Nguyen
>
> On 11/10/20, Đức Anh via gem5-users  wrote:
> > Hi Ayaz,
> >
> > Thanks for the help. I guess if we don't share anything between the cores
> > then it will be the multi-processor platform, right? Btw, how to enable
> > SMT? I looked through the se.py then look like you only need to use
> > DerivO3CPU and just pass an array of the process in. However, I got this
> > error
> > `gem5.opt: build/X86/base/stats/group.cc:115: void
> > Stats::Group::addStatGroup(const char*, Stats::Group*): Assertion
> > `statGroups.find(name) == statGroups.end()' failed.`
> > What is the correct way to do this?
> >
> > Best regards,
> > Duc Anh
> >
> > Vào Th 3, 10 thg 11, 2020 vào lúc 00:01 Ayaz Akram <
> yazak...@ucdavis.edu>
> > đã viết:
> >
> >> Hi Duc,
> >>
> >> By passing  a list of CPUs to the system.cpu (as in the attached Python
> >> script), you are creating a multicore CPU (CPU here refers to a

[gem5-users] Re: How to simulate multithread, multicore and multiprocessor system ?

2020-11-10 Thread Đức Anh via gem5-users
Hi Ayaz,

Thanks for the help. I guess if we don't share anything between the cores
then it will be the multi-processor platform, right? Btw, how to enable
SMT? I looked through the se.py then look like you only need to use
DerivO3CPU and just pass an array of the process in. However, I got this
error
`gem5.opt: build/X86/base/stats/group.cc:115: void
Stats::Group::addStatGroup(const char*, Stats::Group*): Assertion
`statGroups.find(name) == statGroups.end()' failed.`
What is the correct way to do this?

Best regards,
Duc Anh

Vào Th 3, 10 thg 11, 2020 vào lúc 00:01 Ayaz Akram 
đã viết:

> Hi Duc,
>
> By passing  a list of CPUs to the system.cpu (as in the attached Python
> script), you are creating a multicore CPU (CPU here refers to a core).
> Secondly, if your CPU has SMT enabled, you should be able to pass multiple
> processes to the workload option.
>
> Btw, there is already a JIRA issue created for the problem you are running
> into: https://gem5.atlassian.net/browse/GEM5-803
>
> -Ayaz
>
> On Mon, Nov 9, 2020 at 2:18 AM Đức Anh via gem5-users 
> wrote:
>
>> Hello all,
>>
>> I am trying to create a system having multiple CPUs by passing a list of
>> CPU to the system.cpu. So far it works with TimingSimpleCPU, but for the
>> DerivO3CPU it crashes. I include the crash log, the python config file, and
>> the C workload file. I am using gem5 20.1, pulled from the stable
>> branch, gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04), python 2.7.17. The
>> command line I use is:
>> ./build/X86/gem5.opt configs/tutorial/two_core.py
>> The 2 binary files for 2 workloads are almost the same, I just change the
>> text in printf, and the number of loops.
>>
>> I also wonder that by passing a list of CPU to the system.cpu, am I
>> creating a system is 1 multicore CPU or a system with multiple separate
>> CPU? And how to pass multiple workloads on 1 CPU? I saw it accept a list,
>> but it throws an error if I pass a list with more than 1 workload.
>>
>> Best regards,
>> Duc Anh
>> ___
>> gem5-users mailing list -- gem5-users@gem5.org
>> To unsubscribe send an email to gem5-users-le...@gem5.org
>> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] Re: How to create a multicore system with different frequency for each core?

2020-11-10 Thread Đức Anh via gem5-users
Hi Srikant and Gabe,

Thank for the help, I was able to set different frequencies for different
CPUs. However, I notice that I still need to set the clock_domain for the
system through
```
system.clk_domain = SrcClockDomain()
system.clk_domain.clock = '1GHz'
system.clk_domain.voltage_domain = VoltageDomain()
```
Otherwise, this error will be thrown `AttributeError: Can't resolve proxy
'clk_domain' of type 'SrcClockDomain' from 'system.dvfs_handler`.
Additionally, when I change the frequency of the system.clk_domain or the
custom_clk_domain, the simulated tick is affected in both cases. So what
does the system.clk_domain frequency affect? and the custom_clk_domain set
for the CPU, does it affect anything besides the CPU itself?

Best regards,
Duc Anh

Vào Th 3, 10 thg 11, 2020 vào lúc 02:43 Bharadwaj, Srikant <
srikant.bharad...@amd.com> đã viết:

> As Gabe said, you will have to set the clk_domain of each CPU while
> creating them in the config scripts.
>
> You can create a new clock domain using the SrcClockDomain like this:
>
> custom_clk_domain = SrcClockDomain(clock = frequency_value, voltage_domain
> = VoltageDomain(voltage = voltage_value)))
>
>
>
> Once you create a clock domain, you can set the clk_domain for each CPU
> like this:
>
> cpu = CPUClass(clk_domain=custom_clk_domain)
>
> Here, CPU Class is whatever CPU you are using AtomicSimple, O3, etc.
>
>
>
> Setting different frequency values for the custom_clk_domain will do the
> job.
>
>
>
> Srikant
>
>
>
> *From:* Gabe Black via gem5-users 
> *Sent:* Monday, November 9, 2020 3:33 PM
> *To:* gem5 users mailing list 
> *Cc:* Đức Anh ; Gabe Black 
> *Subject:* [gem5-users] Re: How to create a multicore system with
> different frequency for each core?
>
>
>
> [CAUTION: External Email]
>
> If you want the frequency of the CPUs to change independently from each
> other, I think you need to set up a ClockDomain object for each, instead of
> letting them implicitly inherit the one from the System object.
>
>
>
> On Mon, Nov 9, 2020 at 2:26 AM Đức Anh via gem5-users 
> wrote:
>
> Hello all,
>
>
>
> I am looking for a way to create a system with multi CPU and they have
> different frequencies. As far as I see there is a system.clk_domain that
> acts as a global frequency, and it seems like all CPUs will follow this
> clock frequency. The clock domain does receive a list of frequencies
> though, but it is for DVFS (Dynamic voltage and frequency scaling). Is
> there a way to create or mimic a system where CPUs have different
> frequencies?
>
>
>
> Best regards,
>
> Duc Anh
>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
>
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] How to create a multicore system with different frequency for each core?

2020-11-09 Thread Đức Anh via gem5-users
Hello all,

I am looking for a way to create a system with multi CPU and they have
different frequencies. As far as I see there is a system.clk_domain that
acts as a global frequency, and it seems like all CPUs will follow this
clock frequency. The clock domain does receive a list of frequencies
though, but it is for DVFS (Dynamic voltage and frequency scaling). Is
there a way to create or mimic a system where CPUs have different
frequencies?

Best regards,
Duc Anh
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-users] How to simulate multithread, multicore and multiprocessor system ?

2020-11-09 Thread Đức Anh via gem5-users
Hello all,

I am trying to create a system having multiple CPUs by passing a list of
CPU to the system.cpu. So far it works with TimingSimpleCPU, but for the
DerivO3CPU it crashes. I include the crash log, the python config file, and
the C workload file. I am using gem5 20.1, pulled from the stable
branch, gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04), python 2.7.17. The
command line I use is:
./build/X86/gem5.opt configs/tutorial/two_core.py
The 2 binary files for 2 workloads are almost the same, I just change the
text in printf, and the number of loops.

I also wonder that by passing a list of CPU to the system.cpu, am I
creating a system is 1 multicore CPU or a system with multiple separate
CPU? And how to pass multiple workloads on 1 CPU? I saw it accept a list,
but it throws an error if I pass a list with more than 1 workload.

Best regards,
Duc Anh
gem5 Simulator System.  http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.

gem5 version 20.1.0.0
gem5 compiled Nov  5 2020 18:11:27
gem5 started Nov  9 2020 09:57:07
gem5 executing on Dauto98-ROG-Strix-G531GD, pid 10493
command line: ./build/X86/gem5.opt configs/tutorial/two_core.py

warn: l2bus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: l2bus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: interrupts.int_master is deprecated. `int_master` is now called 
`int_requestor`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: interrupts.int_slave is deprecated. `int_slave` is now called 
`int_responder`
warn: l2bus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: l2bus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: interrupts.int_master is deprecated. `int_master` is now called 
`int_requestor`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
warn: interrupts.int_slave is deprecated. `int_slave` is now called 
`int_responder`
warn: l2bus.master is deprecated. `master` is now called `mem_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
warn: membus.master is deprecated. `master` is now called `mem_side_ports`
Global frequency set at 1 ticks per second
warn: No dot file generated. Please install pydot to generate the dot file and 
pdf.
warn: DRAM device capacity (8192 Mbytes) does not match the address range 
assigned (512 Mbytes)
0: system.remote_gdb: listening for remote gdb on port 7000
0: system.remote_gdb: listening for remote gdb on port 7001
Beginning simulation
info: Entering event queue @ 0.  Starting simulation...
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall access(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
warn: ignoring syscall mprotect(...)
Looping goodbye, 0 time
Looping hello, 0 time
Looping hello, 1 time
Looping goodbye, 1 time
Looping hello, 2 time
Looping goodbye, 2 time
Looping hello, 3 time
Looping goodbye, 3 time
Looping hello, 4 time
Looping goodbye, 4 time
Looping hello, 5 time
Looping goodbye, 5 time
Looping hello, 6 time
Looping goodbye, 6 time
Looping hello, 7 time
Looping goodbye, 7 time
Looping goodbye, 8 time
Looping goodbye, 9 time
hello world
Goodbye world
gem5.opt: build/X86/cpu/o3/cpu.cc:823: void 
FullO3CPU::removeThread(ThreadID) [with Impl = O3CPUImpl; ThreadID = 
short int]: Assertion `commit.rob->isEmpty(tid)' failed.
Program aborted at tick 322773000
--- BEGIN LIBC BACKTRACE ---
./build/X86/gem5.opt(_Z15print_backtracev+0x2c)[0x55a6c77d158c]
./build/X86/gem5.opt(_Z12abortHandleri+0x4a)[0x55a6c77e40aa]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x128a0)[0x7f31e43db8a0]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f31e29b7f47]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f31e29b98b1]
/lib/x86_64-linux-gnu/libc.so.6(+0x3042a)[0x7f31e29a942a]
/lib/x86_64-linux-gnu/libc.so.6(+0x304a2)[0x7f31e29a94a2]
./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE12removeThreadEs+0x194)[0x55a6c79ef664]
./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE11haltContextEs+0x64)[0x55a6c79ef994]
./build/X86/gem5.opt(_ZN9FullO3CPUI9O3CPUImplE11exitThreadsEv+0x8d)[0x55a6c79f05ad]
./build/X86/gem5.opt(_ZN10EventQueue10serviceOneEv+0xa5)[0x55a6c77d9a65]