{"id":37063397,"url":"https://github.com/caleb531/cache-simulator","last_synced_at":"2026-01-14T07:13:34.646Z","repository":{"id":47424944,"uuid":"48072933","full_name":"caleb531/cache-simulator","owner":"caleb531","description":"A processor cache simulator for the MIPS architecture","archived":false,"fork":false,"pushed_at":"2025-11-24T18:38:33.000Z","size":202,"stargazers_count":39,"open_issues_count":0,"forks_count":18,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-04T09:20:36.425Z","etag":null,"topics":["cache","mips","processor","processor-architecture","python","simulator"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/cache-simulator/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caleb531.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-12-15T22:34:32.000Z","updated_at":"2025-11-24T18:38:37.000Z","dependencies_parsed_at":"2023-12-19T11:02:56.527Z","dependency_job_id":"29b1e7e7-883e-4e7a-b670-37c01f0815c4","html_url":"https://github.com/caleb531/cache-simulator","commit_stats":{"total_commits":134,"total_committers":2,"mean_commits":67.0,"dds":0.02238805970149249,"last_synced_commit":"fa6325c2c88df6720230fc3c7a44d09a81e860c5"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/caleb531/cache-simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fcache-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fcache-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fcache-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fcache-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caleb531","download_url":"https://codeload.github.com/caleb531/cache-simulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caleb531%2Fcache-simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cache","mips","processor","processor-architecture","python","simulator"],"created_at":"2026-01-14T07:13:33.990Z","updated_at":"2026-01-14T07:13:34.639Z","avatar_url":"https://github.com/caleb531.png","language":"Python","readme":"# Cache Simulator\n\n*Copyright 2015-2024 Caleb Evans*  \n*Released under the MIT license*\n\n[![tests](https://github.com/caleb531/cache-simulator/actions/workflows/tests.yml/badge.svg)](https://github.com/caleb531/cache-simulator/actions/workflows/tests.yml)\n[![Coverage Status](https://coveralls.io/repos/caleb531/cache-simulator/badge.svg)](https://coveralls.io/r/caleb531/cache-simulator?branch=main)\n\nThis program simulates a processor cache for the MIPS instruction set\narchitecture. It can simulate all three fundamental caching schemes:\ndirect-mapped, *n*-way set associative, and fully associative.\n\nThe program must be run from the command line and requires Python 3.4+ to run.\nExecuting the program will run the simulation and print an ASCII table\ncontaining the details for each supplied word address, as well as the final\ncontents of the cache.\n\nFor example, the following command simulates a 3-way set associative LRU cache,\nwith 2 words per block. To see all examples and their respective outputs, see\n[examples.sh](examples.sh).\n\n```sh\n# 3-way set associative (LRU; 2 words per block)\ncache-simulator --cache-size 24 --num-blocks-per-set 3 --num-words-per-block 2 --word-addrs 3 180 43 2 191 88 190 14 181 44 186 253\n```\n\nThis produces the following output:\n\n```\n     WordAddr      BinAddr          Tag        Index       Offset     Hit/Miss\n--------------------------------------------------------------------------------\n            3    0000 0011        00000           01            1         miss\n          180    1011 0100        10110           10            0         miss\n           43    0010 1011        00101           01            1         miss\n            2    0000 0010        00000           01            0          HIT\n          191    1011 1111        10111           11            1         miss\n           88    0101 1000        01011           00            0         miss\n          190    1011 1110        10111           11            0          HIT\n           14    0000 1110        00001           11            0         miss\n          181    1011 0101        10110           10            1          HIT\n           44    0010 1100        00101           10            0         miss\n          186    1011 1010        10111           01            0         miss\n          253    1111 1101        11111           10            1         miss\n\n                                     Cache\n--------------------------------------------------------------------------------\n         00                  01                  10                  11\n--------------------------------------------------------------------------------\n       88,89         2,3 42,43 186,187  180,181 44,45 252,253   190,191 14,15\n```\n\n## Installing\n\nYou can install Cache Simulator via pip, *or* using your preferred package manager (like uv):\n\n```sh\n# via pip\npip3 install cache-simulator\n```\n\n```sh\n# via uv\nuv tool install cache-simulator\n```\n\n## Command-line parameters\n\n### Required parameters\n\n#### --cache-size\n\nThe size of the cache in words (recall that one word is four bytes in MIPS).\n\n#### --word-addrs\n\nOne or more word addresses (separated by spaces), where each word address is a\nbase-10 positive integer.\n\n### Optional parameters\n\n#### --num-blocks-per-set\n\nThe program internally represents all cache schemes using a set associative\ncache. A value of `1` for this parameter (the default) implies a direct-mapped\ncache. A value other than `1` implies either a set associative *or* fully\nassociative cache.\n\n#### --num-words-per-block\n\nThe number of words to store for each block in the cache; the default value is `1`.\n\n#### --num-addr-bits\n\nThe number of bits used to represent each given word address; this value is\nreflected in the *BinAddr* column in the reference table. If omitted, the\ndefault value is the number of bits needed to represent the largest of the given\nword addresses.\n\n#### --replacement-policy\n\nThe replacement policy to use for the cache. Accepted values are `lru` (Least\nRecently Used; the default) and `mru` (Most Recently Used).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaleb531%2Fcache-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaleb531%2Fcache-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaleb531%2Fcache-simulator/lists"}