Ah I see. Thanks!

On Fri, Feb 3, 2012 at 10:33 PM, Gabriel Michael Black <
[email protected]> wrote:

> The other confusing thing is I can't figure out if the code block {{ Mem =
>>>> Rb.uq + Rc.uq }} actually has any effect if I never substitute it (i.e.
>>>> I
>>>> never actually write %(code)s in any of my templates). It appears that
>>>> it
>>>> still sets the IsMemRef and the IsStore flags in the decoder
>>>> constructor,
>>>> but other than that it doesn't have any other effect. Is this the
>>>> correct
>>>> interpretation?
>>>>
>>>>
>>> That sounds plausible. It's a little unusual not to use %(code)s in your
>>> templates.
>>>
>>>
>> I know that sounds a little silly, but let me try to explain what I'm
>> after.
>>
>> I want my new instruction to go through the memory stage of the pipeline
>> because it will be modifying memory, but all of the operands are addresses
>> in registers. This means that when I express my actual code block, there's
>> not a memory operand involved, so I don't get the IsMemRef flag set. So I
>> was playing around and I found a hack where if I pass two code blocks, I
>> can have the parser mark the code as a memory read (and set IsMemRef) by
>> passing in a code block that references memory but is unused. The other
>> code block is what calls the actual function in the CPU, but only contains
>> register operands that contain addresses. Is there a way I can force the
>> parser to treat my instruction as a memory read without using such a hack?
>>
>>
> You don't actually have to use the operands to set those flags. The type
> of operand you're instruction uses is generally a really good way to
> classify what flags should be set, but you can explicitly add whatever
> additional flags you want. To pick an arbitrary example:
>
> http://repo.gem5.org/gem5/**file/223945df5510/src/arch/**
> alpha/isa/int.isa#l100<http://repo.gem5.org/gem5/file/223945df5510/src/arch/alpha/isa/int.isa#l100>
>
> The way Alpha is written, you can frequently add strings after the code
> string which will be translated into additional flags and passed to the
> InstObjParams constructor. You could augment that list (or tuple?) if your
> instruction is already has that, or you can just make one up and put your
> flag in it.
>
>
> Gabe
> ______________________________**_________________
> gem5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/**mailman/listinfo/gem5-users<http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users>
>
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to