How ramisheikh/cbp2025 works
Main Simulator Engine
• Central executable (built via Makefile) which is “cbp”. This component is responsible for running simulations, processing trace files, and printing detailed simulation outputs (e.g., branch mispredictions, IPC, cache behavior, etc.).
• This engine’s workflow starts with trace input (from sample_traces) and ends with output logs/statistics.
Branch Predictor Interface Module
• Interfaces defined in cbp.h along with the implementation provided in cond_branch_predictor_interface.cc. This module defines the lifecycle methods (e.g., beginCondDirPredictor, notify_instr_fetch, get_cond_dir_prediction, etc.) that guide how branch predictions are made as instructions move through the simulated CPU pipeline.
• That these interfaces are static and unchangeable even though contestants may modify the actual prediction logic.
Competitor-Supplied Predictor(s)
• Contestant-developed branch predictor files: my_cond_branch_predictor.h and my_cond_branch_predictor.cc.
• Pre-integrated benchmark predictor (cbp2016_tage_sc_l.h) which is offered as a starting point. Also, indicate that contestants may combine or replace this with their own predictor according to specific memory budget constraints.
• That this predictor module interacts directly with the branch predictor interface module.
Supporting Libraries and Utilities
• “lib” directory as a collection of helper libraries. Mention core library files like bp.cc/h, cache.cc/h, parameters.cc/h, etc. This layer includes:
• CPU pipeline simulation support (e.g., resource_schedule.cc/h, sim_common_structs.h)
• Additional simulation components (e.g., prefetcher, uarchsim) that might be used to simulate cache/memory behavior.
• Spdlog subdirectory (logging, formatting, sinks) as a utility for detailed logging across the simulator.
• Usage of gzstream for stream compressed trace file input.
Trace and Output Handling
• An output component where the simulator writes logs and statistical data, and note that a Python script (scripts/trace_exec_training_list.py) parses these logs to generate CSV summaries.
• That trace files and results flow in and out of the simulator and testing harness.
Interactions and Data Flow
• From Trace Input to the Main Simulator Engine.
• Inside the simulator, show internal calls from the engine to the Branch Predictor Interface as instructions progress through pipeline stages.
• From the Branch Predictor interface to the Contestant-supplied Predictor module.
• That statistical metrics (misprediction counts, IPC, cache stats, etc.) are gathered by the simulation engine and then output to both logs and further processed by the Python script.
Architectural Patterns and Principles
• That the design is modular, with clear separation between the simulation engine and the prediction components.
• The simulator uses a plug-in pattern where the branch predictor logic is abstracted behind fixed interfaces (allowing contestants to build and modify predictors without affecting the core simulation flow).
• The usage of a rich library (with spdlog and gzstream) indicates a layered design and integration of third-party components for logging and I/O.