fixed a lot of bugs in the tests again
This commit is contained in:
@@ -35,6 +35,7 @@ def getClock(connection):
|
||||
|
||||
class DramConfig(object):
|
||||
memoryType = ""
|
||||
scheduler = ""
|
||||
bankwiseLogic = 0
|
||||
clk = 0
|
||||
unitOfTime = ""
|
||||
@@ -77,6 +78,7 @@ class DramConfig(object):
|
||||
|
||||
print(getMemconfig(connection))
|
||||
self.bankwiseLogic = getMemconfig(connection).findall("BankwiseLogic")[0].attrib['value']
|
||||
self.scheduler = getMemconfig(connection).findall("Scheduler")[0].attrib['value']
|
||||
self.numberOfBanks = getIntValueFromConfigXML(memspec, "nbrOfBanks")
|
||||
self.burstLength = getIntValueFromConfigXML(memspec, "burstLength")
|
||||
self.memoryType = getValueFromConfigXML(memspec, "memoryType")
|
||||
@@ -136,6 +138,8 @@ class DramConfig(object):
|
||||
else:
|
||||
raise Exception("MemoryType not supported yet. Insert a coin into the coin machine and try again")
|
||||
|
||||
# TODO ADD DDR3
|
||||
|
||||
def clkAlign(self, value):
|
||||
return math.ceil(1.0*value/self.clk)*self.clk
|
||||
|
||||
@@ -229,6 +233,8 @@ def phase_transitions_are_valid(connection):
|
||||
cursor = connection.cursor()
|
||||
validTransitions = {}
|
||||
|
||||
# validTransitions tells you which phases are allowed to follow the last transaction.
|
||||
|
||||
if(dramconfig.bankwiseLogic == 1):
|
||||
validTransitions['PRE'] = set(['ACT', 'REFA'])
|
||||
validTransitions['ACT'] = set(['RD', 'RDA', 'WR', 'WRA', 'PRE', 'PRE_ALL'])
|
||||
@@ -260,8 +266,16 @@ def phase_transitions_are_valid(connection):
|
||||
validTransitions['SREF'] = set(['PRE_ALL', 'ACT', 'REFA', 'PDNA', 'PDNP'])
|
||||
|
||||
|
||||
query = """SELECT PhaseName, phases.ID FROM phases INNER JOIN transactions ON phases.transact=transactions.ID WHERE TBank=:bank
|
||||
AND PhaseName NOT IN ('REQ','RESP') ORDER BY PhaseBegin"""
|
||||
# This was the original query:
|
||||
# query = """SELECT PhaseName, phases.ID FROM phases INNER JOIN transactions ON phases.transact=transactions.ID WHERE TBank=:bank AND PhaseName NOT IN ('REQ','RESP') ORDER BY PhaseBegin"""
|
||||
# However, refreshes and pre_all are attributed to Bank 0 therefore this must be added to the order evaluation:
|
||||
query = """SELECT
|
||||
PhaseName, phases.ID
|
||||
FROM
|
||||
phases INNER JOIN transactions ON phases.transact=transactions.ID
|
||||
WHERE
|
||||
((TBank=:bank) OR (PhaseNAME = "REFA" AND TBank=0) OR (PhaseNAME = "PRE_ALL" AND TBank=0))
|
||||
AND PhaseName NOT IN ('REQ','RESP') ORDER BY PhaseBegin"""
|
||||
|
||||
for bankNumber in range(dramconfig.numberOfBanks):
|
||||
cursor.execute(query, {"bank": bankNumber})
|
||||
@@ -354,8 +368,16 @@ def row_buffer_is_used_correctly(connection):
|
||||
"""Checks that each bank's row buffer is used correctly"""
|
||||
|
||||
cursor = connection.cursor()
|
||||
query = """SELECT PhaseName, phases.ID FROM phases INNER JOIN transactions ON phases.transact=transactions.ID WHERE TBank=:bank
|
||||
AND PhaseName NOT IN ('REQ','RESP') ORDER BY PhaseBegin"""
|
||||
|
||||
# REFA and PRE_ALL are stored to bank0 for all the other banks we have also to grep this commands:
|
||||
# (PhaseNAME = "REFA" AND TBank=0) OR (PhaseNAME = "PRE_ALL" AND TBank=0))
|
||||
query = """SELECT
|
||||
PhaseName, phases.ID
|
||||
FROM
|
||||
phases INNER JOIN transactions ON phases.transact=transactions.ID
|
||||
WHERE
|
||||
((TBank=:bank) OR (PhaseNAME = "REFA" AND TBank=0) OR (PhaseNAME = "PRE_ALL" AND TBank=0))
|
||||
AND PhaseName NOT IN ('REQ','RESP') ORDER BY PhaseBegin"""
|
||||
|
||||
|
||||
#phases that precharge the bank and close the rowbuffer
|
||||
@@ -563,7 +585,10 @@ def strict_transaction_order(connection):
|
||||
transactions += str(currentRow[0]) + ","
|
||||
|
||||
if(transactions != ""):
|
||||
return TestFailed("Transactions {0} is/are not in Order ".format(transactions))
|
||||
if(dramconfig.scheduler == "FIFO_STRICT"):
|
||||
return TestFailed("Transactions {0} is/are not in Order ".format(transactions))
|
||||
else:
|
||||
return TestResult(True, "Transactions are not in Order, however this is okay since no FIFO_STRICT was choosen");
|
||||
return TestSuceeded()
|
||||
|
||||
# ----------- powerdown checks ---------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user