How tukl-msd/dramsys works
Project Type and Purpose
• DRAMSys is not a traditional full‐stack web application but a modular simulation framework and analysis tool.
• It consists of:
• A SystemC/TLM-2.0 library (“libdramsys”) exposing cycle-accurate DRAM subsystem models
• A standalone CLI simulator that exercises the library with traffic generators or trace playback
• A Qt-based Trace Analyzer GUI that visualizes and analyzes recorded simulation traces stored in SQLite
• Users supply JSON configuration files (in configs/) to parameterize device models, address mapping, memory controller policies, and simulators.
File Structure Analysis
• Top‐level directories:
• cmake: CMake find scripts and build helpers
• configs: JSON files for address mapping, memspec, controller policies, simulation setups, traces
• lib/sqlite3: embedded SQLite for trace storage
• src/configuration: configuration‐file parser wrapping JSON → C++ objects
• src/libdramsys: core library implementing DRAMSysConfiguration, MemSpec, AddressMapping, Controller, Scheduler, Refresh, PowerDown managers, TLM recorders, and the simulation orchestrator
• src/simulator: CLI application linking libdramsys and configuration layer, invoking the TLM simulation
• src/traceAnalyzer: Qt5 GUI and Python facade that reads the SQLite trace DB, computes metrics via SQL/Python, and renders plots/widgets
• Configuration is decoupled from simulation logic; the simulator and Trace Analyzer both consume it via the configuration layer.
Main Components and Interactions
• Configuration Layer
→ Reads JSON configs → Instantiates MemSpec, McConfig, AddressMapping, SimConfig, TraceSetup objects
• DRAMSys Core Library (SystemC/TLM-2.0)
• MemSpec modules model DRAM device timing parameters
• AddressDecoder maps transactions to DRAM addresses
• Controller submodules (BankMachine, Scheduler, RefreshManager, PowerDownManager, CmdMux, Checker) implement protocol behavior
• TLM recorders capture requests/responses/commands (DramATRecorder, TlmRecorder)
• Arbiter, DRAM model, and SimConfig glue logic drive the simulation loop
→ Exposes TLM-2.0 sockets for integration or standalone use
• Simulator CLI (main.cpp)
→ Initializes SystemC, loads configuration, instantiates DRAMSys top module, runs simulation, writes trace DB
• Trace Analyzer GUI
→ Qt frontend loads the SQLite trace, uses businessObjects to map DB rows → in-memory objects
→ Python caller computes custom metrics, GUI widgets render plots, trees, navigators
• External Integration
• Coupling to gem5 (via TLM sockets or shared‐library interface)
• Optional DRAMPower for power estimation
Architectural Patterns and Principles
• Layered pattern: Configuration → Core library → Front-ends (CLI, GUI)
• Plugin-style or policy‐based design for controller schedulers and refresh strategies (interfaces + multiple implementations)
• Separation of concerns:
• Model (libdramsys) vs. Presentation (Trace Analyzer Qt UI) vs. Configuration
• Storage (SQLite) decoupled from analysis (Python/Qt)
• Use of SystemC TLM-2.0 for module interconnect and timed simulation