[gem5-users] Re: Memory allocation when using heterogeneous memory controllers

2023-08-21 Thread Jason Lowe-Power via gem5-users
Hi Jaeyong,

No, there's no way to distinguish the memory types in SE mode. You will
have to modify the memory allocator or use `Process.map` (
https://github.com/gem5/gem5/blob/develop/src/sim/Process.py#L39) to map
specific virtual addresses to physical addresses. If you use `map` you can
then use `mmap` in your guest application to map specific virtual addresses.

In FS mode, you would have to somehow declare different NUMA nodes for the
different memory types (e.g., via the device tree). Then, you could use
`numactrl` or `libnuma` to allocate in specific NUMA nodes.

Cheers,
Jason

On Sun, Aug 20, 2023 at 11:12 PM 이재용 via gem5-users 
wrote:

> As far as I know, gem5 supports heterogeneous memory controllers
> (src/mem/hetero_mem_ctrl.cc), which can have both DRAM and NVM devices
> attached to them.
>
> Let's say I allocate 0-512-MiB of physical addresses for DRAM and
> 512-MiB-1024-MiB for NVM.
>
> Is there a way to distinguish between DRAM and NVM regions when running a
> program in SE-Mode?
> For example, I want to keep my program code and stack in DRAM and dynamic
> memory (allocated via malloc) in NVM. Do I need to modify gem5's memory
> allocator to do this?
>
>
>
> Best,
> Jaeyong Lee
>
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
>
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Memory allocation when using heterogeneous memory controllers

2023-08-21 Thread 이재용 via gem5-users
As far as I know, gem5 supports heterogeneous memory controllers
(src/mem/hetero_mem_ctrl.cc), which can have both DRAM and NVM devices
attached to them.

Let's say I allocate 0-512-MiB of physical addresses for DRAM and
512-MiB-1024-MiB for NVM.

Is there a way to distinguish between DRAM and NVM regions when running a
program in SE-Mode?
For example, I want to keep my program code and stack in DRAM and dynamic
memory (allocated via malloc) in NVM. Do I need to modify gem5's memory
allocator to do this?



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