This repository contains three microarchitecture simulators developed as coursework for CS6600 Computer Architecture (Fall 2024). The simulators model core architectural components including memory hierarchies, dynamic branch prediction, and instruction-level parallelism.
A parameterized, multi-level cache simulator written in C++.
- Implementation: Models L1, L2, and a fully-associative Victim Cache.
- Features: Implements a Least Recently Used (LRU) replacement policy and a write-back/write-allocate strategy. It integrates with CACTI to approximate Average Access Time (AAT), Energy-Delay Product (EDP), and total memory traffic.
- Compilation & Execution:
cd CacheSimulator make ./cache_sim <L1_SIZE> <L1_ASSOC> <L1_BLOCKSIZE> <VC_NUM_BLOCKS> <L2_SIZE> <L2_ASSOC> <trace_file>
A cycle-accurate simulator modeling a superscalar processor using Tomasulo's Algorithm.
- Implementation: Models Fetch, Decode/Dispatch, Issue, Execute, Writeback, and Retire stages.
- Features: Utilizes register renaming (tagging) and a Reorder Buffer (ROB) to dynamically schedule instructions, resolve Read-After-Write (RAW) data dependencies, and eliminate Write-After-Write (WAW) and Write-After-Read (WAR) hazards.
- Compilation & Execution:
cd TomasuloSimulator make ./ooosim <N> <S> <trace_file>
A trace-driven branch prediction simulator to evaluate branch prediction accuracy.
- Implementation: Implements both a Bimodal Predictor (using an array of 2-bit saturating counters) and a Gshare Predictor.
- Features: The Gshare implementation utilizes a Global History Register (GHR) XORed with the PC to improve prediction accuracy on highly correlated branch patterns.
- Compilation & Execution:
cd BranchPredictor make ./bpsim bimodal <M> <trace_file> # or for gshare: ./bpsim gshare <M> <N> <trace_file>
Each simulator directory is organized as follows:
/ (Root): C++ source code (.cpp), header files (.h), provided dependencies (e.g.,cacti),Makefile, andreport.pdf./traces: Instruction and memory trace files (e.g.,sample_trace.txt)./scripts: Bash and Python scripts used for running sweeps, validation, and plotting./outputs: Validation outputs, reference outputs, and generated.csvdata.
This repository is public for portfolio and reference purposes only. If you are currently taking CS6600 or a similar course at IIT Madras or elsewhere, please adhere to your institution's academic integrity and honour code policies. Do not copy or use this code for your own assignments.