Create working example for thermalsim.
This commit is contained in:
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"CONGEN": {
|
||||||
|
"BANK_BIT": [
|
||||||
|
4,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"BYTE_BIT": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"CHANNEL_BIT": [
|
||||||
|
25,
|
||||||
|
26
|
||||||
|
],
|
||||||
|
"COLUMN_BIT": [
|
||||||
|
6,
|
||||||
|
7,
|
||||||
|
8,
|
||||||
|
9,
|
||||||
|
10,
|
||||||
|
11,
|
||||||
|
12
|
||||||
|
],
|
||||||
|
"ROW_BIT": [
|
||||||
|
13,
|
||||||
|
14,
|
||||||
|
15,
|
||||||
|
16,
|
||||||
|
17,
|
||||||
|
18,
|
||||||
|
19,
|
||||||
|
20,
|
||||||
|
21,
|
||||||
|
22,
|
||||||
|
23,
|
||||||
|
24
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"PowerAnalysis": true,
|
"PowerAnalysis": true,
|
||||||
"SimulationName": "wideio",
|
"SimulationName": "wideio",
|
||||||
"SimulationProgressBar": true,
|
"SimulationProgressBar": true,
|
||||||
"StoreMode": "ErrorModel",
|
"StoreMode": "Store",
|
||||||
"ThermalSimulation": true,
|
"ThermalSimulation": true,
|
||||||
"UseMalloc": false,
|
"UseMalloc": false,
|
||||||
"WindowSize": 1000
|
"WindowSize": 1000
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"simulation": {
|
"simulation": {
|
||||||
"addressmapping": "am_wideio_4x256Mb_rbc.json",
|
"addressmapping": "am_wideio_thermal.json",
|
||||||
"mcconfig": "fr_fcfs.json",
|
"mcconfig": "fr_fcfs.json",
|
||||||
"memspec": "JEDEC_256Mb_WIDEIO-200_128bit.json",
|
"memspec": "JEDEC_256Mb_WIDEIO-200_128bit.json",
|
||||||
"simconfig": "wideio_thermal.json",
|
"simconfig": "wideio_thermal.json",
|
||||||
|
|||||||
@@ -33,35 +33,72 @@
|
|||||||
# Authors:
|
# Authors:
|
||||||
# Matthias Jung
|
# Matthias Jung
|
||||||
# Eder F. Zulian
|
# Eder F. Zulian
|
||||||
|
# Lukas Steiner
|
||||||
|
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
# Assuming this address mapping:
|
# Assuming this address mapping:
|
||||||
# <addressmapping>
|
# {
|
||||||
# <channel from="27" to="28" />
|
# "CONGEN": {
|
||||||
# <row from="14" to="26" />
|
# "BYTE_BIT": [
|
||||||
# <column from="7" to="13" />
|
# 0,
|
||||||
# <bank from="4" to="6" />
|
# 1,
|
||||||
# <bytes from="0" to="3" />
|
# 2,
|
||||||
# </addressmapping>
|
# 3
|
||||||
|
# ],
|
||||||
|
# "BANK_BIT": [
|
||||||
|
# 4,
|
||||||
|
# 5
|
||||||
|
# ],
|
||||||
|
# "COLUMN_BIT": [
|
||||||
|
# 6,
|
||||||
|
# 7,
|
||||||
|
# 8,
|
||||||
|
# 9,
|
||||||
|
# 10,
|
||||||
|
# 11,
|
||||||
|
# 12
|
||||||
|
# ],
|
||||||
|
# "ROW_BIT": [
|
||||||
|
# 13,
|
||||||
|
# 14,
|
||||||
|
# 15,
|
||||||
|
# 16,
|
||||||
|
# 17,
|
||||||
|
# 18,
|
||||||
|
# 19,
|
||||||
|
# 20,
|
||||||
|
# 21,
|
||||||
|
# 22,
|
||||||
|
# 23,
|
||||||
|
# 24
|
||||||
|
# ],
|
||||||
|
# "CHANNEL_BIT": [
|
||||||
|
# 25,
|
||||||
|
# 26
|
||||||
|
# ]
|
||||||
|
# }
|
||||||
|
# }
|
||||||
|
|
||||||
# This is how it should look like later:
|
# This is how it should look like later:
|
||||||
# 31: write 0x0 ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
# 31: write 0x0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
|
||||||
|
|
||||||
my $numberOfRows = 8192;
|
my $numberOfChannels = 4;
|
||||||
my $numberOfColumnsPerRow = 128;
|
my $numberOfRows = 4096;
|
||||||
|
my $numberOfColumns = 128;
|
||||||
my $bytesPerColumn = 16;
|
my $bytesPerColumn = 16;
|
||||||
my $burstLength = 4; # burst length of 4 columns --> 4 columns written or read per access
|
my $burstLength = 4; # burst length of 4 columns --> 4 columns written or read per access
|
||||||
my $dataLength = $bytesPerColumn * $burstLength;
|
my $dataLength = $bytesPerColumn * $burstLength;
|
||||||
|
|
||||||
my $rowOffset = 0x4000;
|
my $channelOffset = 0x2000000;
|
||||||
my $colOffset = 0x80;
|
my $rowOffset = 0x2000;
|
||||||
|
my $columnOffset = 0x40;
|
||||||
|
|
||||||
# Generate Data Pattern:
|
# Generate Data Pattern:
|
||||||
my $dataPatternByte = "ff";
|
my $dataPatternByte = "ff";
|
||||||
|
|
||||||
my $dataPattern = "";
|
my $dataPattern = "0x";
|
||||||
for(my $i = 0; $i < $dataLength; $i++)
|
for(my $i = 0; $i < $dataLength; $i++)
|
||||||
{
|
{
|
||||||
$dataPattern .= $dataPatternByte;
|
$dataPattern .= $dataPatternByte;
|
||||||
@@ -71,28 +108,34 @@ my $clkCounter = 0;
|
|||||||
my $addr = 0;
|
my $addr = 0;
|
||||||
|
|
||||||
# Generate Trace file (writes):
|
# Generate Trace file (writes):
|
||||||
for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset)
|
for(my $cha = 0; $cha < ($numberOfChannels * $channelOffset); $cha = $cha + $channelOffset)
|
||||||
{
|
{
|
||||||
for(my $col = 0; $col < ($numberOfColumnsPerRow * $colOffset); $col = $col + ($colOffset * $burstLength))
|
for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset)
|
||||||
{
|
{
|
||||||
my $addrHex = sprintf("0x%x", $addr);
|
for(my $col = 0; $col < ($numberOfColumns * $columnOffset); $col = $col + ($columnOffset * $burstLength))
|
||||||
print "$clkCounter:\twrite\t$addrHex\t$dataPattern\n";
|
{
|
||||||
$clkCounter++;
|
my $addrHex = sprintf("0x%x", $addr);
|
||||||
$addr += $colOffset * $burstLength;
|
print "$clkCounter:\twrite\t$addrHex\t$dataPattern\n";
|
||||||
|
$clkCounter++;
|
||||||
|
$addr += $columnOffset * $burstLength;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$clkCounter = 350000000;
|
$clkCounter = 50000000;
|
||||||
$addr = 0;
|
$addr = 0;
|
||||||
|
|
||||||
# Generate Trace file (reads):
|
# Generate Trace file (reads):
|
||||||
for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset)
|
for(my $cha = 0; $cha < ($numberOfChannels * $channelOffset); $cha = $cha + $channelOffset)
|
||||||
{
|
{
|
||||||
for(my $col = 0; $col < ($numberOfColumnsPerRow * $colOffset); $col = $col + ($colOffset * $burstLength))
|
for(my $row = 0; $row < ($numberOfRows * $rowOffset); $row = $row + $rowOffset)
|
||||||
{
|
{
|
||||||
my $addrHex = sprintf("0x%x", $addr);
|
for(my $col = 0; $col < ($numberOfColumns * $columnOffset); $col = $col + ($columnOffset * $burstLength))
|
||||||
print "$clkCounter:\tread\t$addrHex\t$dataPattern\n";
|
{
|
||||||
$clkCounter++;
|
my $addrHex = sprintf("0x%x", $addr);
|
||||||
$addr += $colOffset * $burstLength;
|
print "$clkCounter:\tread\t$addrHex\n";
|
||||||
|
$clkCounter++;
|
||||||
|
$addr += $columnOffset * $burstLength;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,11 +117,9 @@ Dram::~Dram()
|
|||||||
|
|
||||||
void Dram::reportPower()
|
void Dram::reportPower()
|
||||||
{
|
{
|
||||||
static bool alreadyCalled = false;
|
if (!powerReported)
|
||||||
|
|
||||||
if (!alreadyCalled)
|
|
||||||
{
|
{
|
||||||
alreadyCalled = true;
|
powerReported = true;
|
||||||
DRAMPower->calcEnergy();
|
DRAMPower->calcEnergy();
|
||||||
|
|
||||||
// Print the final total energy and the average power for
|
// Print the final total energy and the average power for
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ class Dram : public sc_module
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned int bytesPerBurst = Configuration::getInstance().getBytesPerBurst();
|
unsigned int bytesPerBurst = Configuration::getInstance().getBytesPerBurst();
|
||||||
|
bool powerReported = false;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Dram(sc_module_name);
|
Dram(sc_module_name);
|
||||||
|
|||||||
@@ -140,15 +140,15 @@ public:
|
|||||||
("Malformed trace file. Data information could not be found (line " + std::to_string(
|
("Malformed trace file. Data information could not be found (line " + std::to_string(
|
||||||
lineCnt) + ").").c_str());
|
lineCnt) + ").").c_str());
|
||||||
|
|
||||||
// Check if data length in the trace file is correct. We need two characters to represent 1 byte in hexadecimal.
|
// Check if data length in the trace file is correct. We need two characters to represent 1 byte in hexadecimal. Offset for 0x prefix.
|
||||||
if (dataStr.length() != (dataLength * 2))
|
if (dataStr.length() != (dataLength * 2 + 2))
|
||||||
SC_REPORT_FATAL("StlPlayer",
|
SC_REPORT_FATAL("StlPlayer",
|
||||||
("Data in the trace file has an invalid length (line " + std::to_string(
|
("Data in the trace file has an invalid length (line " + std::to_string(
|
||||||
lineCnt) + ").").c_str());
|
lineCnt) + ").").c_str());
|
||||||
|
|
||||||
// Set data
|
// Set data
|
||||||
for (unsigned i = 0; i < dataLength; i++)
|
for (unsigned i = 0; i < dataLength; i++)
|
||||||
data[i] = (unsigned char)std::stoi(dataStr.substr(i * 2, 2).c_str(), 0, 16);
|
data[i] = (unsigned char)std::stoi(dataStr.substr(i * 2 + 2, 2).c_str(), 0, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill up the payload.
|
// Fill up the payload.
|
||||||
|
|||||||
Reference in New Issue
Block a user