Merge remote branch 'upstream/master'

This commit is contained in:
sprado
2018-02-27 15:26:02 +01:00
4 changed files with 85 additions and 5 deletions

View File

@@ -23,7 +23,9 @@ CREATE TABLE GeneralInfo(
MCconfig TEXT,
Memspec TEXT,
Traces TEXT,
WindowSize INTEGER
WindowSize INTEGER,
FlexibleRefresh INTEGER,
MaxRefBurst INTEGER
);
CREATE TABLE Power(

View File

@@ -285,8 +285,8 @@ void TlmRecorder::prepareSqlStatements()
updatePhaseString =
"UPDATE Phases SET PhaseEnd = :end WHERE Transact = :trans AND PhaseName = :name";
insertGeneralInfoString =
"INSERT INTO GeneralInfo (NumberOfTransactions,TraceEnd,NumberOfBanks,clk,UnitOfTime,MCconfig,Memspec,Traces, WindowSize) VALUES"
"(:numberOfTransactions,:end,:numberOfBanks,:clk,:unitOfTime,:mcconfig,:memspec,:traces,:windowSize)";
"INSERT INTO GeneralInfo (NumberOfTransactions,TraceEnd,NumberOfBanks,clk,UnitOfTime,MCconfig,Memspec,Traces, WindowSize, FlexibleRefresh, MaxRefBurst) VALUES"
"(:numberOfTransactions,:end,:numberOfBanks,:clk,:unitOfTime,:mcconfig,:memspec,:traces,:windowSize, :flexibleRefresh, :maxRefBurst)";
insertDebugMessageString = "INSERT INTO DebugMessages (Time,Message) Values (:time,:message)";
insertPowerString = "INSERT INTO Power VALUES (:time,:averagePower)";
@@ -319,11 +319,20 @@ void TlmRecorder::insertGeneralInfo()
sqlite3_bind_text(insertGeneralInfoStatement, 6, mcconfig.c_str(), mcconfig.length(), NULL);
sqlite3_bind_text(insertGeneralInfoStatement, 7, memspec.c_str(), memspec.length(), NULL);
sqlite3_bind_text(insertGeneralInfoStatement, 8, traces.c_str(), traces.length(), NULL);
if(!Configuration::getInstance().EnableWindowing)
if (!Configuration::getInstance().EnableWindowing)
sqlite3_bind_int64(insertGeneralInfoStatement, 9, 0);
else
sqlite3_bind_int64(insertGeneralInfoStatement, 9, (Configuration::getInstance().memSpec.clk*Configuration::getInstance().WindowSize).value());
if (Configuration::getInstance().ControllerCoreEnableRefPostpone || Configuration::getInstance().ControllerCoreEnableRefPullIn)
{
sqlite3_bind_int(insertGeneralInfoStatement, 10, 1);
sqlite3_bind_int(insertGeneralInfoStatement, 11, std::max(Configuration::getInstance().ControllerCoreMaxPulledInARCmd, Configuration::getInstance().ControllerCoreMaxPostponedARCmd));
}
else
{
sqlite3_bind_int(insertGeneralInfoStatement, 10, 0);
sqlite3_bind_int(insertGeneralInfoStatement, 11, 0);
}
executeSqlStatement(insertGeneralInfoStatement);
}

View File

@@ -76,3 +76,17 @@ def maximum_data_rate(connection):
rate = memspec.getValue("dataRate")
maxDataRate = float(clk)*float(width)*float(rate)
return maxDataRate
def getFlexibleRef(connection):
cursor = connection.cursor()
cursor.execute(" SELECT FlexibleRefresh FROM GeneralInfo ")
result = cursor.fetchone()
return result[0]
def getMaxRefBurst(connection):
cursor = connection.cursor()
cursor.execute(" SELECT MaxRefBurst FROM GeneralInfo ")
result = cursor.fetchone()
return result[0]

View File

@@ -39,6 +39,7 @@ class DramConfig(object):
tXSRDLL = 0 # min delay to row access command after srefx for dll commands
tAL = 0 # additive delay (delayed execution in dram)
tRFC = 0 # min ref->act delay
tREFI = 0 # time between REF commands
def readConfigFromFiles(self, connection):
print("Parsing dram configuration")
@@ -83,6 +84,7 @@ class DramConfig(object):
self.tXSRDLL = self.tXSR
self.tAL = self.clk * memspec.getIntValue("AL")
self.tRFC = self.clk * memspec.getIntValue("RFC")
self.tREFI = self.clk * memspec.getIntValue("REFI")
elif (self. memoryType == "DDR4"):
self.nActivateWindow = 4
@@ -109,6 +111,7 @@ class DramConfig(object):
self.tXSRDLL = self.clk * memspec.getIntValue("XSDLL")
self.tAL = self.clk * memspec.getIntValue("AL")
self.tRFC = self.clk * memspec.getIntValue("RFC")
self.tREFI = self.clk * memspec.getIntValue("REFI")
elif (self. memoryType == "DDR3"):
self.nActivateWindow = 4
@@ -135,6 +138,7 @@ class DramConfig(object):
self.tXSRDLL = self.clk * memspec.getIntValue("XSDLL");
self.tAL = self.clk * memspec.getIntValue("AL");
self.tRFC = self.clk * memspec.getIntValue("RFC");
self.tREFI = self.clk * memspec.getIntValue("REFI");
else:
raise Exception("MemoryType not supported yet. Insert a coin into the coin machine and try again")
@@ -470,6 +474,57 @@ def no_commands_during_refresh(connection):
return TestSuceeded()
@test
def max_number_ref_burst(connection):
"""Checks that the maximum number of REFA commands in a burst is not exceeded"""
cursor = connection.cursor()
query = """SELECT PhaseBegin, PhaseEnd FROM phases WHERE PhaseName = 'REFA' """
prevrow = [0] * 2
cnt = 0
flexibleRef = getFlexibleRef(connection)
maxRefBurst = getMaxRefBurst(connection)
cursor.execute(query);
result = cursor.fetchall();
if (flexibleRef):
maxRefBurst = maxRefBurst - 1 # Since the intersections will be used for this test, use -1 from the max
for row in result:
if (prevrow[1] == row[0]):
cnt += 1
else:
cnt = 0 # Reset the counter every time a burst ends
prevrow = row
if(cnt > maxRefBurst):
return TestFailed("Maximum number of REFA in a burst was exceeded at {0} with {1} REFA in sequence. Maximum allowed is {2}.".format(formatTime(row[0]), cnt, maxRefBurst))
return TestSuceeded()
@test
def max_time_without_ref(connection):
"""Checks that the maximum time allowed between REFA commands"""
cursor = connection.cursor()
query = """SELECT PhaseBegin, PhaseEnd FROM phases WHERE PhaseName = 'REFA' """
prevrow = [0] * 2
flexibleRef = getFlexibleRef(connection)
maxRefBurst = getMaxRefBurst(connection)
cursor.execute(query);
result = cursor.fetchall();
if (flexibleRef):
maxTimeWithoutRef = ((maxRefBurst + 1) * dramconfig.tREFI) + dramconfig.tRP # Bursts are possible, so max should be the possible burst size + 1
else:
maxTimeWithoutRef = dramconfig.tREFI + dramconfig.tRP
for row in result:
timeBetweenRefs = row[0] - prevrow[1]
if (timeBetweenRefs > maxTimeWithoutRef):
return TestFailed("Maximum time between REF commands was exceeded at {0} with {1} between REFs. Maximum allowed is {2}.".format(formatTime(row[0]), formatTime(timeBetweenRefs), formatTime(maxTimeWithoutRef)))
prevrow = row
return TestSuceeded()
# ----------- activate checks ---------------------------------------
@test