Skip to content

Commit 8e021ea

Browse files
committed
Formatting, SerDes interface.
1 parent 7689986 commit 8e021ea

Some content is hidden

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

41 files changed

+1196
-475
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.stl filter=lfs diff=lfs merge=lfs -text
2+
configs/traces/*.stl -filter=lfs -diff=lfs -merge=lfs -text
23
*.data.gz filter=lfs diff=lfs merge=lfs -text
34
*.inst.gz filter=lfs diff=lfs merge=lfs -text
45
*.tdb filter=lfs diff=lfs merge=lfs -text

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ DRAMSys/docs/doxygen
2727
cmake-build*
2828
.idea
2929
.cache
30+
.env

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2929
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
#
31-
# Authors:
31+
# Authors:
3232
# Thomas Psota
3333
# Lukas Steiner
3434

@@ -125,15 +125,19 @@ if(DRAMSYS_BUILD_TESTS)
125125
endif()
126126

127127
### SystemC ###
128-
list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME} /opt/systemc/)
128+
list(APPEND CMAKE_PREFIX_PATH $ENV{SYSTEMC_HOME})
129129
FetchContent_Declare(
130130
systemc
131131
GIT_REPOSITORY https://github.com/accellera-official/systemc.git
132132
GIT_TAG 2.3.4
133133
FIND_PACKAGE_ARGS NAMES SystemCLanguage)
134134

135135
set(DISABLE_COPYRIGHT_MESSAGE True)
136-
FetchContent_MakeAvailable(systemc)
136+
137+
# Allow populating of a user-set SystemC package
138+
if (NOT TARGET SystemC::systemc)
139+
FetchContent_MakeAvailable(systemc)
140+
endif()
137141

138142
### DRAMPower ###
139143
if (DRAMSYS_WITH_DRAMPOWER)

README.md

Lines changed: 43 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<img src="docs/images/dramsys_logo.png" width="350" style="float: left;" alt="DRAMSys Logo"/>
1+
<img src="docs/images/dramsys_logo.png" width="350" style="float: left;" alt="DRAMSys Logo"/>
22

33
**DRAMSys** is a flexible DRAM subsystem design space exploration framework based on SystemC TLM-2.0. It was developed by the [Microelectronic Systems Design Research Group](https://eit.rptu.de/en/fgs/ems/home/seite) at [RPTU Kaiserslautern-Landau](https://rptu.de/en/), by [Fraunhofer IESE](https://www.iese.fraunhofer.de/en.html) and by the [Computer Engineering Group](https://www.informatik.uni-wuerzburg.de/ce/) at [JMU Würzburg](https://www.uni-wuerzburg.de/en/home/).
44

@@ -39,19 +39,19 @@ The linked video shows the background of DRAMSys and some examples of how simula
3939

4040
## Trace Analyzer Consulting and Custom-Tailored Modifications
4141

42-
To provide better analysis capabilities for DRAM subsystem design space exploration than the usual performance-related outputs to the console, DRAMSys offers the Trace Analyzer.
42+
To provide better analysis capabilities for DRAM subsystem design space exploration than the usual performance-related outputs to the console, DRAMSys offers the Trace Analyzer.
4343

4444
All requests, responses and DRAM commands can be recorded in an SQLite trace database during a simulation and visualized with the tool afterwards. An evaluation of the trace databases can be performed with the powerful Python interface of the Trace Analyzer. Different metrics are described as SQL statements and formulas in Python, which can be customized or extended without recompilation.
4545

4646
The Trace Analyzer's main window is shown below.
4747

4848
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 [Matthias Jung](mailto:matthias.jung@iese.fraunhofer.de).
4949

50-
![Trace Analyzer Main Window](docs/images/traceanalyzer.png)
50+
![Trace Analyzer Main Window](docs/images/traceanalyzer.png)
5151

5252
## Basic Setup
5353

54-
To use DRAMSys, first clone the repository. Make sure that Git LFS is installed on your machine.
54+
To use DRAMSys, first clone the repository.
5555

5656
### Dependencies
5757

@@ -103,55 +103,67 @@ There are two ways to couple DRAMSys with **gem5**:
103103
- Use the official integration of DRAMSys in gem5. More information can be found in `ext/dramsys` of the gem5 repository.
104104
- (Deprecated) Compile gem5 as a shared library and link it with DRAMSys, which is only supported in older versions of DRAMSys (tag v4.0).
105105

106+
## Development
107+
Some additional development sources required for tests may be obtained using Git LFS.
108+
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
111+
```
112+
113+
To make the additional files available, run:
114+
```bash
115+
git lfs pull
116+
```
117+
106118
## Acknowledgements
107119

108-
The development of DRAMSys was supported by the German Research Foundation (DFG) as part of the priority program [Dependable Embedded Systems SPP1500](http://spp1500.itec.kit.edu) and the DFG grant no. [WE2442/10-1](https://www.uni-kl.de/en/3d-dram/). Furthermore, it was supported within the Fraunhofer and DFG cooperation program (grant no. [WE2442/14-1](https://www.iese.fraunhofer.de/en/innovation_trends/autonomous-systems/memtonomy.html)) and by the [Fraunhofer High Performance Center for Simulation- and Software-Based Innovation](https://www.leistungszentrum-simulation-software.de/en.html). Special thanks go to all listed contributors for their work and commitment during seven years of development.
109-
110-
Shama Bhosale
111-
Derek Christ
112-
Luiza Correa
113-
Peter Ehses
114-
Johannes Feldmann
115-
Robert Gernhardt
116-
Doris Gulai
117-
Matthias Jung
118-
Frederik Lauer
119-
Ana Mativi
120-
Felipe S. Prado
121-
Iron Prando
122-
Tran Anh Quoc
123-
Janik Schlemminger
124-
Lukas Steiner
125-
Thanh C. Tran
126-
Norbert Wehn
127-
Christian Weis
120+
The development of DRAMSys was supported by the German Research Foundation (DFG) as part of the priority program [Dependable Embedded Systems SPP1500](http://spp1500.itec.kit.edu) and the DFG grant no. [WE2442/10-1](https://www.uni-kl.de/en/3d-dram/). Furthermore, it was supported within the Fraunhofer and DFG cooperation program (grant no. [WE2442/14-1](https://www.iese.fraunhofer.de/en/innovation_trends/autonomous-systems/memtonomy.html)) and by the [Fraunhofer High Performance Center for Simulation- and Software-Based Innovation](https://www.leistungszentrum-simulation-software.de/en.html). Special thanks go to all listed contributors for their work and commitment during seven years of development.
121+
122+
Shama Bhosale
123+
Derek Christ
124+
Luiza Correa
125+
Peter Ehses
126+
Johannes Feldmann
127+
Robert Gernhardt
128+
Doris Gulai
129+
Matthias Jung
130+
Frederik Lauer
131+
Ana Mativi
132+
Felipe S. Prado
133+
Iron Prando
134+
Tran Anh Quoc
135+
Janik Schlemminger
136+
Lukas Steiner
137+
Thanh C. Tran
138+
Norbert Wehn
139+
Christian Weis
128140
Éder F. Zulian
129141

130142
## References
131143

132-
[1] TLM Modelling of 3D Stacked Wide I/O DRAM Subsystems, A Virtual Platform for Memory Controller Design Space Exploration
144+
[1] TLM Modelling of 3D Stacked Wide I/O DRAM Subsystems, A Virtual Platform for Memory Controller Design Space Exploration
133145
M. Jung, C. Weis, N. Wehn, K. Chandrasekar. International Conference on High-Performance and Embedded Architectures and Compilers 2013 (HiPEAC), Workshop on: Rapid Simulation and Performance Evaluation: Methods and Tools (RAPIDO), January, 2013, Berlin.
134146

135-
[2] DRAMSys4.0: A Fast and Cycle-Accurate SystemC/TLM-Based DRAM Simulator
147+
[2] DRAMSys4.0: A Fast and Cycle-Accurate SystemC/TLM-Based DRAM Simulator
136148
L. Steiner, M. Jung, F. S. Prado, K. Bykov, N. Wehn. International Conference on Embedded Computer Systems: Architectures, Modeling, and Simulation (SAMOS), July, 2020, Samos Island, Greece.
137149

138150
[3] DRAMSys4.0: An Open-Source Simulation Framework for In-Depth DRAM Analyses
139151
L. Steiner, M. Jung, F. S. Prado, K. Bykov, N. Wehn. International Journal of Parallel Programming (IJPP), Springer, 2022.
140152

141-
[4] DRAMPower: Open-source DRAM Power & Energy Estimation Tool
153+
[4] DRAMPower: Open-source DRAM Power & Energy Estimation Tool
142154
K. Chandrasekar, C. Weis, Y. Li, S. Goossens, M. Jung, O. Naji, B. Akesson, N. Wehn, K. Goossens. URL: http://www.drampower.info
143155

144-
[5] Optimized Active and Power-Down Mode Refresh Control in 3D-DRAMs
156+
[5] Optimized Active and Power-Down Mode Refresh Control in 3D-DRAMs
145157
M. Jung, M. Sadri, C. Weis, N. Wehn, L. Benini. VLSI-SoC, October, 2014, Playa del Carmen, Mexico.
146158

147-
[6] Retention Time Measurements and Modelling of Bit Error Rates of WIDE-I/O DRAM in MPSoCs
159+
[6] Retention Time Measurements and Modelling of Bit Error Rates of WIDE-I/O DRAM in MPSoCs
148160
C. Weis, M. Jung, P. Ehses, C. Santos, P. Vivet, S. Goossens, M. Koedam, N. Wehn. IEEE Conference Design, Automation and Test in Europe (DATE), March, 2015, Grenoble, France.
149161

150162
[7] Efficient Generation of Application Specific Memory Controllers
151163
M. V. Natale, M. Jung, K. Kraft, F. Lauer, J. Feldmann, C. Sudarshan, C. Weis, S. O. Krumke, N. Wehn. ACM/IEEE International Symposium on Memory Systems (MEMSYS 2020), October, 2020, virtual conference.
152164

153-
[8] Simulating DRAM controllers for future system architecture exploration
165+
[8] Simulating DRAM controllers for future system architecture exploration
154166
A. Hansson, N. Agarwal, A. Kolli, T. Wenisch, A. N. Udipi. IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), 2014, Monterey, USA.
155167

156-
[9] Fast Validation of DRAM Protocols with Timed Petri Nets
168+
[9] Fast Validation of DRAM Protocols with Timed Petri Nets
157169
M. Jung, K. Kraft, T. Soliman, C. Sudarshan, C. Weis, N. Wehn. ACM International Symposium on Memory Systems (MEMSYS 2019), October, 2019, Washington, DC, USA.

configs/simconfig/gem5_se.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"DatabaseRecording": true,
66
"Debug": false,
77
"EnableWindowing": true,
8-
"PowerAnalysis": true,
8+
"PowerAnalysis": false,
99
"SimulationName": "gem5_se",
1010
"SimulationProgressBar": true,
1111
"StoreMode": "Store",

requirements.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
matplotlib
2+
numpy
3+
pyvcd
4+
tqdm
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2023, RPTU Kaiserslautern-Landau
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* 3. Neither the name of the copyright holder nor the names of its
17+
* contributors may be used to endorse or promote products derived from
18+
* this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
24+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*
32+
* Author:
33+
* Derek Christ
34+
*/
35+
36+
#ifndef DEDESERIALIZE_H
37+
#define DEDESERIALIZE_H
38+
39+
#include <istream>
40+
41+
namespace DRAMSys
42+
{
43+
class Deserialize
44+
{
45+
protected:
46+
Deserialize() = default;
47+
Deserialize(const Deserialize&) = default;
48+
Deserialize(Deserialize&&) = default;
49+
Deserialize& operator=(const Deserialize&) = default;
50+
Deserialize& operator=(Deserialize&&) = default;
51+
52+
public:
53+
virtual ~Deserialize() = default;
54+
55+
virtual void deserialize(std::istream& stream) = 0;
56+
};
57+
58+
} // namespace DRAMSys
59+
60+
#endif
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
/*
2+
* Copyright (c) 2023, RPTU Kaiserslautern-Landau
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are
7+
* met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
*
12+
* 2. Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
*
16+
* 3. Neither the name of the copyright holder nor the names of its
17+
* contributors may be used to endorse or promote products derived from
18+
* this software without specific prior written permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
22+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
24+
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*
32+
* Author:
33+
* Derek Christ
34+
*/
35+
36+
#ifndef SERIALIZE_H
37+
#define SERIALIZE_H
38+
39+
#include <ostream>
40+
41+
namespace DRAMSys
42+
{
43+
class Serialize
44+
{
45+
protected:
46+
Serialize() = default;
47+
Serialize(const Serialize&) = default;
48+
Serialize(Serialize&&) = default;
49+
Serialize& operator=(const Serialize&) = default;
50+
Serialize& operator=(Serialize&&) = default;
51+
52+
public:
53+
virtual ~Serialize() = default;
54+
55+
virtual void serialize(std::ostream& stream) const = 0;
56+
};
57+
58+
} // namespace DRAMSys
59+
60+
#endif

src/libdramsys/DRAMSys/controller/Controller.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,16 @@ Controller::Controller(const sc_module_name& name,
273273
SC_REPORT_FATAL("Controller", "Selected refresh mode not supported!");
274274
}
275275

276+
bool Controller::idle() const
277+
{
278+
return totalNumberOfPayloads == 0;
279+
}
280+
281+
void Controller::registerIdleCallback(std::function<void()> idleCallback)
282+
{
283+
this->idleCallback = std::move(idleCallback);
284+
}
285+
276286
void Controller::controllerMethod()
277287
{
278288
if (isFullCycle(sc_time_stamp(), memSpec.tCK))
@@ -575,6 +585,11 @@ void Controller::manageResponses()
575585
if (totalNumberOfPayloads == 0)
576586
{
577587
idleTimeCollector.start();
588+
589+
if (idleCallback)
590+
{
591+
idleCallback();
592+
}
578593
}
579594
}
580595
else

src/libdramsys/DRAMSys/controller/Controller.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include <stack>
4949
#include <systemc>
5050
#include <tlm>
51+
#include <utility>
5152
#include <vector>
5253

5354
namespace DRAMSys
@@ -61,6 +62,9 @@ class Controller : public ControllerIF
6162
const AddressDecoder& addressDecoder);
6263
SC_HAS_PROCESS(Controller);
6364

65+
[[nodiscard]] bool idle() const override;
66+
void registerIdleCallback(std::function<void()> idleCallback);
67+
6468
protected:
6569
tlm::tlm_sync_enum nb_transport_fw(tlm::tlm_generic_payload& trans,
6670
tlm::tlm_phase& phase,
@@ -88,6 +92,7 @@ class Controller : public ControllerIF
8892

8993
private:
9094
unsigned totalNumberOfPayloads = 0;
95+
std::function<void()> idleCallback;
9196
ControllerVector<Rank, unsigned> ranksNumberOfPayloads;
9297
ReadyCommands readyCommands;
9398

0 commit comments

Comments
 (0)