Hi Shehab,

Jason is right. I have implemented a similar mechanism
as the one you described. The mechanism has two aspects.
You need to leverage a hardware component which will always
have a unique value for the specific thread. I will call this
value from now on "HWthreadID". As far as I know for the:

ALPHA architecture the register called "HWthreadID" = IPR_PALtemp23
as a unique value for each different thread.

X86 The register "HWthreadID" = MISCREG_FS_BASE is unique for
each software thread ( I am not 100% sure )

ARM also had a a similar register. Cannot remember which one.
You need to search for thread local storage (TLS) and you might
find specific information.

The second step actually needs you to implement an m5_FUNC that
associates the "HWthreadID" with the software thread id. And at
runtime you can diffentiate which thread is executed by reading
the HWthreadid.

Cheers,
Konstantinos Parasyris.

Quoting Jason Lowe-Power <ja...@lowepower.com>:

Hi Shehab,

If you're using FS mode, the question you need to ask yourself is "How
would hardware be able to determine the logical thread id?" As far as I
know, there are not magic instructions, etc. implemented in gem5 to get the
logical thread ID. You may be able to leverage the ASID that is passed to
the TLB and/or the page table pointer. It depends on the ISA you're using,
though.

Cheers,
Jason

On Thu, Jan 10, 2019 at 8:53 AM Shehab Elsayed <shehaby...@gmail.com> wrote:

Hello All,

I was wondering if there is a way to differentiate between different
logical (software) threads in gem5. I am trying to collect some stats for
each logical thread and so far all I could find in gem5 is access to
physical threads. I know that logical threads is the responsibility of the
OS but is there anyway for gem5 to access the logical thread ID.

One option is to pin threads to cores but this only works if the number of
cores is at least equal to the number of logical threads. However, I will
need to run some experiments where the number of logical threads exceed the
number of cores, in which case, multiple logical threads will be assigned
to the same core and in order to differentiate between them I need the
logical thread ID.

Thank you very much in advance.

Best Regards,
Shehab
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users



_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to