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