On Sat, Nov 16, 2013 at 10:28:03AM +0100, Geert Uytterhoeven wrote:
> On Sat, Nov 16, 2013 at 9:01 AM, Stefan Kristiansson
> <[email protected]> wrote:
> >> iii)  It would be nice to have an instruction to clear a cache line.  As
> >> things stand now, overwriting an entire cache line still requires reading
> >> the cache line from memory.  If we could issue an instruction to clear the
> >> line, the line would not need to be read from memory; we could then go 
> >> ahead
> >> and overwrite the entire line with new values and save ourselves a cache
> >> line fill.  Not sure if this is easily doable given that it's a spec change
> >> (though it's an addition).
> >>
> >
> > I can't figure out the use case for that, but I'm sure you have one.
> > Enlighten us ;)
> > From your description it sounds like you want to have content in the cache
> > that is decoupled from the memory content, but still valid.
> > That sounds scary to me.
> 
> This is useful for clearing pages, i.e. memset(page, 0, PAGE_SIZE).
> If overwriting an entire cache line requires reading the cache line from 
> memory
> first, you double the memory bus traffic, compared to you writing out the
> new data.
> 

Ok, so it's specific to write-back only, I see the point now.
So, what you want is a flush-and-clear command, that flushes the current
data in the line, clear all data in the cache memory, set the match address
to what was specified in the flush command and marks the line dirty.

Stefan
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to