[gem5-users] Re: BasicPioDevice read() / write() not responding
Hello everyone, I'm hitting the exact same problem on ARM as Andreas. I have a physical address mapped into the virtual address space and marked it as uncacheable. When I now write to the virtual address from my SE-program (multiple times), exactly one read access is made to the corresponding physical address. It seems like the uncacheable flag is ignored and the Cache just handles the miss and sends a read request. Best Derek ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org
[gem5-users] Re: Writing a script to run multiple simulations at once
Hi Jason, it seems like this is exactly what I was looking for. Awesome to hear that things will get more user friendly in next versions. Best Derek Am 14.06.23 um 20:05 schrieb Jason Lowe-Power via gem5-users: Hi all, You can use python multiprocessing with gem5. See https://github.com/gem5/gem5/tree/develop/src/python/gem5/utils/multiprocessing for details. So, in theory, you can create scripts such that you can run `./gem5 run.py` which will run a set of different experiments. You could potentially even send a subset of stats back to the main `run.py` script for post-processing, though I haven't tested that, yet. We are planning to add extensions to the simulator module to make this more user friendly in gem5 23.1 (the release after gem5 23.0). Cheers, Jason On Wed, Jun 14, 2023 at 11:01 AM Eliot Moss via gem5-users wrote: On 6/14/2023 11:30 AM, Derek Christ wrote: > Hello Eliot Moss, [one ell please] > a shared Python file with parameter settings sounds useful. > What I meant with running gem5 without the gem5 executable was to use the > compiled library directly from the Python configuration script. > From what I have seen, the gem5 executable sets up some internal state and > then directly calls the embedded Python interpreter to launch the > user-provided script. > But as I see it there is no technical reason why it shouldn't be possible to > call this setup routine directly from Python. This would reduce the > complexity to only one single Python script. Well, there may remain value to having a standard setup/run script that invokes a user supplied script. It helps keep gem5 per se separate from the user's setup / configuration - a principle of modularity. A quick look at main.cc suggests you may be right that this *could* be done, though I have no idea what those various setup functions do and whether any of that would be hard to do from python. What I suppose I am missing is the motivation - why such a change would be substantially better. My applications tend to be quite complex and I find I need the layers of script, for various reasons. Maybe this has more to do with preference to write in python vs bash scripts vs C++ code. gem5 is not currently packaged as a library, I don't think, though I suppose it could be. Given the amount of existing projects and infrastructure, one would need to continue to support the current way of doing things as well. This might further complicate the system and its maintenance - one hopes by not very much. HTH - EM ___ 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 togem5-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] Re: Writing a script to run multiple simulations at once
Hello Elliot Moss, a shared Python file with parameter settings sounds useful. What I meant with running gem5 without the gem5 executable was to use the compiled library directly from the Python configuration script. From what I have seen, the gem5 executable sets up some internal state and then directly calls the embedded Python interpreter to launch the user-provided script. But as I see it there is no technical reason why it shouldn't be possible to call this setup routine directly from Python. This would reduce the complexity to only one single Python script. Best Derek Am 14.06.23 um 14:38 schrieb Eliot Moss via gem5-users: On 6/14/2023 2:32 AM, Derek Christ via gem5-users wrote: Hello, maybe I have missed something in the official docs, but I'm not sure how to run multiple simulations with different parameters concurrently to speed up the process. What I have done is I created a Python script that sets environment variables and then kicks-off gem5 which in turn runs another Python script that reads those environment variables to configure the simulation. But I'm sure there has to be a better way? I think it might be easier if it would be possible to run gem5 purely with Python (without the gem5 executable) because then it would be easy to pass custom parameters to the gem5 configuration. Is there something that I missed? Thanks Best Derek I use scripts that setup environment variables, command line parameters, and a python file with python parameter settings. The latter is placed in a directory unique to the run. It happens that my scripts are shell scripts, but with varying degrees of pain, other scripting languages, or even hard coding in C or something, would work. I just use what I am skilled with. You *must* have the gem4 executable, however. The bulk of the simulation is run with that (optimizing compiled) C++ code. It implements the actual modules as well as the event driven simulation part. Python is used mostly for configuring the simulation before the event loop is kicked off. If the simulator were written entirely in python it would be much slower. HTH - Eliot Moss ___ 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] Re: Writing a script to run multiple simulations at once
Hi Ayaz, thanks for your quick response. Yeah, argparse is one possibility. But it is cumbersome and bugprone to implement a new option for every single configuration parameter I want to vary. Also, I would need a way not only to parse the options, but also to generate the gem5 command with the parameters on-the-fly. As far as I know, argparse does not provide this functionality. So another option that I thought of is to serialize my custom configuration class, pass it to gem5, and deserialize it again in the gem5 configuration script. Best Derek Am 14.06.23 um 09:21 schrieb Ayaz Akram via gem5-users: Hi Derek, I am not sure if I have understood your question correctly, but the gem5 interface is basically a Python run script in which you can add parameters as well (that can be set from the command line or in shell scripts). For example, you can look at the following link to see how `argparse` is used for this purpose: https://www.gem5.org/documentation/learning_gem5/part1/cache_config/ -Ayaz On Tue, Jun 13, 2023 at 11:32 PM Derek Christ via gem5-users wrote: Hello, maybe I have missed something in the official docs, but I'm not sure how to run multiple simulations with different parameters concurrently to speed up the process. What I have done is I created a Python script that sets environment variables and then kicks-off gem5 which in turn runs another Python script that reads those environment variables to configure the simulation. But I'm sure there has to be a better way? I think it might be easier if it would be possible to run gem5 purely with Python (without the gem5 executable) because then it would be easy to pass custom parameters to the gem5 configuration. Is there something that I missed? Thanks Best Derek ___ 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 togem5-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] Writing a script to run multiple simulations at once
Hello, maybe I have missed something in the official docs, but I'm not sure how to run multiple simulations with different parameters concurrently to speed up the process. What I have done is I created a Python script that sets environment variables and then kicks-off gem5 which in turn runs another Python script that reads those environment variables to configure the simulation. But I'm sure there has to be a better way? I think it might be easier if it would be possible to run gem5 purely with Python (without the gem5 executable) because then it would be easy to pass custom parameters to the gem5 configuration. Is there something that I missed? Thanks Best Derek ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org
[gem5-users] Re: Python 3.11 on stable release
Hi Congwu, with these two commits, it now works! Thank you both! Best Derek Am 16.05.23 um 16:58 schrieb zhangcongwu via gem5-users: Hi Derek, I have built it successfully with cherry-pick another two commits https://gem5-review.googlesource.com/c/public/gem5/+/68818?usp=search and https://gem5-review.googlesource.com/c/public/gem5/+/68817. You can try these two commits. Best Congwu On May 16, 2023, at 22:25, Derek Christ via gem5-users wrote: Hi Richard, thanks for your answer! With the patch cherry-picked, it starts to compile now. Unfortunately, it still fails at a later point in time: [SO Param] m5.objects.BaseMMU, BaseMMU-> X86/params/BaseMMU.hh terminate called after throwing an instance of 'pybind11::error_already_set' what(): AttributeError: module 'inspect' has no attribute 'getargspec' At: build/X86/python/m5/SimObject.py(478): decorate build/X86/python/m5/SimObject.py(515): cxxMethod build/X86/python/m5/SimObject.py(634): SimObject build/X86/python/m5/SimObject.py(611): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load build/X86/arch/generic/BaseInterrupts.py(27): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load (1): build/X86/python/m5/objects/__init__.py(29): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load (1206): _gcd_import (241): _call_with_frames_removed (1128): _find_and_load_unlocked (1178): _find_and_load (1206): _gcd_import /usr/lib/python3.11/importlib/__init__.py(126): import_module build_tools/sim_object_param_struct_hh.py(58): /tmp/tmpvc7mcwi_: line 1: 27766 Aborted (core dumped) "build/X86/gem5py_m5" "build_tools/sim_object_param_struct_hh.py" "m5.objects.BaseMMU" "build/X86/params/BaseMMU.hh" scons: *** [build/X86/params/BaseMMU.hh] Error 134 scons: building terminated because of errors. I think there might be another patch I would have to apply? Best Derek ___ 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 togem5-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] Re: Python 3.11 on stable release
Hi Richard, thanks for your answer! With the patch cherry-picked, it starts to compile now. Unfortunately, it still fails at a later point in time: [SO Param] m5.objects.BaseMMU, BaseMMU-> X86/params/BaseMMU.hh terminate called after throwing an instance of 'pybind11::error_already_set' what(): AttributeError: module 'inspect' has no attribute 'getargspec' At: build/X86/python/m5/SimObject.py(478): decorate build/X86/python/m5/SimObject.py(515): cxxMethod build/X86/python/m5/SimObject.py(634): SimObject build/X86/python/m5/SimObject.py(611): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load build/X86/arch/generic/BaseInterrupts.py(27): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load (1): build/X86/python/m5/objects/__init__.py(29): (40): exec_module (705): _load_unlocked (1152): _find_and_load_unlocked (1178): _find_and_load (1206): _gcd_import (241): _call_with_frames_removed (1128): _find_and_load_unlocked (1178): _find_and_load (1206): _gcd_import /usr/lib/python3.11/importlib/__init__.py(126): import_module build_tools/sim_object_param_struct_hh.py(58): /tmp/tmpvc7mcwi_: line 1: 27766 Aborted (core dumped) "build/X86/gem5py_m5" "build_tools/sim_object_param_struct_hh.py" "m5.objects.BaseMMU" "build/X86/params/BaseMMU.hh" scons: *** [build/X86/params/BaseMMU.hh] Error 134 scons: building terminated because of errors. I think there might be another patch I would have to apply? Best Derek ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org
[gem5-users] Python 3.11 on stable release
Hello, currently I have trouble building the most recent stable release of gem5 on Arch Linux since they switched from Python 3.10 to Python 3.11. When simply building gem5, it errors out at the configuration stage of scons: Checking Python version... no Error: Can't find a working Python installation I figured by simply upgrading the pybind11 dependency in the ext/ directory manually fixes this error. However, now the configuration fails at a later point in time: Checking for pkg-config package grpc++... (cached) yes ERROR:fm_proj_ply:/home/derek/Git/gem5/build/X86/arch/arm/fastmodel/SConscript:220: Invalid regular expression for rule 't_STRLIT'. global flag s not at the start of the expression at position 13 SyntaxError: Can't build lexer I did not found a way to fix this yet. Also, creating a virtual environment with Python 3.10 did not work for me: The first error is fixed even with the old pybind version, but the second error still occurs. Is there an easy fix for this? Thanks! Best Derek ___ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org