{
    "componentChunkName": "component---src-templates-post-js",
    "path": "/projects/three-level-cache-simulator",
    "result": {"data":{"mdx":{"frontmatter":{"title":"A Three-Level Cache Simulator and What It Taught Me","author":"Souleymane Dembele","date":"2024-12-10"},"body":"var _excluded = [\"components\"];\nfunction _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }\n/* @jsxRuntime classic */\n/* @jsx mdx */\n\nvar _frontmatter = {\n  \"title\": \"A Three-Level Cache Simulator and What It Taught Me\",\n  \"slug\": \"projects/three-level-cache-simulator\",\n  \"author\": \"Souleymane Dembele\",\n  \"date\": \"2024-12-10\",\n  \"isDraft\": false\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n    props = _objectWithoutProperties(_ref, _excluded);\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"For a computer-architecture course I built a trace-driven simulator of a\\nthree-level cache hierarchy in C++ and used it to study how policy and geometry\\nchoices move real performance metrics.\"), mdx(\"h2\", null, \"What it models\"), mdx(\"p\", null, \"The simulator implements L1, L2, and L3 caches with configurable associativity,\\nline size, and replacement policy (LRU, FIFO, and an optimized LRU). It can run\\nas either an inclusive or a non-inclusive hierarchy, and it optionally adds a\\n12-entry victim cache that captures lines recently evicted from L1. It reports\\nmiss rate, write-backs, bytes transferred, and average memory access time (AMAT)\\nfrom real trace files.\"), mdx(\"h2\", null, \"Findings\"), mdx(\"table\", null, mdx(\"thead\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"thead\"\n  }, mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Experiment\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"Before\"), mdx(\"th\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"After\"))), mdx(\"tbody\", {\n    parentName: \"table\"\n  }, mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"AMAT (associativity + line-size tuning)\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"7.64 cycles\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"4.80 cycles\")), mdx(\"tr\", {\n    parentName: \"tbody\"\n  }, mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"L2 unified hit rate (non-inclusive + victim cache)\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"~23%\"), mdx(\"td\", {\n    parentName: \"tr\",\n    \"align\": null\n  }, \"~57%\")))), mdx(\"p\", null, \"Expanding cache size and associativity drove the AMAT improvement, while moving\\nfrom an inclusive to a non-inclusive policy and adding the victim cache more than\\ndoubled the L2 hit rate by keeping frequently re-referenced lines on chip.\"), mdx(\"h2\", null, \"What I took from it\"), mdx(\"p\", null, \"A concrete, measured intuition for the memory hierarchy: how inclusion policy,\\nassociativity, line size, and a victim cache trade off against each other, and\\nhow to quantify those trade-offs from traces rather than rules of thumb.\"));\n}\n;\nMDXContent.isMDXComponent = true;"}},"pageContext":{"slug":"projects/three-level-cache-simulator"}},
    "staticQueryHashes": ["3649515864","68838506"]}