Skip to content

Using pseudo instructions to invoke a method of a simobject #1348

Answered by robhau
kaplannp asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @kaplannp,

I would propose you another design to to achieve your desired behavior.

Usually, you can configure peripherals (I assume that your SimObject is a peripheral) by writing to memory mapped registers. They are also used to trigger specific tasks. So I suggest that you implement register(s) in your SimObject that corresponds to your task(s). When write, for example, a 1 to a task register, you then call your member function.

Gem5 already offers you register banks that you can use to implement registers (see src/dev/reg_bank.hh). Take a look in SimObjects where they are used to learn how they work. For example, they are part of Plic and Clint (src/dev/riscv/*)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kaplannp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants