Skip to content

Commit caf5845

Browse files
committed
Open-source base version of Trace Analyzer
1 parent 7222c73 commit caf5845

File tree

275 files changed

+17803
-3441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

275 files changed

+17803
-3441
lines changed

CMakeLists.txt

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ set(DRAMSYS_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configs")
8989
set(DRAMSYS_EXTENSIONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extensions")
9090

9191
### Build options ###
92-
option(DRAMSYS_BUILD_TESTS "Build DRAMSys unit tests" OFF)
92+
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
93+
9394
option(DRAMSYS_VERBOSE_CMAKE_OUTPUT "Show detailed CMake output" OFF)
95+
option(DRAMSYS_BUILD_TESTS "Build DRAMSys unit tests" OFF)
96+
option(DRAMSYS_BUILD_BENCHMARKS "Build DRAMSys benchmarks" OFF)
9497
option(DRAMSYS_BUILD_CLI "Build DRAMSys Command Line Tool" ON)
98+
option(DRAMSYS_BUILD_TRACE_ANALYZER "Build DRAMSys Trace Analyzer" OFF)
9599
option(DRAMSYS_WITH_DRAMPOWER "Build with DRAMPower support enabled." OFF)
96-
option(DRAMSYS_ENABLE_EXTENSIONS "Enable proprietary DRAMSys extensions." OFF)
100+
option(DRAMSYS_USE_EXTERNAL_SYSTEMC "Use an external SystemC installation." OFF)
97101

98102
###############################################
99103
### Library Settings ###
@@ -124,21 +128,43 @@ if(DRAMSYS_BUILD_TESTS)
124128
set_target_properties(gtest_main PROPERTIES FOLDER lib/gtest)
125129
endif()
126130

131+
### GoogleBenchmark ###
132+
if(DRAMSYS_BUILD_BENCHMARKS)
133+
set(BENCHMARK_ENABLE_TESTING OFF)
134+
135+
FetchContent_Declare(
136+
benchmark
137+
URL https://github.com/google/benchmark/archive/refs/tags/v1.8.3.zip
138+
)
139+
140+
FetchContent_MakeAvailable(benchmark)
141+
endif()
142+
127143
### SystemC ###
128-
list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME})
144+
if (DRAMSYS_USE_EXTERNAL_SYSTEMC)
145+
list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME} /opt/systemc)
146+
find_package(systemc NAMES SystemCLanguage)
147+
endif()
148+
129149
FetchContent_Declare(
130150
systemc
131151
GIT_REPOSITORY https://github.com/accellera-official/systemc.git
132-
GIT_TAG 2.3.4
133-
FIND_PACKAGE_ARGS NAMES SystemCLanguage)
152+
GIT_TAG 2.3.4)
134153

135154
set(DISABLE_COPYRIGHT_MESSAGE True)
136155

137156
# Allow populating of a user-set SystemC package
138157
if (NOT TARGET SystemC::systemc)
139158
FetchContent_MakeAvailable(systemc)
159+
160+
# Set include directories to SYSTEM to suppress warnings
161+
set_target_properties(systemc PROPERTIES SYSTEM TRUE)
162+
else()
163+
# Set include directories to SYSTEM to suppress warnings
164+
set_target_properties(SystemC::systemc PROPERTIES SYSTEM TRUE)
140165
endif()
141166

167+
142168
### DRAMPower ###
143169
if (DRAMSYS_WITH_DRAMPOWER)
144170
FetchContent_Declare(
@@ -162,10 +188,12 @@ if(DRAMSYS_BUILD_CLI)
162188
add_subdirectory(src/simulator)
163189
endif()
164190

165-
if(DRAMSYS_ENABLE_EXTENSIONS)
166-
dramsys_enable_extensions()
191+
if(DRAMSYS_BUILD_TRACE_ANALYZER)
192+
add_subdirectory(src/traceAnalyzer)
167193
endif()
168194

195+
dramsys_enable_extensions()
196+
169197
###############################################
170198
### Test Directory ###
171199
###############################################
@@ -175,3 +203,11 @@ if(DRAMSYS_BUILD_TESTS)
175203
include(CTest)
176204
add_subdirectory(tests)
177205
endif()
206+
207+
###############################################
208+
### Benchmark Directory ###
209+
###############################################
210+
211+
if(DRAMSYS_BUILD_BENCHMARKS)
212+
add_subdirectory(benches)
213+
endif()

CMakePresets.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"inherits": "cmake-pedantic",
2323
"cacheVariables": {
2424
"DRAMSYS_BUILD_TESTS": "ON",
25-
"DRAMSYS_ENABLE_EXTENSIONS": "ON",
26-
"DRAMSYS_WITH_DRAMPOWER": "ON"
25+
"DRAMSYS_WITH_DRAMPOWER": "ON",
26+
"DRAMSYS_BUILD_TRACE_ANALYZER": "ON"
2727
}
2828
},
2929
{
@@ -62,16 +62,16 @@
6262
},
6363
{
6464
"name": "dev",
65-
"generator": "Unix Makefiles",
65+
"generator": "Ninja",
6666
"binaryDir": "${sourceDir}/build",
6767
"inherits": [
6868
"dev-mode",
6969
"std"
7070
],
7171
"cacheVariables": {
7272
"CMAKE_BUILD_TYPE": "Debug",
73-
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic"
73+
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -fdiagnostics-color=always"
7474
}
7575
}
7676
]
77-
}
77+
}

NOTICE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
NOTICE
2+
3+
This software uses the following third-party libraries:
4+
5+
1. SQLite3
6+
License: Public Domain
7+
License URL: https://www.sqlite.org/copyright.html
8+
9+
2. NLohmann JSON
10+
License: MIT
11+
License URL: https://github.com/nlohmann/json/blob/develop/LICENSE.MIT
12+
13+
3. SystemC
14+
License: Apache-2.0
15+
License URL: https://github.com/accellera-official/systemc/blob/main/LICENSE
16+
17+
4. Qt5
18+
License: LGPL-3.0-only
19+
License URL: https://doc.qt.io/qt-5/lgpl.html
20+
21+
5. Qwt6 (Qt Widgets for Technical Applications)
22+
License: Qwt License (based on LGPL-2.1)
23+
License URL: https://qwt.sourceforge.io/qwtlicense.html
24+
25+
6. Google Test
26+
License: BSD-3-Clause
27+
License URL: https://github.com/google/googletest/blob/main/LICENSE
28+
29+
7. Google Benchmark
30+
License: Apache-2.0
31+
License URL: https://github.com/google/benchmark/blob/main/LICENSE
32+
33+
8. Pybind11
34+
License: BSD-3-Clause
35+
License URL: https://github.com/pybind/pybind11/blob/master/LICENSE

README.md

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ If you decide to use DRAMSys in your research please cite the paper [2] or [3].
1515
## Included Features
1616

1717
- **Standalone** simulator with trace players and traffic generators or **TLM-2.0-compliant library**
18+
- **Trace Analyzer** for visual and metric-based result analysis
1819
- Coupling to **gem5** supported
1920
- Cycle-accurate **DDR3/4**, **LPDDR4**, **Wide I/O 1/2**, **GDDR5/5X/6** and **HBM1/2** modelling
2021
- Bit-granular address mapping with optional XOR connections [7]
@@ -28,7 +29,7 @@ If you decide to use DRAMSys in your research please cite the paper [2] or [3].
2829
## Additional Features
2930

3031
- Cycle-accurate **DDR5**, **LPDDR5** and **HBM3** modelling
31-
- **Trace Analyzer** for visual and metric-based result analysis
32+
- Extended analysis features for the **Trace Analyzer**
3233
- **Free academic** or **commercial** licenses available (please contact [DRAMSys@iese.fraunhofer.de](mailto:DRAMSys@iese.fraunhofer.de) for more information)
3334

3435
## Video
@@ -45,7 +46,15 @@ All requests, responses and DRAM commands can be recorded in an SQLite trace dat
4546

4647
The Trace Analyzer's main window is shown below.
4748

48-
If you are interested in the Trace Analyzer, if you need support with the setup of DRAMSys in a virtual platform of your company, or if you require custom modifications of the simulator please contact [DRAMSys@iese.fraunhofer.de](mailto:DRAMSys@iese.fraunhofer.de).
49+
A basic version of Trace Analyzer is included in the open source release of DRAMSys.
50+
However, the full version of the Trace Analyzer includes many additional analysis features:
51+
- Detailed transaction-level latency analysis
52+
- Power, bandwidth, and buffer utilization analysis over simulation time intervals
53+
- Timing dependency analysis at the DRAM command level
54+
- Calculation of numerous predefined and user-defined metrics
55+
- VCD export of generated trace
56+
57+
If you are interested in the full version of Trace Analyzer, if you need support with the setup of DRAMSys in a virtual platform of your company, or if you require custom modifications of the simulator please contact [DRAMSys@iese.fraunhofer.de](mailto:DRAMSys@iese.fraunhofer.de).
4958

5059
![Trace Analyzer Main Window](docs/images/traceanalyzer.png)
5160

@@ -55,29 +64,39 @@ To use DRAMSys, first clone the repository.
5564

5665
### Dependencies
5766

58-
DRAMSys requires a **C++17** compiler. The build process is based on **CMake** (minimum version **3.24**). Furthermore, the simulator is based on **SystemC**. SystemC is included with FetchContent and will be build automatically with the project. If you want to use a preinstalled SystemC version, export the environment variable `SYSTEMC_HOME` (SystemC installation directory). Also make sure that the SystemC library was built with the same C++ version.
67+
DRAMSys requires a **C++17** compiler. The build process is based on **CMake** (minimum version **3.24**). Furthermore, the simulator is based on **SystemC**. SystemC is included with FetchContent and will be build automatically with the project. If you want to use a preinstalled SystemC version, export the environment variable `SYSTEMC_HOME` (SystemC installation directory) and enable the `DRAMSYS_USE_EXTERNAL_SYSTEMC` CMake option. Also make sure that the SystemC library was built with the same C++ version.
68+
69+
If you choose to enable the compilation of the Trace Analyzer, a system installation of development packages for Qt5, Qwt and Python is required.
70+
For example, on Ubuntu, these dependencies can be satisfied by installing the `qtbase5-dev`, `libqwt-qt5-dev` and `python3-dev` packages.
5971

6072
### Building DRAMSys
6173

62-
To build the standalone simulator for running memory trace files or traffic generators, create a build folder in the project root directory, then run CMake and make:
74+
To build the standalone simulator for running memory trace files or traffic generators, first configure the project using CMake, then build the project:
6375

64-
```bash
76+
```console
6577
$ cd DRAMSys
66-
$ mkdir build
67-
$ cd build
68-
$ cmake ..
69-
$ make
78+
$ cmake -S . -B build
79+
$ cmake --build build
80+
```
81+
82+
To include **DRAMPower** in your build enable the CMake option `DRAMSYS_WITH_DRAMPOWER`:
83+
```console
84+
$ cmake -B build -D DRAMSYS_WITH_DRAMPOWER=Y
7085
```
7186

72-
To include **DRAMPower** in your build enable the CMake option `DRAMSYS_WITH_DRAMPOWER`. If you plan to integrate DRAMSys into your own SystemC TLM-2.0 project you can build only the DRAMSys library by disabling the CMake option `DRAMSYS_BUILD_CLI`.
87+
If you plan to integrate DRAMSys into your own SystemC TLM-2.0 project you can build only the DRAMSys library by disabling the CMake option `DRAMSYS_BUILD_CLI`.
88+
89+
To include the Trace Analyzer in the build process, enable the CMake option `DRAMSYS_BUILD_TRACE_ANALYZER`.
90+
91+
In order to include any proprietary extensions such as the extended features of Trace Analyzer, enable the CMake option `DRAMSYS_ENABLE_EXTENSIONS`.
7392

7493
To build DRAMSys on Windows 10 we recommend to use the **Windows Subsystem for Linux (WSL)**.
7594

7695
### Executing DRAMSys
7796

7897
From the build directory use the commands below to execute the DRAMSys standalone.
7998

80-
```bash
99+
```console
81100
$ cd bin
82101
$ ./DRAMSys
83102
```
@@ -86,35 +105,42 @@ The default configuration file is *ddr4-example.json* located in *configs/*, the
86105

87106
To run DRAMSys with a specific configuration file:
88107

89-
```bash
108+
```console
90109
$ ./DRAMSys ../../configs/lpddr4-example.json
91110
```
92111

93112
To run DRAMSys with a specific configuration file and configuration folder:
94113

95-
```bash
114+
```console
96115
$ ./DRAMSys ../../tests/tests_regression/DDR3/ddr3-example.json ../../tests/tests_regression/DDR3/
97116
```
98117

99118
More information on the configuration can be found [here](configs/README.md).
100119

101120
## gem5 Coupling
121+
102122
There are two ways to couple DRAMSys with **gem5**:
103123
- Use the official integration of DRAMSys in gem5. More information can be found in `ext/dramsys` of the gem5 repository.
104124
- (Deprecated) Compile gem5 as a shared library and link it with DRAMSys, which is only supported in older versions of DRAMSys (tag v4.0).
105125

106126
## Development
127+
107128
Some additional development sources required for tests may be obtained using Git LFS.
108129
Make sure to have Git LFS installed through your system's package manager and set up for your user:
109-
```bash
110-
git lfs install
130+
```console
131+
$ git lfs install
111132
```
112133

113134
To make the additional files available, run:
114-
```bash
115-
git lfs pull
135+
```console
136+
$ git lfs pull
116137
```
117138

139+
## Third-party libraries
140+
141+
This application uses several third-party libraries.
142+
For detailed license information, please refer to the [NOTICE](NOTICE) file.
143+
118144
## Contact Information
119145

120146
Further questions about the simulator and the Trace Analyzer can be directed to:

configs/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,15 @@ An example follows.
273273
- "Fifo": first in, first out policy
274274
- "FrFcfs": first-ready - first-come, first-served policy (row hits are preferred to row misses)
275275
- "FrFcfsGrp": first-ready - first-come, first-served policy with additional grouping of read and write requests
276+
- "GrpFrFcfs": grouping of read and write requests has higher priority than grouping of page hits (reverse of "FrFcfsGrp"), **experimental without hazard detection**
277+
- "GrpFrFcfsWm": "GrpFrFcfs" scheduler with watermarks to switch between read and write mode, **experimental without hazard detection**
278+
- *LowWatermark* (unsigned int), *HighWatermark* (unsigned int)
279+
- watermarks of "GrpFrFcfsWm" scheduler
276280
- *SchedulerBuffer* (string)
277-
- "Bankwise": requests are stored in bankwise buffers
278-
- "ReadWrite": read and write requests are stored in different buffers
279-
- "Shared": all requests are stored in one shared buffer
280-
- *RequestBufferSize* (unsigned int)
281+
- "Bankwise": requests are stored in bankwise buffers (buffer depth is configured with parameter *RequestBufferSize*)
282+
- "ReadWrite": read and write requests are stored in two separate buffers (buffer depth is configured with parameters *RequestBufferSizeRead* and *RequestBufferSizeWrite*)
283+
- "Shared": all requests are stored in one shared buffer (buffer depth is configured with parameter *RequestBufferSize*)
284+
- *RequestBufferSize* (unsigned int), *RequestBufferSizeRead* (unsigned int), *RequestBufferSizeWrite* (unsigned int)
281285
- depth of a single scheduler buffer entity, total buffer depth depends on the selected scheduler buffer policy
282286
- *CmdMux* (string)
283287
- "Oldest": from all commands that are ready to be issued in the current clock cycle the one that belongs to the oldest transaction has the highest priority; commands from refresh managers have a higher priority than all other commands, commands from power down managers have a lower priority than all other commands

configs/memspec/HBM2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"WTRS": 4,
4343
"XP": 8,
4444
"XS": 216,
45-
"clkMhz": 1000
45+
"tCK": 1000
4646
}
4747
}
4848
}

configs/memspec/JEDEC_1Gbx16_LPDDR4-0533.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"XP": 5,
4747
"XSR": 104,
4848
"RTRS": 1,
49-
"clkMhz": 266
49+
"tCK": 3759
5050
}
5151
}
5252
}

configs/memspec/JEDEC_1Gbx16_LPDDR4-1066.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"XP": 5,
4747
"XSR": 207,
4848
"RTRS": 1,
49-
"clkMhz": 533
49+
"tCK": 1876
5050
}
5151
}
5252
}

configs/memspec/JEDEC_1Gbx16_LPDDR4-1600.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"XP": 6,
4747
"XSR": 310,
4848
"RTRS": 1,
49-
"clkMhz": 800
49+
"tCK": 1250
5050
}
5151
}
5252
}

configs/memspec/JEDEC_1Gbx16_LPDDR4-2133.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"XP": 9,
4747
"XSR": 414,
4848
"RTRS": 1,
49-
"clkMhz": 1066
49+
"tCK": 938
5050
}
5151
}
5252
}

0 commit comments

Comments
 (0)