Emulating Second layer cache
===

I need a `Secondary level cache` (After Main memory in hierarchy) as a small part in my project. But I dont have such infrastructure in my code presently. So I want to emulate it and I can get SSD / another RAM for this.

Can you please tell me some ideas of how to imitate the secondary level cache :
One option I thought of was allocating some amount of main memory for Secondary cache and creating code related to that.

But I think coding for that may become hard. So can I know any open source projects and ideas of how to proceed.

Any help would be greatly appreciated.