Improved readability of Flexible Refresh tests

This commit is contained in:
Ana Mativi
2018-02-23 17:59:04 +01:00
parent de1b625bea
commit a567dbbf77
3 changed files with 26 additions and 23 deletions

View File

@@ -319,22 +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);
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);
sqlite3_bind_int(insertGeneralInfoStatement, 10, 0);
sqlite3_bind_int(insertGeneralInfoStatement, 11, 0);
}
if (Configuration::getInstance().ControllerCoreMaxPulledInARCmd > Configuration::getInstance().ControllerCoreMaxPostponedARCmd)
sqlite3_bind_int64(insertGeneralInfoStatement, 11, Configuration::getInstance().ControllerCoreMaxPulledInARCmd);
else
sqlite3_bind_int64(insertGeneralInfoStatement, 11, Configuration::getInstance().ControllerCoreMaxPostponedARCmd);
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

@@ -479,22 +479,16 @@ 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' """
query2 = """SELECT FlexibleRefresh, MaxRefBurst FROM GeneralInfo"""
prevrow = [0] * 2
cnt = 0
maxRefBurst = 0 # If flexible refresh is not enabled there shouldn't be any refreshes in sequence
flexibleRef = getFlexibleRef(connection)
maxRefBurst = getMaxRefBurst(connection)
cursor.execute(query);
result = cursor.fetchall();
cursor.execute(query2);
result2 = cursor.fetchall();
maxRefBurst = result2[0][1]
flexibleRef = result2[0][0]
if (flexibleRef):
maxRefBurst = maxRefBurst - 1 # Since the intersections will be used for this test, use -1 from the max
else:
maxRefBurst = 0
for row in result:
if (prevrow[1] == row[0]):
@@ -512,15 +506,12 @@ 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' """
query2 = """SELECT FlexibleRefresh, MaxRefBurst FROM GeneralInfo"""
prevrow = [0] * 2
flexibleRef = getFlexibleRef(connection)
maxRefBurst = getMaxRefBurst(connection)
cursor.execute(query);
result = cursor.fetchall();
cursor.execute(query2);
result2 = cursor.fetchall();
maxRefBurst = result2[0][1]
flexibleRef = result2[0][0]
if (flexibleRef):
maxTimeWithoutRef = ((maxRefBurst + 1) * dramconfig.tREFI) + dramconfig.tRP # Bursts are possible, so max should be the possible burst size + 1