Hi Sam, there are a few ways you can do that.

1. You could set up a PC based event if you know what PC your behavior will
always be triggered from (see examples like skipping udelay for some
versions of the linux kernel).
2. You could create a new gem5 op by picking an unused number and a wrapper
stub in the header files I think you've found. Then in gem5 itself, you'd
add an implementation in src/sim/pseudo_inst.(hh|cc). The fairly trivial
"sum" gem5 op is probably a good example.
3. You could use the existing m5_workload gem5 op which basically just
pokes the workload object and tells it something interesting is happening.
The workload can then inspect state and look at registers, the PC, etc to
figure out what you want to happen. You can think of this sort of like a
system call but into the simulator. You'd need to create your own workload
class (which could be/would likely be based on an existing one) to
implement this back end logic. This is how I intend the system calls in SE
mode to be implemented one of these days.

Gabe

On Tue, Mar 16, 2021 at 4:55 AM Samuel Thomas via gem5-users <
gem5-users@gem5.org> wrote:

> Hello,
>
> I’m working on a project where I want to trigger a hardware procedure from
> software. I can see in the gem5/include/gem5/asm/generic/m5ops.h file,
> there is a certain amount of address space allocated for user customizable
> operations like this. Is there documentation as to how to use this address
> space and make a custom operation?
>
> Thank you for your help!
>
> Best,
> Sam
> _______________________________________________
> 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