>            0x20: IntegerOperate('addq', 'Rc = Ra + Rb_or_imm;')

We can make this work:

0x20: IntegerOperate.addq('Rc = Ra + Rb_or_imm;')

We could even make this work:

0x20: IntegerOperate.addq(R.c = R.a + R.b.imm)

Of course, then you're getting into magic land :)

If we use execfile to execute the isa parser stuff, then we can have
default values for unknown variables (as of python 2.4 the dict can be
any mapping object):

class default(object):
    def __call__(self, *args, **kwargs):
        print args, kwargs

class Dict(dict):
    def __getitem__(self, name):
        try:
            return dict.__getitem__(self, name)
        except KeyError:
            val = default()
            self[name] = val
            return val

d = Dict()
exec "asdf(99)" in d
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to