{"id":19662192,"url":"https://github.com/efeslab/thermometer-artifact","last_synced_at":"2025-04-28T21:31:56.170Z","repository":{"id":46537918,"uuid":"508475258","full_name":"efeslab/thermometer-artifact","owner":"efeslab","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-03T19:04:44.000Z","size":2407,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-05T11:11:16.008Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efeslab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-28T22:42:06.000Z","updated_at":"2023-12-13T11:52:22.000Z","dependencies_parsed_at":"2023-01-20T07:46:48.388Z","dependency_job_id":null,"html_url":"https://github.com/efeslab/thermometer-artifact","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efeslab%2Fthermometer-artifact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efeslab%2Fthermometer-artifact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efeslab%2Fthermometer-artifact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efeslab%2Fthermometer-artifact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efeslab","download_url":"https://codeload.github.com/efeslab/thermometer-artifact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251391245,"owners_count":21582133,"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":"2024-11-11T16:09:53.739Z","updated_at":"2025-04-28T21:31:55.349Z","avatar_url":"https://github.com/efeslab.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e Thermometer \u003c/h1\u003e\n\nThermometer is a profile-guided BTB replacement technique.\n\nPlease cite the following [paper](https://web.eecs.umich.edu/~takh/papers/song-thermometer-isca-2022.pdf) if you use this artifact:\n```\n@inproceedings{song-thermometer-isca-2022,\n  author = {Song, Shixin and Khan, Tanvir Ahmed and Mahdizadeh Shahri, Sara and Sriraman, Akshitha and Soundararajan, Niranjan K and Subramoney, Sreenivas and Jim{\\'e}nez, Daniel A and Litz, Heiner and Kasikci, Baris},\n  title = {Thermometer: Profile-Guided BTB Replacement for Data Center Applications},\n  booktitle = {Proceedings of the 49th International Symposium on Computer Architecture (ISCA)},\n  series = {ISCA 2022},\n  year = {2022},\n  video = {https://www.youtube.com/watch?v=YMqFlP0PtWw},\n  code = {https://github.com/efeslab/thermometer-artifact},\n  month = jun,\n}\n```\n\n# Simulator and trace\nThermometer is implemented in a trace-based simulator, [ChampSim](https://github.com/ChampSim/ChampSim).\nClone the Thermometer repo with\n```\ngit clone git@github.com:efeslab/thermometer-artifact.git\n```\nWe use Intel Processor Trace to generate traces for widely-used data center applications. The traces can be downloaded from [here](https://drive.google.com/file/d/1tN8Jw1TcZ9CrDzDWK0HFUD-nVLhZDW9e/view).\n\n**Update: We also released traces of four more apps [here](https://drive.google.com/file/d/1RJYNbMR4G3m40ZiaflJ2Ox_DFB8vsgWv/view?usp=sharing)**\n\n[//]: # (TODO: there are only 9 traces on the google drive)\n\n# Compile\n\n## Dependency\n\nFirst, you should make sure that a C++ compiler (with C++17 support), `cmake`, and `boost-filesystem` are installed. \nPython 3 is required to install the dependency below, as well as to run the scripts. \n\nThe project also requires `intelxed` as a dependency. You can install it by\n\n```bash\n$ git clone https://github.com/intelxed/xed.git xed\n$ git clone https://github.com/intelxed/mbuild.git mbuild\n$ cd xed\n$ python3 ./mfile.py --shared install\n```\n\nThis will create a `kits` directory containing the compiled xed (both static and shared) libraries.\n\n**Add the absolute path to `kits/xed-install-base-xxx` to your env variable `CMAKE_PREFIX_PATH` so that CMake can find this package.**\n\n[//]: # (ChampSim takes a JSON configuration script. Examine `champsim_config.json` for a fully-specified example. All options described in this file are optional and will be replaced with defaults if not specified. The configuration scrip can also be run without input, in which case an empty file is assumed.)\n\n## Build (Debug)\n\nCMake will compile in debug mode by default. You can use this build to debug your code.\n\n```bash\n$ mkdir cmake-build-debug\n$ cd cmake-build-debug\n$ cmake ..\n$ make -j\n```\n\n## Build (Release)\n\nYou can also add a flag to compile in the release mode. This is useful in the real experiments since the code is optimized for speed.\n\n```bash\n$ mkdir cmake-build-release\n$ cd cmake-build-release\n$ cmake -DCMAKE_BUILD_TYPE=Release ..\n$ make -j\n```\n\n# Experiments\n## Compiled executables\nAfter successfully build all executables, you can find them in the directory `cmake-build-debug` or `cmake-build-release`. \nDifferent executables are corresponding to different experimental setup mentioned in the paper. \nWe list corresponding names of major experiment setups in the following tables. \nFor some experimental setups, the corresponding executable names can be found according to the experiment running scripts.\n\n| Executable                                                              | BTB Replacement     | BTB Prefetch | Other Setup                            |\n|-------------------------------------------------------------------------|---------------------|--------------|----------------------------------------|\n| ChampSim_fdip_lru                                                       | LRU                 |              |                                        |\n| ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru                | Thermometer         |              |                                        |\n| ChampSim_fdip_opt                                                       | Optimal Replacement |              |                                        |\n| ChampSim_fdip_srrip                                                     | SRRIP               |              |                                        |\n| ChampSim_fdip_ghrp                                                      | GHRP                |              |                                        |\n| ChampSim_fdip_hawkeye                                                   | Hawkeye             |              |                                        |\n| ChampSim_fdip_predecoder_btb_lru                                        | LRU                 | Confluence   |                                        |\n| ChampSim_fdip_shotgun_lru                                               | LRU                 | Shotgun      |                                        |\n| ChampSim_fdip_predecoder_btb_hot_warm_cold_80_50_f_keep_curr_hotter_lru | Thermometer         | Confluence   |                                        |\n| ChampSim_fdip_shotgun_hot_warm_cold_80_50_f_keep_curr_hotter_lru        | Thermometer         | Shotgun      |                                        |\n| ChampSim_fdip_predecoder_btb_opt                                        | Optimal Replacement | Confluence   |                                        |\n| ChampSim_fdip_shotgun_opt                                               | Optimal Replacement | Shotgun      |                                        |\n| ChampSim_fdip_perfect_btb                                               |                     |              | No BTB Misses                          |\n| ChampSim_fdip_perfect_bp                                                | LRU                 |              | Correct branch direction               |\n| ChampSim_icache_lru                                                     |                     |              | No I-Cache Misses (very large I-Cache) |\n\n\n## Run Experiments\nUse the following script to run most experiments\n```bash\nrun_test.py\n```\nUse the following script to generate result summary from raw data\n```bash\npython3 generate_result.py --trace-type=pt --total-btb-ways=4 --dir-list=ChampSim_fdip_lru,ChampSim_fdip_srrip,ChampSim_fdip_ghrp,ChampSim_fdip_hawkeye,ChampSim_fdip_opt,ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_perfect_btb,ChampSim_fdip_perfect_bp,ChampSim_icache_lru,ChampSim_fdip_predecoder_btb_lru,ChampSim_fdip_shotgun_lru,ChampSim_fdip_predecoder_btb_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_shotgun_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_predecoder_btb_opt,ChampSim_fdip_shotgun_opt,7979ChampSim_fdip_opt,7979ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru\n```\n\n## Run Experiments and Generate Results\nSince some Figures use the data from the same experiment, so please run the following commands in order to get required raw data to generate the final results.\n### IPC Speedup and BTB Miss Reduction\nFirst, run experiments using the script `run_test.py`.\n```bash\n# LRU, SRRIP, GHRP, Hawkeye\n# Perfect BTB, Perfect Branch Prediction, Perfect I-Cache\n# LRU + Confluence, LRU + Shotgun\npython3 run_test.py --trace-type=pt --total-btb-ways=4 --run-list=ChampSim_fdip_lru,ChampSim_fdip_srrip,ChampSim_fdip_ghrp,ChampSim_fdip_hawkeye,ChampSim_fdip_perfect_btb,ChampSim_fdip_perfect_bp,ChampSim_icache_lru,ChampSim_fdip_predecoder_btb_lru,ChampSim_fdip_shotgun_lru --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n# Optimal Replacement,\n# Optimal Replacement + Confluence, Optimal Replacement + Shotgun\npython3 run_test.py --trace-type=pt --generate=True --total-btb-ways=4 --run-list=ChampSim_fdip_opt,ChampSim_fdip_predecoder_btb_opt,ChampSim_fdip_shotgun_opt --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n# Thermometer, Thermometer (holistic information only)\n# Thermometer + Confluence, Thermometer + Shotgun\npython3 run_test.py --trace-type=pt --total-btb-ways=4 --run-list=ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_hwc_50_80_f_keep_curr_hotter,ChampSim_fdip_predecoder_btb_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_shotgun_hot_warm_cold_80_50_f_keep_curr_hotter_lru --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n# Optimal Replacement and Thermometer on BTB with 7979 entry\npython3 run_test.py --trace-type=pt --generate=True --total-btb-ways=4 --total-btb-entries=7979 --run-list=ChampSim_fdip_opt --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\npython3 run_test.py --trace-type=pt --total-btb-ways=4 --total-btb-entries=7979 --run-list=ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n# Twig\n#python3 run_test.py --trace-type=pt --total-btb-ways=4 --total-btb-entries=8 --run-list=ChampSim_fdip_lru --twig-profile=True --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n## TODO: One step of generating Twig result is missing\n#python3 run_test.py --trace-type=pt --total-btb-ways=4 --total-btb-entries=8 --run-list=ChampSim_fdip_lru,ChampSim_fdip_srrip --use-twig-prefetch=True\n#python3 run_test.py --trace-type=pt --total-btb-ways=4 --total-btb-entries=8 --run-list=ChampSim_fdip_opt --use-twig-prefetch=True --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n#python3 run_test.py --trace-type=pt --total-btb-ways=4 --total-btb-entries=8 --run-list=ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru --use-twig-prefetch=True --app-list=cassandra,clang,drupal,finagle-chirper,finagle-http,kafka,mediawiki,mysqllarge,pgbench,python,tomcat,verilator,wordpress\n```\nSecond, generate result summary using the script `generate_result.py`.\n```bash\npython3 generate_result.py --trace-type=pt --total-btb-ways=4 --dir-list=ChampSim_fdip_lru,ChampSim_fdip_srrip,ChampSim_fdip_ghrp,ChampSim_fdip_hawkeye,ChampSim_fdip_opt,ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_hwc_50_80_f_keep_curr_hotter,ChampSim_fdip_perfect_btb,ChampSim_fdip_perfect_bp,ChampSim_icache_lru,ChampSim_fdip_predecoder_btb_lru,ChampSim_fdip_shotgun_lru,ChampSim_fdip_predecoder_btb_opt,ChampSim_fdip_shotgun_opt,ChampSim_fdip_predecoder_btb_hot_warm_cold_80_50_f_keep_curr_hotter_lru,ChampSim_fdip_shotgun_hot_warm_cold_80_50_f_keep_curr_hotter_lru,7979ChampSim_fdip_opt,7979ChampSim_fdip_hot_warm_cold_80_50_f_keep_curr_hotter_lru\n```\nThen, calculate corresponding IPC speedup and generate plots. You can check comments in the script to find out map from figure number to file name and plot code.\n```bash\n# Fig. 1 3 4 11\npython3 plots/scripts/plot_ipc_mpki.py\n# Fig. 2\npython3 plots/scripts/plot_functions.py\n```\nFinally, calculate and plot BTB miss reduction.\n```bash\n# Fig. 12\npython3 plots/scripts/plot_btb_miss.py\n```\n\n### Reuse Distance Variance\n```bash\n# Fig. 5\npython3 plots/scripts/plot_reuse_distance_variance.py\n```\n\n### Hit-to-taken percentage\n```bash\n# Fig. 6 7\npython3 plots/scripts/plot_hit_access_count.py\n```\n\n### Correlation\n```bash\n# Fig. 8\npython3 plots/scripts/plot_hwc_bias_corr.py\n```\n\n### Bypass\n```bash\n# Fig. 9\npython3 plots/scripts/plot_opt_eviction.py\n```\n\n### Coverage\n```bash\n# Fig. 9\npython3 plots/scripts/plot_coverage.py\n```\n\n### Accuracy\n```bash\n# Fig. 9\npython3 plots/scripts/plot_accuracy.py\n```\n\n# Note\nSome paths are hard-coded in the implementation and scripts, feel free to replace them with what you needed.\nMost result data and plots are already included in this repo.\nIf you have any problems (e.g., scripts do not work. some results cannot be generated), feel free to contact us.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefeslab%2Fthermometer-artifact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefeslab%2Fthermometer-artifact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefeslab%2Fthermometer-artifact/lists"}