Hi Lide,

There isn't a direct way to access the caches from the CPU right now...this
is a design decision to keep M5 modular - all the CPU knows is what is
attached to its ports, that way you can have completely arbitrary
hierarchies and topologies without any dependencies in the CPU code as to
what the hierarchy looks like.

You'd have to hack something in...but it would definitely be a hack.  If you
had a few more specifics about what you were trying to do, I or someone
could provide slightly more suggestions.  Like, do you want this to happen
for every cache in the hierarchy or just a specific level?  Are the caches
you want this to happen to shared?  If so, would you want this function to
get called N times per cycles for N cpu tick calls, or just once across all
the CPUs?

Lisa

On Wed, Jul 14, 2010 at 8:36 AM, Lide Duan <[email protected]> wrote:

> Hi,
>
> Probably this is a silly question: how can I access the instantiated cache
> objects in the cpu object? I understand that the CPU sends requests to I/D
> cache ports which further connect to the caches. But what I am trying to do
> is to call a cache object function directly in the CPU, is it possible? More
> specifically, I need to collect some cache statistics every cycle, so I
> implemented a function (in Cache class) to do it, and need to call this
> function in CPU tick(). Then I came up with the problem that I couldn't
> access the cache objects in cpu. I found that the cache object is created in
> BUILD_CACHE in mem/cache/builder.cc, but where does it go after that?
>
> Anybody has some idea about this? Thank you very much!
>
> Lide
>
> _______________________________________________
> 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