Skip to content

Commit

Permalink
SBE Tool support for fleetwood systems
Browse files Browse the repository at this point in the history
Change-Id: Ic395ca1d1bde3aeabdacfefc473600d58585ff2b
RTC:158861
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/58691
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Shakeeb A. Pasha B K <shakeebbk@in.ibm.com>
Reviewed-by: Sachin Gupta <sgupta2m@in.ibm.com>
  • Loading branch information
Raja Das authored and sgupta2m committed Jun 12, 2018
1 parent 5cef9c4 commit 85b6968
Show file tree
Hide file tree
Showing 4 changed files with 169 additions and 76 deletions.
12 changes: 6 additions & 6 deletions src/test/testcases/testIstepAuto.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2016,2017
# Contributors Listed Below - COPYRIGHT 2016,2018
# [+] International Business Machines Corp.
#
#
Expand Down Expand Up @@ -42,7 +42,7 @@
}
# MAIN Test Run Starts Here...
#-------------------------------------------------
def sbe_istep_func( inum1, inum2):
def sbe_istep_func( inum1, inum2, node=0, isfleetwood=0):
# Convert float number to string, which would help extracting
# decimal and integral part separately
# Interpretation:
Expand Down Expand Up @@ -86,10 +86,10 @@ def sbe_istep_func( inum1, inum2):
0,0,0xA1,0x01,
0,major,0,minor ]
testUtil.runCycles( 10000000 )
testUtil.writeUsFifo( TESTDATA )
testUtil.writeEot( )
testUtil.readDsFifo( EXPDATA )
testUtil.readEot( )
testUtil.writeUsFifo( TESTDATA, node, isfleetwood )
testUtil.writeEot( node, isfleetwood )
testUtil.readDsFifo( EXPDATA, node, isfleetwood )
testUtil.readEot( node, isfleetwood )

except:
print ("\nTest completed with error(s). Raise error")
Expand Down
69 changes: 54 additions & 15 deletions src/test/testcases/testUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#
# OpenPOWER sbe Project
#
# Contributors Listed Below - COPYRIGHT 2015,2017
# Contributors Listed Below - COPYRIGHT 2015,2018
# [+] International Business Machines Corp.
#
#
Expand All @@ -28,45 +28,75 @@

waitItrCount = 10000000;
cyclesPerIter = 20000;
#err = False
lbus = conf.p9Proc0.proc_lbus_map
def writeUsFifo( data):

def getLbus( node, isfleetwood ):
#This is non-fleetwood system, where node is 0 by default
if (isfleetwood == 0):
lbus=conf.p9Proc0.proc_lbus_map
else:
# This is fleetwood system
if(node == 0):
lbus=conf.D1Proc0.proc_lbus_map
if(node == 1):
lbus=conf.D2Proc0.proc_lbus_map
if(node == 2):
lbus=conf.D3Proc0.proc_lbus_map
if(node == 3):
lbus=conf.D4Proc0.proc_lbus_map

return lbus

#Default parameters are for single node, node 0
def writeUsFifo( data, node=0, isfleetwood=0):
"""Main test Loop"""
lbus = getLbus(node, isfleetwood)
loopCount = len(data)/4;
for i in range (loopCount):
idx = i * 4;
writeEntry(lbus, 0x2400, (data[idx], data[idx+1], data[idx+2], data[idx+3]) )

def readDsFifo(data):
#Default parameters are for single node, node 0
def readDsFifo(data, node=0, isfleetwood=0):
"""Main test Loop"""
lbus = getLbus(node, isfleetwood)
loopCount = len(data)/4;
for i in range (loopCount):
idx = i * 4;
checkEqual(readEntry(lbus, 0x2440, 4), (data[idx], data[idx+1], data[idx+2], data[idx+3]))

def writeEot():
#Default parameters are for single node, node 0
def writeEot(node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
write(lbus, 0x2408, (0, 0, 0, 1) )

def write(obj, address, value ):
""" Write to memory space """
iface = SIM_get_interface(obj, "memory_space")
iface.write(None, address, value, 0x0)

def readEot():
#Default parameters are for single node, node 0
def readEot(node=0, isfleetwood=0):
""" Read from memory space """
lbus = getLbus(node, isfleetwood)
status = read(lbus, 0x2444, 4)
checkEqual( (status[3] & 0x80), 0x80 );
read(lbus, 0x2440, 4)

def resetFifo():
#Default parameters are for single node, node 0
def resetFifo(node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
write(lbus, 0x240C, (0, 0, 0, 1))
return

def readUsFifoStatus():
#Default parameters are for single node, node 0
def readUsFifoStatus(node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
status = read(lbus, 0x2404, 4)
return status

def readDsFifoStatus():
#Default parameters are for single node, node 0
def readDsFifoStatus(node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
status = read(lbus, 0x2444, 4)
return status

Expand Down Expand Up @@ -101,12 +131,15 @@ def waitTillDsFifoEmpty():

# This function will only read the entry but will not compare it
# with anything. This can be used to flush out enteries.
def readDsEntry(entryCount):
#Default parameters are for single node, node 0
def readDsEntry(entryCount, node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
for i in range (entryCount):
readEntry(lbus, 0x2440, 4)

def writeEntry(obj, address, value ):

#Default parameters are for single node, node 0
def writeEntry(obj, address, value, node=0, isfleetwood=0 ):
lbus = getLbus(node, isfleetwood)
loop = 1;
count = 0;
while( loop ):
Expand All @@ -124,13 +157,19 @@ def writeEntry(obj, address, value ):
loop = 0

return value
def readDsEntryReturnVal():

#Default parameters are for single node, node 0
def readDsEntryReturnVal(node=0, isfleetwood=0):
lbus = getLbus(node, isfleetwood)
data = readEntry(lbus, 0x2440, 4)
runCycles(200000)
return data
def readEntry(obj, address, size):

#Default parameters are for single node, node 0
def readEntry(obj, address, size, node=0, isfleetwood=0):

""" Read from memory space """
lbus = getLbus(node, isfleetwood)
loop = 1;
count = 0;
value = (0,0,0,0)
Expand Down
9 changes: 3 additions & 6 deletions src/tools/debug/sbe-debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def collectTrace():
output_path +"sbetrace.bin " )
invokeOsCmd( getTraceFilePath() + " -s " +
getFilePath("sbeStringFile_"+ddsuffix)+ " "+ output_path +"sbetrace.bin > "+\
output_path+"sbe_"+str(proc)+"_tracMERG" )
output_path+"sbe_"+str(node)+"_"+str(proc)+"_tracMERG" )
invokeOsCmd( "mv " + output_path +"DumpPIBMEM "+\
output_path +"dumpPibMem_trace" )

Expand Down Expand Up @@ -190,7 +190,7 @@ def forcedCollectTrace():

invokeOsCmd( getTraceFilePath() + " -s " +
getFilePath("sbeStringFile_"+ddsuffix)+" "+ output_path +"sbetrace.bin > "+\
output_path+"sbe_"+str(proc)+"_tracMERG" )
output_path+"sbe_"+str(node)+"_"+str(proc)+"_tracMERG" )
invokeOsCmd( "mv "+ output_path +"DumpPIBMEM "+\
output_path +"dumpPibMem_trace" )

Expand All @@ -202,11 +202,8 @@ def collectAttr():
getSymbolVal( 'G_sbe_attrs' )
invokeOsCmd( "mv "+ output_path + "DumpPIBMEM " +\
output_path +"sbeAttr.bin" )
# TODO via RTC 158861
# For multi-node system we need to convert node/proc to absolute
# proc number.
invokeOsCmd( getFilePath("p9_xip_tool")+" "+getFilePath(sbeImgFile) + " -ifs attrdump "+ output_path +"sbeAttr.bin > "+\
output_path+"sbe_"+str(proc)+"_attrs")
output_path+"sbe_"+str(node)+"_"+str(proc)+"_attrs")

def collectStackUsage():
threads = ('sbeSyncCommandProcessor_stack',
Expand Down

0 comments on commit 85b6968

Please sign in to comment.