{"id":26595535,"url":"https://github.com/derekwin/learn_prefetcher","last_synced_at":"2026-01-05T16:05:15.364Z","repository":{"id":281945213,"uuid":"946598399","full_name":"derekwin/learn_prefetcher","owner":"derekwin","description":"hardware \u0026 software prefetcher","archived":false,"fork":false,"pushed_at":"2025-03-12T00:33:55.000Z","size":57782,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-12T01:26:27.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/derekwin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-11T11:45:24.000Z","updated_at":"2025-03-12T00:34:01.000Z","dependencies_parsed_at":"2025-03-12T01:36:35.105Z","dependency_job_id":null,"html_url":"https://github.com/derekwin/learn_prefetcher","commit_stats":null,"previous_names":["derekwin/learn_prefetcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekwin%2Flearn_prefetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekwin%2Flearn_prefetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekwin%2Flearn_prefetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekwin%2Flearn_prefetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derekwin","download_url":"https://codeload.github.com/derekwin/learn_prefetcher/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245128101,"owners_count":20565206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T16:18:48.783Z","updated_at":"2026-01-05T16:05:10.316Z","avatar_url":"https://github.com/derekwin.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thoughts\n\n* 在coverage/accuracy/timeliness这几个指标中，最重要的是timeliness\n* BOP因为及时性好，所以性能表现很好。而且开销很小。\n\t* BOP必须支持跨page，包含大offset, 否则发挥不出及时性的优势。为此可能应该用虚拟地址去做预取\n\t* BOP的RRTable如果在refill的时候写入，会受很多因素干扰，比如其他prefetcher refill的数据。因此，最好是在req进入BOP的时候，放入一个delay queue（比如delay 200个cycle), 再放入RRTable。用delay queue来模拟cache refill的latency\n\t* SPEC06中的很多benchmark会有大loop和小loop，比如433.milc，大loop的offset是32个cache line, 小loop是1。为了避免这两个loop相互干扰，BOP的offset-score table可以分裂成两个，一个放小offset（比如1, 2, 3, 4, ..., 64) ，一个放大offset (128, 256, 512 ... 1024, 2048)。两个offset-score table都可以选出一个best offset去issue prefetch request\n\t* BOP对omnetpp这些benchmark有时会有很大的负面影响，需要去调节score threshold抑制在这些benchmark上发送过多的请求\n* SPP有点难评\n\t* 一个调节的方法是根据及时性去改动lookahead threshold。如果及时性差，就调低threshold, 让SPP一直去lookahead，以便取到比较及时的数据。\n\t* SPP的缺点是受乱序影响比较大，因为要根据signature去获取stride, 但是signature的计算是受访问顺序影响的。\n\t* SPP如果不断lookahead而达到及时的话，会出问题，因为lookahead一次是需要几个cycle的，导致lookahead的距离是有限的。如果能够记录一些history, 调过前面的lookahead过程可能会对问题有所缓解。（注意Gem5并没有模拟lookahead的latency，这可以去手动加入）\n* SMS预取irregular pattern还是不错的\n\t* 个人认为SMS和SPP其实是一类的，都是针对irregular pattern。SMS的好处是不受乱序影响\n\t* 同样，SMS没有及时性的调节方式。\n\t* SMS在omnetpp上作用很大\n* Stream\n\t* IPCP的GS认为访问了active region的PC都是active PC, active PC所到之处都会发一个region的prefetch请求。这种Stream在SPEC FP上表现很好，但是在INT上有好有差，因为PC不一定遵循一个pattern。\n\t* 同样Stream要非常注意prefetch distance来满足及时性的要求，比如L1可以prefetch当前region 32个cacheline后的数据\n\n## Some Designs\n* ARM Neoverse V2\n![](attachments/Pasted%20image%2020231106220342.png)\n\n* Intel\n\t* Stride+Stream+SPP-alike prefetcher+Array of pointer prefetcher+LLC page prefetcher (Maybe)\n# Content Overview\n\n# Paper Reading\n\n\u003ccenter\u003e\u003cimg src=\"attachments/pf_paper.png\" width=\"600\"\u003e\u003c/center\u003e\n\n* [Stride Prefetcher](Stride_Prefetcher.md)\n* [Spatial Prefetcher](Spatial_Prefetcher.md)\n* [Temporal Prefetcher](Temporal_Prefetcher.md)\n* [Software Prefetcher](Software_Prefetcher.md)\n\n# Code Reading \n\n* [Stride Prefetcher Gem5 Codes](simulator_codes/Stride_Prefetcher_Gem5_Codes.md)\n* [Stream Prefetcher Gem5 Codes](simulator_codes/Stream_Prefetcher_Gem5_Codes.md)\n* [AMPM Gem5 Codes](simulator_codes/AMPM_Gem5_Codes.md)\n* [BOP Gem5 Codes](simulator_codes/BOP_Gem5_Codes.md)\n* [MLOP ChampSim Codes](simulator_codes/MLOP_ChampSim_Codes.md)\n* [SPP Gem5 Codes](simulator_codes/SPP_Gem5_Codes.md)\n* [SPP + PPF ChampSim Codes](simulator_codes/SPPPPF_ChampSim_Codes.md)\n* [DSPatch ChampSim Codes](simulator_codes/DSPatch_ChampSim_Codes.md)\n* [IPCP ChampSim Codes](simulator_codes/IPCP_ChampSim_Codes.md)\n* [ISB Gem5 Code](simulator_codes/ISB_Gem5_Code.md)\n\n# Prefetcher Papers\n\n* [Prefetcher Papers](paper_list.md)\n\n# Resources\n\n* [hwd-prefetch-study/Paper\\_Reading.md](https://github.com/lshpku/hwd-prefetch-study/blob/3c0a6fb44029e04c7aa0ef2aaf80c152736b3a4f/Paper_Reading.md)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekwin%2Flearn_prefetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderekwin%2Flearn_prefetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekwin%2Flearn_prefetcher/lists"}