A detailed processor simulator that models the backend of a superscalar out-of-order processor with various functional units. Computer Assignment Report can be found at CA2-Report.pdf
processor.hpp/cpp: Main processor class implementing the pipeline stagesprocsim.hpp/cpp: Processor simulator interface and configurationprocsim_driver.cpp: Main driver programdispatch_unit.hpp/cpp: Instruction dispatch unit implementationfunctional_unit.hpp/cpp: Functional unit implementationregister_file.hpp/cpp: Register file implementationrob.hpp/cpp: Reorder buffer implementationschedule_queue.hpp/cpp: Schedule queue implementationupdate_state.hpp/cpp: State update logic implementation
-
run_all.sh- Runs all traces with default configuration
- Configuration: R=2, J=3, K=2, L=1, F=4
- Compares outputs with golden outputs
- Usage:
./run_all.sh
-
run_experiment.sh- Tests multiple parameter configurations
- Parameter ranges:
- R: 2, 4, 8 (Result Busses)
- J: 1, 2, 3 (k0)
- K: 1, 2, 3 (k1)
- L: 1, 2, 3 (k2)
- F: 2, 4, 8 (fetch width)
- Organizes results in two ways:
- By configuration:
results/experiments/R2_J3_K2_L1_F4/ - By trace:
results/gcc/,results/gobmk/, etc.
- By configuration:
- Usage:
./run_experiment.sh
Makefile: Build configuration- Build:
make build - Clean:
make clean - Run:
make run - Run Debug:
make run-debug - Run Log:
make run-log - Run Output:
make run-output - Run a specific trace
make run TRACE=<trace_name>
- Build:
-r: Number of Result Busses-j: Number of k0 Functional Units-k: Number of k1 Functional Units-l: Number of k2 Functional Units-f: Fetch Width-v: Enable Logging-d: Enable Debug-o: Enable Output
The simulator supports the following traces:
- gcc
- gobmk
- hmmer
- mcf
- Configuration-based organization:
results/experiments/
└── R2_J3_K2_L1_F4/
├── gcc.output
├── gobmk.output
├── hmmer.output
└── mcf.output
- Trace-based organization:
results/
├── gcc/
│ ├── R2_J1_K1_L1_F2.output
│ ├── R2_J1_K1_L1_F4.output
│ └── ...
├── gobmk/
└── ...
- Build the simulator:
make- Run all traces with default configuration and check against golden:
./run_all.sh- Run experiments with different configurations:
./run_experiment.sh- Run a specific trace:
./procsim -r2 -f4 -j3 -k2 -l1 < traces/gcc.100k.trace > results/gcc.output- C++ compiler with C++11 support
- Make
- Bash shell
- The simulator implements a superscalar out-of-order processor
- Supports multiple functional units and pipeline stages
- Includes reorder buffer for maintaining instruction order
- Implements register renaming and dynamic scheduling
- Provides detailed performance statistics and pipeline state information