How anubhavbhatla/maya-cache works
Major Components
• Performance Evaluation Module (performance-analysis):
– Contains simulation subprojects (notably “maya” and “mirage”) with source code, build scripts (compile.sh, Makefile), and specialized directories for cache, branch predictors, prefetchers, and replacement policies.
– Includes tools for generating simulation binaries, running long-time simulations (run.sh, run_1core_gap.sh, etc.), and plotting simulation results (plot.sh).
– Uses external data dependencies like GAP traces and SPEC CPU benchmarks, whose location is referenced in the README.
• Security Evaluation Module (security-analysis):
– Contains its own build scripts (Makefile) and programs (C++ code in src such as security_maya.cpp) used to compile and run security simulations.
– Has dedicated scripts (run.sh, plot.py) for executing the simulations and generating security-related plots.
• Shared Tools/Global Artifacts:
– Top-level scripts like requirements.txt (for Python dependencies), trace scripts, and overall run scripts.
– Configuration and dependency management (instructions in the README detail how to download traces and run the appropriate scripts).
Relationships and Data Flow
• The simulation flow begins with the acquisition of necessary input traces (GAP and SPEC benchmarks). These inputs feed into both performance and security simulation engines.
• In the performance module, the simulation binaries (in “maya” and “mirage”) are generated by compiling the source code. Simulation runs are orchestrated using various run scripts, and the results (text files, CSV files, logs) are collected in “original_results” subdirectories.
• The output from the simulation binaries then is processed by plotting scripts (plot.sh) to generate the final graphs (such as fig1.pdf and fig10.pdf) as indicated in the README.
• In parallel, the security module follows a similar build-run-plot cycle, using Makefile builds, simulation execution (run.sh), and Python plotting (plot.py) to produce its results (fig7.pdf, fig8.pdf).
Architectural Patterns and Technologies
• The project follows a modular structure by separating performance analysis from security evaluation. In the performance module the simulation subprojects (“maya” and “mirage”) are further divided into components according to their simulation functionality (branch predictors, prefetchers, etc.).
• Design principles include separation of concerns (evaluation of performance versus security), script-driven automation (using shell/Python scripts to drive the workflow), and dependency on external data artifacts.
• Technologies include C/C++ for simulation engine implementations, Make and shell scripting for builds/automation, and Python (via requirements.txt and plot.py) for plotting and analysis.
Final Touches
• Provide annotations or notes indicating that certain modules (e.g., the “maya” and “mirage” components) are part of a comprehensive simulation framework geared toward evaluating high-performance cache architectures.
• Mention that the simulation process is long-running (the README states 5-6 days) and that the interdependencies, such as the need to download traces manually, are critical to the system design.