That sounds interesting... I agree, the performance impact would be my
main concern.  Generally interesting simulations run for long enough
that you more than make up for the cost of recompilation in the amount
of time you save running it.  In particular if you're just counting
things, it's probably faster to compile in counters for a superset of
everything you might care about and then just ignore the ones you
don't need.  If you're generating traces, you could take a look at how
DPRINTFs work, and the related but slightly different way we do debug
execution tracing, as examples of tracing that is compiled in but is
relatively easily enabled & disabled dynamically.

Steve

On Wed, Sep 29, 2010 at 3:32 AM, Matthew Horsnell
<[email protected]> wrote:
> I'm contemplating adding a less invasive method of gathering
> micro-architectural statistics, such as counts of instruction types and
> traces.
> As far as I know they current way of doing this is to add to the regStats
> methods within M5 modules, and add the types of stats to the headers.
> This doesn't appear to be very flexible as code must be written into modules
> and recompiled each time a new statistic is required.
>
> I am curious to know if anyone has previously looked at exposing some state
> through an interface, possibly the static_inst/dyn_inst? A user could then
> attach a listening object to a port,
> and snoop the static_inst/dyn_inst, updating external statistics depending
> on the instruction type etc. Obviously this will slow down the simulation to
> some extent when a statistics listener
> is attached, but allows the flexibility to generate traces and statistics
> very easily.
>
> I appreciate that this approach also has limitations.
>
> I'd appreciate any comments back from the m5-user community, if anyone can
> see any obvious pitfalls to this approach please let me know.
>
> Thanks,
>
> Matt
>
>
>
>
> _______________________________________________
> m5-users mailing list
> [email protected]
> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users
>
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to