Sorry for the slow reply... I'm traveling this week.

On Sun, Jun 21, 2009 at 10:30 AM, Gabe Black <[email protected]> wrote:

> To differentiate between branch/no branch that's actually along the
> lines of what I want to do, which in retrospect doesn't really have
> anything to do with what I was talking about here.


I don't understand what you mean.


> A better reason is
> that there is no register file object in anything but the simple CPUs.


I agree that it should not be in the reg file object.  I think we're just
discussing the right way to get it out and put it in the decoder.


> My working solution so far is to annotate each instruction definition
> with a list of sources that might be the PC in disguise.


Is there really a list and not just a single register value?

Also, is it the case that you can write the PC with any opcode?  I vaguely
recall hearing that that was deprecated at some point.


> Then in the
> execute template I add a little blob of code that checks if one actually
> is the PC, and if so overwrites its value with xc->readPC() + 8. I have
> to make sure I write to that variable in a way that the ISA parser can't
> figure out so it doesn't make it a dest too, so I wrote a little
> function that takes a reference to it and it's new value and does the
> assignment outside of the parsers view.
>
> I don't have a solution for the dest end, though. I could do something
> similar, but if I were to read from the variable to pass to
> xc->setNextPC(), the parser would think it was a source. I haven't
> thought of a good way to hide that assignment.


Yea, that all sounds pretty ugly.


> In both of these cases, I'm building up a non-trivial blob of stuff
> trying to get operand reading and writing to do what I want them to do.
> If I could get that effect directly I could just leave the instruction
> definitions/formats the same.
>
> Example reading code:
> Rn = (RN == PCReg) ? xc->readPC() : xc->readIntRegOperand(this, 0);
>
> Example writing code:
> if (RD == PCReg)
>    xc->setNextPC(Rd);
> else
>    xc->setIntRegOperand(this, 0);
>

Is this what you'd like to bury inside the op_rd/op_wr code?

Steve
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to