Hi Yuan,

A couple of suggestions:
1. You can use "--debug-file" to output to a file. Or, you can even use a
named pipe with grep to filter out only the instructions you care about.
You can also use "--debug-start" to delay debug printing until close to
where the problem occurs.
2. You can use GDB to try to debug things. You can use "--debug-break" to
have a breakpoint happen at a precise tick. In GDB, you can print out
things like the register file values. You should be able to use the thread
context and/or the execution context to get the values of registers in GDB.
These are the interfaces from the CPU models to the outside world and the
ISA implementation, respectively. However, if you're using an out-of-order
model, it's not always obvious or easy to figure out what the architectural
state of some register is.

Cheers,
Jason

On Tue, Jul 7, 2020 at 2:23 PM Shougang Yuan <syu...@ncsu.edu> wrote:

> Hi, Prof.Jason,
>
> Thanks for your reply. But actually I want to dump out the register value
> for some specific instructions because I suspect that the instruction
> execution may have some issues in my model. I tried to use Exec and
> ExecAll, but the trace is so large and a lot of these traces are not needed
> for me. I want to dump out the register values of the instructions I am
> interested in. i.e, if I have an add instruction, how can I dump out the
> source register value and dst register value of this instruction when it is
> executed or when it is in the commit stage. I tried to check the static or
> dynamic instruction classes, but seems that these values are not
> carried/stored with each instruction? Am I correct? Could you please give
> more hints?
>
> Best regards.
> Yuan
>
> On Thu, Jul 2, 2020 at 11:07 AM Jason Lowe-Power <ja...@lowepower.com>
> wrote:
>
>> Hi Yuan,
>>
>> You might find the Exec and ExecAll debug flags useful.
>>
>> Cheers,
>> Jason
>>
>> On Thu, Jul 2, 2020 at 7:48 AM Shougang Yuan via gem5-users <
>> gem5-users@gem5.org> wrote:
>>
>>> Hi, All,
>>>
>>> I am trying to modify the gem5 code and suffer some memory corruption
>>> bugs. I want to look at more details of each instruction. So is there a way
>>> to dump out the register value of each instruction.
>>>
>>> Best regards.
>>> Yuan
>>> _______________________________________________
>>> 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

Reply via email to