Hi Jason,

> -----Original Message-----
> From: jzell001--- via gem5-users <[email protected]>
> Sent: 14 May 2021 00:44
> To: [email protected]
> Cc: [email protected]
> Subject: [gem5-users] Tracing Instructions in gem5 (re: Adding a New
> Instruction)
>
> Hi Everyone,
>
> I am fairly new to gem5, so I apologize if this has already been addressed, 
> but
> I haven't been able to find a solution yet.

Do not worry, every question is welcome here 😊

>
> I am trying to add a new type of store instruction to gem5 similar to the STG
> instruction from ARM's MTE instructions.
>
> I was wondering if there was a debug flag or an approach using GDB to
> determine what files are used when processing an instruction in gem5.

Do you want to record *every* uprocessor activity on a specific instruction 
(the one you are implementing)?
For example, tracing the lifetime of the instruction within the pipeline.
If that is the case, there's no such thing at the moment in gem5. This is 
because we trace from a uprocessor perspective rather than from an instruction
point of view.

For example, I can turn on/off instruction fetch tracing or decode tracing or 
rename tracing, but this will be done for every instruction
and I cannot easily filter it for a specific instruction only.

You are asking about files and classes. This confuses me a bit. If you just 
want to know which files are used I can tell you most files in the used cpu 
model
subdirectory (e.g. src/cpu/o3) will deal with instruction processing as that's 
the main activity of a uprocessor pipeline.

>
> I am aware of some of the general files that need to be edited, such as:
>
>    src/arch/arm/isa/formats/aarch64.isa
>    src/arch/arm/isa/templates/mem64.isa
>    src/arch/arm/isa/insts/str64.isa
>
> But I would like to be able to see all of these files/functions/classes as 
> they
> are used/touched as an instruction is processed through gem5. For instance,
> seeing what things are accessed when a STR instruction that already is
> implemented in gem5 is being processed.

I have the impression you are merging two different problems in one (correct me 
if I am wrong):
1)  Understanding how the simulator works (this is why you want to trace the 
used classes and files)
2)  Effectively tracing your instruction handling during your workload execution

I believe you should achieve 1 by actually understanding the code plus getting 
an idea on what you really want to trace
about an instruction. Do you really want to trace everything? Maybe you are 
just interested about tracing the architectural results of your store. If 
that's the case no need
to check the cpu subdirectory.
Once you know what you want to trace during your workload execution and where 
the code resides in the repo you can pass to point 2 and effectively add your 
DPRINTFs
to the code.

>
> Any help or advice would be greatly appreciated. Thank you for your time!
>
>
> Respectfully,
>
> Jason Z.
> _______________________________________________
> gem5-users mailing list -- [email protected] To unsubscribe send an
> email to gem5-users-
> [email protected] %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


Hope this helped

Kind Regards

Giacomo
IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to