Implementing Our Own Cache Replacement Policy

198 views
Skip to first unread message

Alanoud Alsalman

unread,
Mar 19, 2017, 5:21:32 PM3/19/17
to Sniper simulator
Hi,

My team and I would like to implement an enhanced LRU cache replacement policy.
My question is: how do we do it based on sniper codes and classes?
I already figured out the configuration part, but I don't know what to do with the code part. Can we do the replacement policy from scratch then add sniper code lines to it or should I edit one of the available cache replacement codes? What other files should I edit in order to run our own implementation?
Can you help us please?

Thank you,
Alan

Wim Heirman

unread,
Mar 20, 2017, 4:55:21 AM3/20/17
to snip...@googlegroups.com
Hi Alan,

Replacement policies are implemented in the files common/core/memory_subsystem/cache/cache_set_*. It's easiest to start from a copy of cache_set_lru.cc and modify that to implement your own policy. Note that you also need a few small additions to cache_set.cc and cache_base.h (the ReplacementPolicy enum) to make your new policy known to Sniper.

Regards,
Wim


--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to
snipersim+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alanoud Alsalman

unread,
Mar 20, 2017, 12:29:41 PM3/20/17
to Sniper simulator
Thank you Wim,

One more thing please, is there a page or a document that explains the cache codes? i.e. a documentation?

best,
Alan


On Monday, March 20, 2017 at 2:55:21 AM UTC-6, Wim Heirman wrote:
Hi Alan,

Replacement policies are implemented in the files common/core/memory_subsystem/cache/cache_set_*. It's easiest to start from a copy of cache_set_lru.cc and modify that to implement your own policy. Note that you also need a few small additions to cache_set.cc and cache_base.h (the ReplacementPolicy enum) to make your new policy known to Sniper.

Regards,
Wim

On 19 March 2017 at 22:21, Alanoud Alsalman <alanoudi...@gmail.com> wrote:
Hi,

My team and I would like to implement an enhanced LRU cache replacement policy.
My question is: how do we do it based on sniper codes and classes?
I already figured out the configuration part, but I don't know what to do with the code part. Can we do the replacement policy from scratch then add sniper code lines to it or should I edit one of the available cache replacement codes? What other files should I edit in order to run our own implementation?
Can you help us please?

Thank you,
Alan

--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.

Alanoud Alsalman

unread,
Mar 20, 2017, 2:06:01 PM3/20/17
to Sniper simulator
And can you tell me where is the main function in the cache replacement policies, please?

Thank you,

Alan

On Monday, March 20, 2017 at 2:55:21 AM UTC-6, Wim Heirman wrote:
Hi Alan,

Replacement policies are implemented in the files common/core/memory_subsystem/cache/cache_set_*. It's easiest to start from a copy of cache_set_lru.cc and modify that to implement your own policy. Note that you also need a few small additions to cache_set.cc and cache_base.h (the ReplacementPolicy enum) to make your new policy known to Sniper.

Regards,
Wim

On 19 March 2017 at 22:21, Alanoud Alsalman <alanoudi...@gmail.com> wrote:
Hi,

My team and I would like to implement an enhanced LRU cache replacement policy.
My question is: how do we do it based on sniper codes and classes?
I already figured out the configuration part, but I don't know what to do with the code part. Can we do the replacement policy from scratch then add sniper code lines to it or should I edit one of the available cache replacement codes? What other files should I edit in order to run our own implementation?
Can you help us please?

Thank you,
Alan

--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.

Nora almayouf

unread,
Mar 21, 2017, 7:05:22 PM3/21/17
to Sniper simulator
This is really helpful.

 kindly I want know how to capture the read and write that is done in each cache line, for I want to change the LRU algorithm based on the W/R.

Thank you 
Nora

On Monday, March 20, 2017 at 2:55:21 AM UTC-6, Wim Heirman wrote:
Hi Alan,

Replacement policies are implemented in the files common/core/memory_subsystem/cache/cache_set_*. It's easiest to start from a copy of cache_set_lru.cc and modify that to implement your own policy. Note that you also need a few small additions to cache_set.cc and cache_base.h (the ReplacementPolicy enum) to make your new policy known to Sniper.

Regards,
Wim

On 19 March 2017 at 22:21, Alanoud Alsalman <alanoudi...@gmail.com> wrote:
Hi,

My team and I would like to implement an enhanced LRU cache replacement policy.
My question is: how do we do it based on sniper codes and classes?
I already figured out the configuration part, but I don't know what to do with the code part. Can we do the replacement policy from scratch then add sniper code lines to it or should I edit one of the available cache replacement codes? What other files should I edit in order to run our own implementation?
Can you help us please?

Thank you,
Alan

--
--
--
You received this message because you are subscribed to the Google
Groups "Sniper simulator" group.
To post to this group, send email to snip...@googlegroups.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/snipersim?hl=en

---
You received this message because you are subscribed to the Google Groups "Sniper simulator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snipersim+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages