{"id":17809780,"url":"https://github.com/zeroxbrock/cs472-lab","last_synced_at":"2025-08-11T06:09:58.700Z","repository":{"id":72748938,"uuid":"136325407","full_name":"zeroXbrock/CS472-Lab","owner":"zeroXbrock","description":"Architecture woo","archived":false,"fork":false,"pushed_at":"2018-06-06T13:23:52.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T06:43:13.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"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/zeroXbrock.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":"2018-06-06T12:26:55.000Z","updated_at":"2019-06-13T03:53:06.000Z","dependencies_parsed_at":"2023-03-19T11:06:45.228Z","dependency_job_id":null,"html_url":"https://github.com/zeroXbrock/CS472-Lab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zeroXbrock/CS472-Lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2FCS472-Lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2FCS472-Lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2FCS472-Lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2FCS472-Lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeroXbrock","download_url":"https://codeload.github.com/zeroXbrock/CS472-Lab/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeroXbrock%2FCS472-Lab/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269838444,"owners_count":24483200,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-10-27T15:21:45.973Z","updated_at":"2025-08-11T06:09:58.680Z","avatar_url":"https://github.com/zeroXbrock.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CS472-Lab\nArchitecture woo\n\n_To implement level-3 caching in SimpleScalar's sim-cache, all that is needed is some vim skills, or some patience._\nReally what we're doing is copy-pasting the L2 code and modifying it to be \"L3\", renaming stuff and re-routing other to the newly-named stuff.\n\nHere's a step-by-step overview of what I did:\n\n**1. Enable L3 caching.**\n  - Create new structs for the l3 objects\n  \n    (VIM)\n    `/static struct cache_t *cache_il2↵` `yy` `p`\n    `/static struct cache_t *cache_il2↵` `n` `$` `r` `3`\n  - Create new functions for l3 simulations and modify L2 functions to allow use of L3 caching. Example for data cache:\n    \n    (VIM)\n    `/dl1_access_fn↵` `kk` `v20↵` `$` `y` `k` `p` Copies our function skeleton from the implementation of the L1 data cache\n    \n    `v20↵` `$` `:s/dl2/dl3/g↵` `$` Replaces dl2 with dl3\n    \n    `v20-` `$` `:s/dl1/dl2/g↵` Replaces dl1 with dl2\n    \n    `:1` `/dl2_access_fn↵` `n` `kk` `v3↵` `$` Finds old L2 function to become the L3 function, since L3 will take over what used to be L2's responsibility -- accessing system memory.\n    \n    `:s/dl2/dl3/g↵` `$` Replaces dl2 with dl3    \n    \n    In layman's terms, we just re-routed the L2 function to point to L3 memory, exactly like L1 points to L2. Then we have to make a new function for L3, but it behaves just like the L2 function, so we simply change the name of the old L2 function to be L3.\n\n\n**2. Enable sim-cache parameters for L3.**\n  - Instantiate option variables:\n  \n    (VIM)\n    `/static char *cache_dl2_opt↵` `yy` `p` `v$` `:s/dl2/dl3/↵` Finds and copies our variable definition. Do again for instruction cache.\n    \n  - Register option items:\n  \n    (VIM)\n    `/opt_reg_string↵` Finds the option register string function. I'm not including all the vim here but the idea is to add options for L3 which mirror those of L2. Once again, it's just a matter of copy-pasting and changing names.\n    \n    \n**3. OPTONAL: Handle errors**\n   I'm not including any vim here because this part is tricky. Look for `strcmp` and `mystricmp` -- they check for the presence of variables. Here, we can check which options are set. Options must be set according to the rules of the system (i.e. L1-\u003eL2-\u003eL3 or L1-\u003eL3 and a prerequisite level to L2 or L3 is required).\n   Again, this just requires some simple copypasta and refactoring.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroxbrock%2Fcs472-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeroxbrock%2Fcs472-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeroxbrock%2Fcs472-lab/lists"}