Hi Brad and Tony,

I've attached an updated diff. Take a look at it and see what you think.

Instead of adding the code
        num_sets = l2_cache.size / options.cacheline_size / l2_cache.assoc
        repl = PseudoLRUReplacementPolicy(num_sets = num_sets,
                                          assoc = l2_cache.assoc)
        l2_cache.replacement_policy = repl

after every single cache instantiation, that code is moved into the
replacement policy constructor.

Additionally, by leveraging the same technique in the classic cache
replacement policy, you can use the parent's size/associativity to make the
default values be the right values.

Thus, there is no need to update the config files at all. Well, except for
MESI_Three_Level since it doesn't use PLRU.

If you need the num_sets option within AMD, I suggest you add it back and
have that override the defaults, if it is set.

Thanks,
Jason

On Tue, May 19, 2015 at 1:26 PM Jason Power <power...@gmail.com> wrote:

>   This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/2797/
>
> At a high-level, I like that you're breaking out the replacement policies 
> this way. However, I really dislike that you have to add 3 new lines for 
> every single controller you create in the config files. Not only is this kind 
> of ugly since it's lots of replicated code, but it also affects all of us 
> with our own protocols significantly.
>
> I'll be able to spend some time tomorrow morning trying to come up with a 
> reasonable solution (or decide it's impossible and give a "ship it" as is). 
> It should be possible to encapsulate the duplicated code in the SimObject 
> Python file.
>
>
> - Jason Power
>
> On May 11th, 2015, 10:21 p.m. UTC, Tony Gutierrez wrote:
>   Review request for Default.
> By Tony Gutierrez.
>
> *Updated May 11, 2015, 10:21 p.m.*
>  *Repository: * gem5
> Description
>
> Changeset 10854:8d7e13abf092
> ---------------------------
> ruby: initalize replacement policies with their own simobjs
>
> This is in preparation for other replacement policies that take aditional
> paramters
>
>   Diffs
>
>    - src/mem/ruby/structures/LRUPolicy.hh
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/LRUPolicy.cc (PRE-CREATION)
>    - src/mem/ruby/structures/LRUReplacementPolicy.py (PRE-CREATION)
>    - src/mem/ruby/structures/PseudoLRUPolicy.hh
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/PseudoLRUPolicy.cc (PRE-CREATION)
>    - src/mem/ruby/structures/PseudoLRUReplacementPolicy.py (PRE-CREATION)
>    - src/mem/ruby/structures/ReplacementPolicy.py (PRE-CREATION)
>    - src/mem/ruby/structures/SConscript
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/Cache.py
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/CacheMemory.hh
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/CacheMemory.cc
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/AbstractReplacementPolicy.hh
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - src/mem/ruby/structures/AbstractReplacementPolicy.cc (PRE-CREATION)
>    - configs/ruby/MESI_Two_Level.py
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - configs/ruby/MI_example.py (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - configs/ruby/MOESI_CMP_directory.py
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - configs/ruby/MOESI_CMP_token.py
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>    - configs/ruby/MOESI_hammer.py
>    (fbdaa08aaa426b9f4660c366f934ccb670d954ec)
>
> View Diff <http://reviews.gem5.org/r/2797/diff/>
>
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to