bump
On Thu, Jan 21, 2021 at 5:46 PM Gabe Black <[email protected]> wrote:
> The name in the subject line is bad since it has connotations different
> from what I'm going for here, but beyond that it probably is the most
> accurate name I can think of. Basically what I'm thinking about is how each
> register an instruction processes is handled independently, and how it
> might be better to group them all together into a single set of registers
> and handle them that way.
>
> Lets say we have an instruction that produces result Rd, and consumes
> source registers Rs1, Rs2, and Fp1. It would have some sort of data
> structure which would have all those elements in it and accessible in a
> standard way, like an index for each and a place for each to put their
> value, etc.
>
> struct RegInfo
> {
> RegIdx idx;
> // Value from subclass with an appropriately typed member.
> }
>
> When an instruction is being created, the basic info would be put into
> this structure in a static way based on the instruction's encoding. As the
> instruction is processed, renamed, etc, all those registers would be
> handled to, for instance, the register flattening function, in a batch. If
> that flattening function became virtual in an effort to make the CPUs more
> ISA agnostic, then you'd pay the virtual function overhead once instead of
> once per register.
>
> Then, when the instruction goes to actually execute, a pre-step would be
> to accumulate all the register values into this structure and hand it to
> the execute method. The instruction would operate on it, and then fill in
> destination values which it would not write back, that would be a post step.
>
> Another nice property this sort of setup would have is that instruction
> tracing would get easier and less hacky. Right now the InstRecord
> associated with an instruction has a fixed number of slots for register
> values, and that's it. If you wanted to really trace an instruction and see
> what values its registers had before and after, you could store the entire
> structure that held the registers values before and after and then go down
> the line and print every registers value if you wanted, without having to
> hope they're in the right order, you stored the register that actually
> mattered, etc.
>
> This would also potentially be a nice way to store all register values in
> a database tracing execution which you could browse through after the fact
> meaningfully. You could, for instance, rewind the behavior of an
> instruction since you have a register delta of exactly what registers it
> changed and to what values. You might need "key frames" now and again to
> avoid storing before and after values for all registers, but this could be
> a very powerful debugging tool.
>
> Anyway, I haven't done any work on this and don't plan to in the very near
> future, but I think it sounds like an idea with a lot of upside. Let me
> know what you think.
>
> Gabe
>
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s