When a pseudo instruction executes, it has access to all the state of the
current thread. You should ensure that the address of the variable you want is
in one of the registers by either putting the pseudo instruction in a function
and leveraging the ABI, which is how I believe the existing instructions are
accessed, or using some inline assembler. Then when the instruction is
executed, gather up the registers that have important values and pass those to
your functions in the CPU. If you're using SE and the variables are at fixed
locations, you could also look them up in the symbol table.

Gabe

Quoting Giang Hoang <[EMAIL PROTECTED]>:

> Hi everyone,
>
> I have implemented a few extra M5 pseudo instructions to insert in the
> application code and call some special functions in the CPU.  Now I would
> like to obtain the address of some variables in the application code, then
> pass them to the CPU.  Could you tell me how to do that?  I think these
> addresses are not available until runtime, so the compiler will complain if
> I try to encode those addresses in the pseudo instructions.
>
> Thank you,
>
> Giang
>




_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to