[gem5-users] Re: How to use the new libm5.a

2020-11-02 Thread Ciro Santilli via gem5-users
BTW I pushed a patch exposing m5_exit_addr at: 
https://gem5-review.googlesource.com/c/public/gem5/+/36896

And after that this should work on KVM 
https://gem5-review.googlesource.com/c/public/gem5-resources/+/36677/1

From: Gabe Black via gem5-users 
Sent: Wednesday, October 28, 2020 10:48 PM
To: gem5 users mailing list 
Cc: Gabe Black 
Subject: [gem5-users] Re: How to use the new libm5.a

Hi Wenqi. You do still need to call map_m5_mem(), but as you found, now that 
there isn't one baked in call mechanism in the library you need to call the 
version of the function that will use the invocation mechanism you need. The 
header doesn't have declarations for them all, but if you declare your own with 
the same signature and an _addr suffix, you can call that and use the magic 
address based calling mechanism.

Gabe

On Wed, Oct 28, 2020 at 10:49 AM Wenqi Yin via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
Hi Hoa, Gabe,

Thanks for your help! But just want to confirm this: what I did in the past is 
calling map_m5_mem() in my code first and then call specific m5 functions, and 
it seems to work. The guest in running on KvmCPU.

When I am trying to do the same thing with the new libm5.a, it gave an 
exception (Illegal Instruction), however I haven’t looked into the error 
carefully yet, it may just because for some reason the lib is still trying to 
use the magic instruction interface. But before I proceed any further, just 
want to make sure I was using the correct approach to do this.

Best,
Wenqi

On Oct 26, 2020, at 23:30, Gabe Black via gem5-users 
mailto:gem5-users@gem5.org>> wrote:

Hi Wenqi. The updated libm5.a should be used in basically the same way as the 
old version. Just link against the library, include the header file, and call 
into the op you want using the normal function call syntax.

Hoa, the documentation you've linked to is a little out of date. How can it be 
updated?

Gabe

On Sun, Oct 25, 2020 at 9:31 PM Hoa Nguyen via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
Hi Wenqi,

We have some documentation about the new m5 utility here:
https://www.gem5.org/documentation/general_docs/m5ops/

The following link is an example of annotating PARSEC:
https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations

Regards,
Hoa Nguyen

On 10/25/20, wqyin--- via gem5-users 
mailto:gem5-users@gem5.org>> wrote:
> Hello all,
>
> I noticed the util/m5 has big changes since this
> commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
> wondering how should I use this new interface/implementation to call
> m5ops in my program? Shall I also instantiate a default CallType and
> then use it to obtain the dispatch table and finally pass it to
> Command::run? Also is there any examples which use the new
> implementation to annotate any benchmarks running inside gem5? Thanks
>
> Best,
>
> Wenqi
>
>
___
gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org>
To unsubscribe send an email to 
gem5-users-le...@gem5.org<mailto:gem5-users-le...@gem5.org>
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org>
To unsubscribe send an email to 
gem5-users-le...@gem5.org<mailto:gem5-users-le...@gem5.org>
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

___
gem5-users mailing list -- gem5-users@gem5.org<mailto:gem5-users@gem5.org>
To unsubscribe send an email to 
gem5-users-le...@gem5.org<mailto: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 use the new libm5.a

2020-10-28 Thread Gabe Black via gem5-users
Hi Wenqi. You do still need to call map_m5_mem(), but as you found, now
that there isn't one baked in call mechanism in the library you need to
call the version of the function that will use the invocation mechanism you
need. The header doesn't have declarations for them all, but if you declare
your own with the same signature and an _addr suffix, you can call that and
use the magic address based calling mechanism.

Gabe

On Wed, Oct 28, 2020 at 10:49 AM Wenqi Yin via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Hoa, Gabe,
>
> Thanks for your help! But just want to confirm this: what I did in the
> past is calling map_m5_mem() in my code first and then call specific m5
> functions, and it seems to work. The guest in running on KvmCPU.
>
> When I am trying to do the same thing with the new libm5.a, it gave an
> exception (Illegal Instruction), however I haven’t looked into the error
> carefully yet, it may just because for some reason the lib is still trying
> to use the magic instruction interface. But before I proceed any further,
> just want to make sure I was using the correct approach to do this.
>
> Best,
> Wenqi
>
> On Oct 26, 2020, at 23:30, Gabe Black via gem5-users 
> wrote:
>
> Hi Wenqi. The updated libm5.a should be used in basically the same way as
> the old version. Just link against the library, include the header file,
> and call into the op you want using the normal function call syntax.
>
> Hoa, the documentation you've linked to is a little out of date. How can
> it be updated?
>
> Gabe
>
> On Sun, Oct 25, 2020 at 9:31 PM Hoa Nguyen via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> Hi Wenqi,
>>
>> We have some documentation about the new m5 utility here:
>> https://www.gem5.org/documentation/general_docs/m5ops/
>>
>> The following link is an example of annotating PARSEC:
>> https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations
>>
>> Regards,
>> Hoa Nguyen
>>
>> On 10/25/20, wqyin--- via gem5-users  wrote:
>> > Hello all,
>> >
>> > I noticed the util/m5 has big changes since this
>> > commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
>> > wondering how should I use this new interface/implementation to call
>> > m5ops in my program? Shall I also instantiate a default CallType and
>> > then use it to obtain the dispatch table and finally pass it to
>> > Command::run? Also is there any examples which use the new
>> > implementation to annotate any benchmarks running inside gem5? Thanks
>> >
>> > Best,
>> >
>> > Wenqi
>> >
>> >
>> ___
>> 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 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 use the new libm5.a

2020-10-28 Thread Wenqi Yin via gem5-users
Hi Hoa, Gabe, 

Thanks for your help! But just want to confirm this: what I did in the past is 
calling map_m5_mem() in my code first and then call specific m5 functions, and 
it seems to work. The guest in running on KvmCPU. 

When I am trying to do the same thing with the new libm5.a, it gave an 
exception (Illegal Instruction), however I haven’t looked into the error 
carefully yet, it may just because for some reason the lib is still trying to 
use the magic instruction interface. But before I proceed any further, just 
want to make sure I was using the correct approach to do this. 

Best, 
Wenqi

> On Oct 26, 2020, at 23:30, Gabe Black via gem5-users  
> wrote:
> 
> Hi Wenqi. The updated libm5.a should be used in basically the same way as the 
> old version. Just link against the library, include the header file, and call 
> into the op you want using the normal function call syntax.
> 
> Hoa, the documentation you've linked to is a little out of date. How can it 
> be updated?
> 
> Gabe
> 
> On Sun, Oct 25, 2020 at 9:31 PM Hoa Nguyen via gem5-users 
> mailto:gem5-users@gem5.org>> wrote:
> Hi Wenqi,
> 
> We have some documentation about the new m5 utility here:
> https://www.gem5.org/documentation/general_docs/m5ops/ 
> 
> 
> The following link is an example of annotating PARSEC:
> https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations 
> 
> 
> Regards,
> Hoa Nguyen
> 
> On 10/25/20, wqyin--- via gem5-users  > wrote:
> > Hello all,
> >
> > I noticed the util/m5 has big changes since this
> > commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
> > wondering how should I use this new interface/implementation to call
> > m5ops in my program? Shall I also instantiate a default CallType and
> > then use it to obtain the dispatch table and finally pass it to
> > Command::run? Also is there any examples which use the new
> > implementation to annotate any benchmarks running inside gem5? Thanks
> >
> > Best,
> >
> > Wenqi
> >
> >
> ___
> 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] Re: How to use the new libm5.a

2020-10-28 Thread Wenqi Yin via gem5-users
Hi Ciro, 

I don’t think things changed and your method should still work. However, my use 
case is a bit different as I need to call m5 ops when my guest is running on 
KVM cpu. My understanding is in virtual environment the magic Inst won’t work 
(I tested and it gave me Illegal Instruction exception) and I need to use the 
memory map interface, not sure if I understood correctly. But thanks for the 
suggestion, your way is definitely easier when it’s not in kvm. 

Best, 
Wenqi

> On Oct 27, 2020, at 07:34, Ciro Santilli via gem5-users  
> wrote:
> 
> Hi Wenqi,
> 
> Have you tried: 
> https://stackoverflow.com/questions/62757008/how-to-use-m5-in-gem5-20/62759204#62759204
>  
> 
>  or has something changed since then too? Seems to work on develop just now.
> From: wqyin--- via gem5-users 
> Sent: Sunday, October 25, 2020 7:36 PM
> To: gem5-users@gem5.org 
> Cc: wq...@utexas.edu 
> Subject: [gem5-users] How to use the new libm5.a
>  
> Hello all, 
> I noticed the util/m5 has big changes since this commit: 
> 26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am wondering how 
> should I use this new interface/implementation to call m5ops in my program? 
> Shall I also instantiate a default CallType and then use it to obtain the 
> dispatch table and finally pass it to Command::run? Also is there any 
> examples which use the new implementation to annotate any benchmarks running 
> inside gem5? Thanks
> Best,
> Wenqi
> ___
> 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 use the new libm5.a

2020-10-27 Thread Hoa Nguyen via gem5-users
Hi Gabe,

The public/gem5-website repo is the place to update the documentation.

The README file
(https://gem5.googlesource.com/public/gem5-website/+/refs/heads/stable/README.md)
should contain needed information to run a local instance of the
website as well as the procedure of updating the repo.

The file that generates the m5ops documentation page is
https://gem5.googlesource.com/public/gem5-website/+/refs/heads/stable/_pages/documentation/general_docs/m5ops.md

Making changes on public/gem5-website should be very similar to making
changes on public/gem5. However, this change should happen on the
stable branch of gem5-website as the documentation should be
compatible with gem5's stable branch.

We appreciate all the help with the documentation!

Regards,
Hoa Nguyen

On 10/26/20, Gabe Black via gem5-users  wrote:
> Hi Wenqi. The updated libm5.a should be used in basically the same way as
> the old version. Just link against the library, include the header file,
> and call into the op you want using the normal function call syntax.
>
> Hoa, the documentation you've linked to is a little out of date. How can it
> be updated?
>
> Gabe
>
> On Sun, Oct 25, 2020 at 9:31 PM Hoa Nguyen via gem5-users <
> gem5-users@gem5.org> wrote:
>
>> Hi Wenqi,
>>
>> We have some documentation about the new m5 utility here:
>> https://www.gem5.org/documentation/general_docs/m5ops/
>>
>> The following link is an example of annotating PARSEC:
>> https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations
>>
>> Regards,
>> Hoa Nguyen
>>
>> On 10/25/20, wqyin--- via gem5-users  wrote:
>> > Hello all,
>> >
>> > I noticed the util/m5 has big changes since this
>> > commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
>> > wondering how should I use this new interface/implementation to call
>> > m5ops in my program? Shall I also instantiate a default CallType and
>> > then use it to obtain the dispatch table and finally pass it to
>> > Command::run? Also is there any examples which use the new
>> > implementation to annotate any benchmarks running inside gem5? Thanks
>> >
>> > Best,
>> >
>> > Wenqi
>> >
>> >
>> ___
>> 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 use the new libm5.a

2020-10-27 Thread Ciro Santilli via gem5-users
Hi Wenqi,

Have you tried: 
https://stackoverflow.com/questions/62757008/how-to-use-m5-in-gem5-20/62759204#62759204
 or has something changed since then too? Seems to work on develop just now.

From: wqyin--- via gem5-users 
Sent: Sunday, October 25, 2020 7:36 PM
To: gem5-users@gem5.org 
Cc: wq...@utexas.edu 
Subject: [gem5-users] How to use the new libm5.a


Hello all,

I noticed the util/m5 has big changes since this commit: 
26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am wondering how 
should I use this new interface/implementation to call m5ops in my program? 
Shall I also instantiate a default CallType and then use it to obtain the 
dispatch table and finally pass it to Command::run? Also is there any examples 
which use the new implementation to annotate any benchmarks running inside 
gem5? Thanks

Best,

Wenqi
___
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 use the new libm5.a

2020-10-26 Thread Gabe Black via gem5-users
Hi Wenqi. The updated libm5.a should be used in basically the same way as
the old version. Just link against the library, include the header file,
and call into the op you want using the normal function call syntax.

Hoa, the documentation you've linked to is a little out of date. How can it
be updated?

Gabe

On Sun, Oct 25, 2020 at 9:31 PM Hoa Nguyen via gem5-users <
gem5-users@gem5.org> wrote:

> Hi Wenqi,
>
> We have some documentation about the new m5 utility here:
> https://www.gem5.org/documentation/general_docs/m5ops/
>
> The following link is an example of annotating PARSEC:
> https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations
>
> Regards,
> Hoa Nguyen
>
> On 10/25/20, wqyin--- via gem5-users  wrote:
> > Hello all,
> >
> > I noticed the util/m5 has big changes since this
> > commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
> > wondering how should I use this new interface/implementation to call
> > m5ops in my program? Shall I also instantiate a default CallType and
> > then use it to obtain the dispatch table and finally pass it to
> > Command::run? Also is there any examples which use the new
> > implementation to annotate any benchmarks running inside gem5? Thanks
> >
> > Best,
> >
> > Wenqi
> >
> >
> ___
> 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 use the new libm5.a

2020-10-25 Thread Hoa Nguyen via gem5-users
Hi Wenqi,

We have some documentation about the new m5 utility here:
https://www.gem5.org/documentation/general_docs/m5ops/

The following link is an example of annotating PARSEC:
https://github.com/darchr/parsec-benchmark/commits/gem5-20-annotations

Regards,
Hoa Nguyen

On 10/25/20, wqyin--- via gem5-users  wrote:
> Hello all,
>
> I noticed the util/m5 has big changes since this
> commit:26454e8072e607d54ac67c42b33355d7c94d6d60 around Apr 27. I am
> wondering how should I use this new interface/implementation to call
> m5ops in my program? Shall I also instantiate a default CallType and
> then use it to obtain the dispatch table and finally pass it to
> Command::run? Also is there any examples which use the new
> implementation to annotate any benchmarks running inside gem5? Thanks
>
> Best,
>
> Wenqi
>
>
___
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