[gem5-users] More system calls support in SE mode

2022-03-28 Thread Preet Derasari via gem5-users
Hi!

I was wondering if there was a way to implement more syscalls for the X86
ISA. I am talking about modifying the *arch/x86/linux/syscall_tbl64.cc *to
include functions for unimplemented syscalls like fork, kill, etc. or for
ignored syscalls like access.

I know that the emulation functions are defined in src/sim/
syscall_desc.cc/hh. Is there a template to implement these syscalls or an
easier way to just hand them over to the host system?

Thank you. Regards,
___
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: Problem with SimObject

2022-03-28 Thread Jason Lowe-Power via gem5-users
Hi Artyom,

You're absolutely right that the tutorial needs to be updated! The
website is also open source and managed via a git repo:
https://gem5.googlesource.com/public/gem5-website/. Updating this would be
a good way to get started contributing to gem5 :).

By the way, for the namespace, you can also wrap the file in the following
so you don't have to explicitly use namespaces everywhere:

```
namespace gem5
{

}
```

Cheers,
Jason

On Sat, Mar 26, 2022 at 10:57 PM Artyom Liu via gem5-users <
gem5-users@gem5.org> wrote:

> Hi,
>
> The problem is solved by literally adding a new parameter `sim_objects`.
>
>  > SimObject("HelloObject.py", sim_objects = ["HelloObject"])
>
> But I find yet another problem with the tutorial: the code that use
> classes from gem5 is missing namespace declaration. For example, the
> class `SimObject` is under namespace `gem5`, but the tutorial is using
> it directly. It makes the compiler unable to find the class.
>
> ```
> #ifndef __LEARNING_GEM5_HELLO_OBJECT_HH__
> #define __LEARNING_GEM5_HELLO_OBJECT_HH__
>
> #include "params/HelloObject.hh"
> #include "sim/sim_object.hh"
>
> class HelloObject : public SimObject
> {
>public:
>  HelloObject(const HelloObjectParams );
> };
>
> #endif // __LEARNING_GEM5_HELLO_OBJECT_HH__
> ```
>
> For the compiler to work, we should use `gem5::SimObject` instead. And
> `gem5::HelloObjectParams` for the same reason.
>
> None of the problems are mentioned in the tutorial. I wonder if it is
> necessary to *update* the tutorial?
>
> Artyom
> artyom...@hust.edu.cn
>
> On 3/27/22 10:05, Artyom Liu wrote:
> > Hi,
> >
> > I'm new to gem5 and just start learning by following the tutorial on
> > gem5.org. However, there's a problem when I try to create my custom
> > object[1].
> >
> > [1]: https://www.gem5.org/documentation/learning_gem5/part2/helloobject/
> >
> > I follow exactly the guide, but I fail to re-compile with scons. The
> > error message as below.
> >
> >  > Error: SimObject(HelloObject.py...) must list c++ sim_objects or
> > enums > (set either to [] if there are none).
> >
> > My gem5 version is Version 21.2.1.0, and I noticed that there's an *API
> > change* about SimObject declaration in Version 21.2.0.0, requiring that
> > sim_object parameter of SimObject declaration "should list all SimObject
> > classes which have a type attribute defined".
> >
> > It matches the error message. So I wonder how could I change my
> > SConscript to fit this change? My current SConscript is from the
> tutorial.
> >
> > ```
> > Import("*")
> >
> > SimObject("HelloObject.py")
> > Source("hello_object.py")
> > ```
> >
> > Artyom
> > artyom...@hust.edu.cn
> ___
> 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] Feeding Traces to Gem5

2022-03-28 Thread Prasun Ghosh via gem5-users
Hello Gem5 Community,
   I am a current senior at Reed
College and I am using gem5 for my senior year thesis. I am implementing a
writeback aware caching algorithm as described in this paper
https://www.pdl.cmu.edu/PDL-FTP/Storage/2020.apocs.writeback.pdf .  Right
now, I have the algorithm implemented inside gem5 and I am trying to figure
out how to feed traces to gem5. More specifically, I am trying to see how
the algorithm fares across different ratios of reads to writes. Is there a
way to provide traces to the gem5 simulator other than providing
executables/binaries. I can create dummy programs with varying levels of
reads to writes but I was wondering if there is a better way of testing
this. Thank you for your time and have a great rest of your day.
Best,
Prasun
___
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