Some more features for NN DRAM modeling

This commit is contained in:
Matthias Jung
2018-04-12 13:47:48 +02:00
parent ffdbf3ed3a
commit 41dad5ce00
4 changed files with 96 additions and 1 deletions

View File

@@ -172,4 +172,5 @@ DISTFILES += \
$$PWD/configs/simulator/lpddr4.xml \
$$PWD/simulations/lpddr4-single-device.xml \
$$PWD/configs/amconfigs/am_lpddr4.xml \
$$PWD/configs/memspecs/MICRON_6Gb_LPDDR4-3200_NDA_NDA_NDA.xml
$$PWD/configs/memspecs/MICRON_6Gb_LPDDR4-3200_NDA_NDA_NDA.xml \
$$PWD/scripts/traceGenerationForNNTraining.pl

View File

@@ -0,0 +1,31 @@
#!/usr/bin/perl
use warnings;
use strict;
my $phaseLength = 100;
my $phaseStatus = 0;
my $max = 100000;
my $base = 0;
my $maxAddressExp = 26;
my $maxAddress = 2**$maxAddressExp;
for(my $i = 0; $i < $max; $i++)
{
if($phaseStatus == 0) # Linear
{
my $addr = (($base << 6) + (($i % $phaseLength) << 6)) % $maxAddress;
print "$i: read 0x".sprintf("%x", $addr)."\n";
}
else # Random
{
my $addr = (rand(2**($maxAddressExp-6))) << 6;
print "$i: read 0x".sprintf("%x", $addr)."\n";
}
if($i % 100 == 0 && $i != 0)
{
$phaseStatus = ($phaseStatus == 0) ? 1 : 0;
$base = rand(2**($maxAddressExp-6));
}
}

View File

@@ -0,0 +1,62 @@
#!/bin/perl -w
use DBI;
use Data::Dumper;
use warnings;
use strict;
# In order to run this script you need to install:
# - cpan install DBI
# - cpan install DBD::SQLite
my $dbfile = shift || die("No File");
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbfile","","");
my $sth = $dbh->prepare("select t.ID, t.address, p.PhaseName, p.PhaseBegin, p.PhaseEnd
from Transactions t, Phases p
where t.ID = p.Transact
and (PhaseName='REQ' or PhaseName='RESP');");
$sth->execute();
my @score;
my @timelog;
my $counter = 0;
my $start = 0;
print "address, delay\n";
while(my @row = $sth->fetchrow_array)
{
my $id = $row[0];
my $phase = $row[2];
my $addr = $row[1];
if($phase eq "REQ")
{
$start = $row[4];
$timelog[$counter] = $start;
}
elsif($phase eq "RESP")
{
my $end = $row[3];
my $delay = $end - $start;
#if($counter > 1)
#{
#print relative time:
#print ($timelog[$counter] - $timelog[$counter-1]);
#print ", ";
#print address
print $addr;
print ", ";
#print delay
print $delay;
print "\n";
#}
#$counter++;
}
}

View File

@@ -6,4 +6,5 @@ OTHER_FILES += scripts/metrics.py
OTHER_FILES += scripts/tests.py
OTHER_FILES += scripts/plots.py
OTHER_FILES += scripts/sonification.pl
OTHER_FILES += scripts/dataExtractForNN.pl