[OpenPower-Firmware] [RFC PATCH 1/6] treewide: use print function instead of statement
Marty E. Plummer
hanetzer at startmail.com
Fri May 10 19:35:04 AEST 2019
This enables better compat between python2.7 and python3.x
Without this change, building with python3.x (python3.5 tested) as
/usr/bin/python will result in the following error:
File: "sbe/src/build/security/securityRegListGen.py", line 64
-v, --verbose enable verbose traces"
^
SyntaxError: Missing parentheses in call to 'print'
Signed-off-by: Marty E. Plummer <hanetzer at startmail.com>
---
src/boot/sbeCompression.py | 31 ++--
src/build/parsAndCutElf.py | 9 +-
src/build/sbeOpDistribute.py | 9 +-
src/build/security/securityRegListGen.py | 94 +++++-----
src/build/updateBuildTag.py | 4 +-
src/test/testcases/testAbort.py | 1 +
src/test/testcases/testAduMem_124B.py | 5 +-
src/test/testcases/testAduMem_ecc.py | 13 +-
src/test/testcases/testAduMem_itag.py | 13 +-
src/test/testcases/testAduMem_noEccNoItag.py | 13 +-
src/test/testcases/testAduMem_withEccItag.py | 13 +-
.../testAduMem_withEccWithItagReadWrite.py | 1 +
src/test/testcases/testCntlInstruction.py | 1 +
src/test/testcases/testContinueMpipl.py | 1 +
src/test/testcases/testContinueSbeBoot.py | 1 +
src/test/testcases/testEnterMpipl.py | 1 +
src/test/testcases/testExecutorCntrlTimer.py | 9 +-
src/test/testcases/testExecutorMemory.py | 12 +-
src/test/testcases/testExecutorPSU.py | 18 +-
src/test/testcases/testExecutorPutRing.py | 20 +--
src/test/testcases/testExecutorStopTimer.py | 11 +-
src/test/testcases/testFastArray.py | 1 +
src/test/testcases/testFifoReset.py | 1 +
src/test/testcases/testFlushNVDIMM.py | 2 +-
src/test/testcases/testGetCapabilities.py | 3 +-
src/test/testcases/testGetMem.py | 1 +
src/test/testcases/testGetMem_expdata.py | 1 +
src/test/testcases/testGetRing.py | 1 +
src/test/testcases/testHostFFDC.py | 8 +-
src/test/testcases/testIstepAuto.py | 3 +-
src/test/testcases/testIstepInvalid.py | 1 +
src/test/testcases/testIstepInvalidFenced.py | 1 +
src/test/testcases/testIstepSuccess.py | 1 +
src/test/testcases/testMatchStashPair.py | 5 +-
src/test/testcases/testMemPBA.py | 37 ++--
src/test/testcases/testMemUtil.py | 7 +-
src/test/testcases/testPSUGetCapabilities.py | 14 +-
src/test/testcases/testPSUReadSbeMem.py | 22 +--
src/test/testcases/testPSUSetFFDCAddr.py | 5 +-
src/test/testcases/testPSUSetStashPair.py | 34 ++--
src/test/testcases/testPSUUserUtil.py | 4 +-
src/test/testcases/testPSUUtil.py | 81 ++++-----
src/test/testcases/testPsuHostPassThrough.py | 10 +-
src/test/testcases/testPutGetRegFpr.py | 1 +
src/test/testcases/testPutGetRegGpr.py | 1 +
src/test/testcases/testPutGetRegSpr.py | 1 +
src/test/testcases/testPutMem_fail.py | 1 +
src/test/testcases/testQuiesce.py | 1 +
src/test/testcases/testRunTillSbeBooted.py | 7 +-
src/test/testcases/testSbeDump.py | 3 +-
src/test/testcases/testSecurity.py | 59 ++++---
src/test/testcases/testSecurityListDump.py | 5 +-
src/test/testcases/testSram.py | 11 +-
src/test/testcases/testStartInstruction.py | 1 +
src/test/testcases/testStopClocks.py | 1 +
src/test/testcases/testStopInstruction.py | 1 +
src/test/testcases/testSuspendIO.py | 2 +-
src/test/testcases/testSystemFabricMap.py | 6 +-
src/test/testcases/testTraceArray.py | 1 +
src/test/testcases/testUnsecureMemRegions.py | 1 +
src/test/testcases/testUtil.py | 9 +-
src/tools/debug/sbe-debug.py | 131 +++++++-------
src/tools/debug/simics-debug-framework.py | 45 ++---
src/tools/utils/CommitSbeImageToCMVC.py | 167 +++++++++---------
src/tools/utils/cmvcRelease.py | 25 +--
src/tools/utils/sbeCmvcUtility.py | 95 +++++-----
src/tools/utils/sbePatchUtility.py | 11 +-
src/tools/utils/sbePrime.py | 105 +++++------
68 files changed, 635 insertions(+), 579 deletions(-)
diff --git a/src/boot/sbeCompression.py b/src/boot/sbeCompression.py
index 74988e26..f8ca6202 100755
--- a/src/boot/sbeCompression.py
+++ b/src/boot/sbeCompression.py
@@ -23,6 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import subprocess
import re
@@ -40,17 +41,17 @@ def compress(inputFile, compressedFile):
try:
f = open(inputFile, "rb")
except IOError as e :
- print "I/O error File for File to be compressed."
+ print("I/O error File for File to be compressed.")
sys.exit(1)
try:
fW = open(compressedFile, "wb")
except IOError as e :
- print "I/O error File for compressed file."
+ print("I/O error File for compressed file.")
sys.exit(1)
if os.stat(inputFile).st_size < 4 :
- print "File is less than four bytes."
+ print("File is less than four bytes.")
sys.exit(1)
instDict = dict()
@@ -129,13 +130,13 @@ def compress(inputFile, compressedFile):
fW.close()
def usage():
- print "usage: sbeCompression.py [-h] [-l <path>] [-i <image>]"
- print "SBE Compression Parser"
- print "Arguments:"
- print "-h, --help\t\tshow this help message and exit"
- print "-l, --imageLoc\t\tSeeprom Binary Location"
- print "-i, --image\t\tSeeprom Binary"
- print "-p, --p9_xip_tool\t\tp9_xip_tool path"
+ print("usage: sbeCompression.py [-h] [-l <path>] [-i <image>]")
+ print("SBE Compression Parser")
+ print("Arguments:")
+ print("-h, --help\t\tshow this help message and exit")
+ print("-l, --imageLoc\t\tSeeprom Binary Location")
+ print("-i, --image\t\tSeeprom Binary")
+ print("-p, --p9_xip_tool\t\tp9_xip_tool path")
return 1
def main( argv ):
@@ -143,7 +144,7 @@ def main( argv ):
try:
opts, args = getopt.getopt(argv[1:], "l:i:p:h", ['imageLoc=', 'image=', 'p9_xip_tool=', 'help'])
except getopt.GetoptError as err:
- print str(err)
+ print(str(err))
usage()
exit(1)
@@ -166,14 +167,14 @@ def main( argv ):
cmd1 = "cp " + imagePath + "/" + image + " " + imagePath + "/" + image + ".orig"
rc = os.system(cmd1)
if rc:
- print "Unable to make copy of seeprom binary"
+ print("Unable to make copy of seeprom binary")
sys.exit(1)
#Extract base from SEEPROM binary.
cmd2 = p9_xip_tool + " " + imagePath + "/" + image + " extract .base " + imagePath + "/" + image + ".base"
rc = os.system(cmd2)
if rc:
- print "Unable to extract the base from seeprom binary"
+ print("Unable to extract the base from seeprom binary")
sys.exit(1)
#Compress the base section
@@ -183,14 +184,14 @@ def main( argv ):
cmd3 = p9_xip_tool + " " + imagePath + "/" + image + " delete .base"
rc = os.system(cmd3)
if rc:
- print "Unable to delete base section from seeprom binary"
+ print("Unable to delete base section from seeprom binary")
sys.exit(1)
#Append the base section from SEEPEOM binary.
cmd4 = p9_xip_tool + " " + imagePath + "/" + image + " append .base " + imagePath + "/" + image + ".base.compressed"
rc = os.system(cmd4)
if rc:
- print "Unable to append the base section"
+ print("Unable to append the base section")
sys.exit(1)
if __name__ == "__main__":
diff --git a/src/build/parsAndCutElf.py b/src/build/parsAndCutElf.py
index 2413f4c5..57bf8af9 100755
--- a/src/build/parsAndCutElf.py
+++ b/src/build/parsAndCutElf.py
@@ -23,6 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import subprocess
import re
@@ -36,7 +37,7 @@ def parserElf(argv):
outdir = argv[2]
img = argv[3]
except:
- print "Missing argument : arg[0] ddlevel; arg[1] output directory; arg[2] img (seeprom/pibmem)"
+ print("Missing argument : arg[0] ddlevel; arg[1] output directory; arg[2] img (seeprom/pibmem)")
exit(-1)
SBE_OUT = outdir+"/sbe_"+img+"_"+ddlevel+".out"
SBE_BIN = outdir+"/sbe_"+img+"_"+ddlevel+".bin"
@@ -53,7 +54,7 @@ def parserElf(argv):
if( (line.find(firstSection) != -1) ):
tokens = line.split();
startSize = int( tokens[5], 16 )
- print startSize
+ print(startSize)
break;
# Get the location of sbe end
@@ -64,7 +65,7 @@ def parserElf(argv):
endSize = int( tokens[0], 16 );
break;
- print endSize;
+ print(endSize)
if( (startSize == 0) or (endSize == 0)):
exit(-1)
@@ -72,7 +73,7 @@ def parserElf(argv):
cmd1 = "dd skip=" + str(startSize) + " count=" + str(endSize) + " if="+SBE_OUT+" of="+SBE_BIN+" bs=1"
rc = os.system(cmd1)
if ( rc ):
- print "ERROR running %s: %d "%( cmd1, rc )
+ print("ERROR running %s: %d "%( cmd1, rc ))
exit(-1)
parserElf(sys.argv)
diff --git a/src/build/sbeOpDistribute.py b/src/build/sbeOpDistribute.py
index 14546d98..85f007d4 100755
--- a/src/build/sbeOpDistribute.py
+++ b/src/build/sbeOpDistribute.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import sys
import getopt
@@ -30,19 +31,19 @@ CHIPID = 'p9n'
p9n_EC = {'21':'DD2', '22':'DD2', '23':'DD2'}
def usage():
- print "usage:sbeOpDistribute.py [--sbe_binary_dir] <sbe binary path> [--img_dir] <images path>"
+ print("usage:sbeOpDistribute.py [--sbe_binary_dir] <sbe binary path> [--img_dir] <images path>")
def run_system_cmd(cmd):
- print 'Cmd:<'+cmd+'>'
+ print('Cmd:<'+cmd+'>')
if(os.system(cmd)):
- print "ERROR running cmd:<"+cmd+">"
+ print("ERROR running cmd:<"+cmd+">")
exit(1)
def main(argv):
try:
opts, args = getopt.getopt(sys.argv[1:], "", ['sbe_binary_dir=', 'img_dir=', 'buildSbePart=', 'hw_ref_image=', 'sbe_binary_filename=', 'scratch_dir=', 'install', 'help'])
except getopt.GetoptError as err:
- print str(err)
+ print(str(err))
usage()
exit(1)
diff --git a/src/build/security/securityRegListGen.py b/src/build/security/securityRegListGen.py
index 4703c9be..35cf0fb7 100644
--- a/src/build/security/securityRegListGen.py
+++ b/src/build/security/securityRegListGen.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import getopt
import sys
import os
@@ -51,29 +52,30 @@ TAG_NAME_GREYLIST = 'write_greylist'
TAG_NAME_BLACKLIST = 'read_blacklist'
def usage():
- print "usage: p9_security_list_gen.py [-h] [-f <security_list_path>] [-0 <output directory] [i] [-d] [-v]\n\
+ print(
+'''usage: p9_security_list_gen.py [-h] [-f <security_list_path>] [-0 <output directory] [i] [-d] [-v]
arguments:\n\
--h, --help show this help message and exit\n\
--f, --file path to the security list csv file\n\
--o, --output output directory\n\
--w, --whitelist print whitelist read from csv\n\
--b, --blacklist print blacklist read from csv\n\
--g, --greylist print greylist read from csv\n\
--i, --info get version info of the security list\n\
--d, --debug enable debug traces\n\
--v, --verbose enable verbose traces"
+-h, --help show this help message and exit
+-f, --file path to the security list csv file
+-o, --output output directory
+-w, --whitelist print whitelist read from csv
+-b, --blacklist print blacklist read from csv
+-g, --greylist print greylist read from csv
+-i, --info get version info of the security list
+-d, --debug enable debug traces
+-v, --verbose enable verbose traces''')
def exit(error, msg = ''):
if(error == SUCCESS):
return 0
elif(error == INVALID_USAGE):
- print msg
+ print(msg)
usage()
elif(error == PRINT_AND_EXIT):
- print msg
+ print(msg)
else:
if(DEBUG):
- print "unknown error:exiting"
+ print("unknown error:exiting")
sys.exit(1)
def remove_duplicates(xlist):
@@ -465,16 +467,16 @@ def get_tables(id, list):
# for each range and key combination in order
table3 += temp_keys
if(VERBOSE):
- print id+" table3 keys len ["+s_list_len(table3)+"]"
+ print(id+" table3 keys len ["+s_list_len(table3)+"]")
if(VERBOSE):
- print id,"table1:", ['0x%04x:0x%02x' % ele for ele in table1]
- print id,"table2:", ['0x%02x:0x%02x' % ele for ele in table2]
- print id,"table3:", ['0x%04x' % ele for ele in table3]
+ print(id,"table1:", ['0x%04x:0x%02x' % ele for ele in table1])
+ print(id,"table2:", ['0x%02x:0x%02x' % ele for ele in table2])
+ print(id,"table3:", ['0x%04x' % ele for ele in table3])
if(DEBUG):
- print id,"table1 len ["+s_list_len(table1)+"]"
- print id,"table2 len ["+s_list_len(table2)+"]"
- print id+" table3 len ["+s_list_len(table3)+"]"
+ print(id,"table1 len ["+s_list_len(table1)+"]")
+ print(id,"table2 len ["+s_list_len(table2)+"]")
+ print(id+" table3 len ["+s_list_len(table3)+"]")
return (table1, table2, table3)
@@ -490,8 +492,8 @@ def s_table1_gen(id, table):
str_table1 += '\n'
str_table1 = str_table1[:-1]
if(VERBOSE):
- print id+" generated table1"
- print str_table1
+ print(id+" generated table1")
+ print(str_table1)
return str_table1
def s_table2_gen(id, table):
@@ -504,8 +506,8 @@ def s_table2_gen(id, table):
str_table2 += '\n'
str_table2 = str_table2[:-1]
if(VERBOSE):
- print id+" generated table2"
- print str_table2
+ print(id+" generated table2")
+ print(str_table2)
return str_table2
def s_table3_gen(id, table):
@@ -518,8 +520,8 @@ def s_table3_gen(id, table):
str_table3 += '\n'
str_table3 = str_table3[:-1]
if(VERBOSE):
- print id+" generated table3"
- print str_table3
+ print(id+" generated table3")
+ print(str_table3)
return str_table3
def s_greylist_table_gen( greyList):
@@ -529,8 +531,8 @@ def s_greylist_table_gen( greyList):
str_table += '{0x%08x, 0x%016xull}, ' % (ele[0], ele[1])
str_table = str_table[:-1]
if(VERBOSE):
- print " greylist table"
- print str_table
+ print(" greylist table")
+ print(str_table)
return str_table
def main(argv):
@@ -577,8 +579,8 @@ def main(argv):
GEN_FILE = str(arg)+"/"+GEN_FILE
if(DEBUG):
- print "file ["+str(SECURITY_LIST)+"]"
- print "output ["+str(GEN_FILE)+"]"
+ print("file ["+str(SECURITY_LIST)+"]")
+ print("output ["+str(GEN_FILE)+"]")
# Read the security list file
version = 'unknown'
@@ -598,7 +600,7 @@ def main(argv):
base_addr = base_addr[len(base_addr)-8:]
base_addr = int(base_addr, 16)
if(VERBOSE):
- print "base["+'0x%08x' % base_addr + "]"
+ print("base["+'0x%08x' % base_addr + "]")
bit_mask = row[TAG_BIT_MASK].strip()
if not bit_mask:
bit_mask = 0
@@ -611,9 +613,9 @@ def main(argv):
exit(PRINT_AND_EXIT, "Missing chiplet id range")
if(chiplet_range[0].strip().lower() != '0x00'):
if(chiplet_range[0].strip().lower() != '0x%02x' % (get_chiplet(base_addr))):
- print "base_addr",hex(base_addr)
- print "get_chiplet(base_addr)",hex(get_chiplet(base_addr))
- print "chiplet_range[0]", chiplet_range[0]
+ print("base_addr",hex(base_addr))
+ print("get_chiplet(base_addr)",hex(get_chiplet(base_addr)))
+ print("chiplet_range[0]", chiplet_range[0])
exit(PRINT_AND_EXIT, "Base address is not consistent")
base_addr = base_addr & 0x00FFFFFF
chiplet_range = [int(ele, 16) for ele in chiplet_range]
@@ -624,29 +626,29 @@ def main(argv):
expanded_line = [(base_addr + ele) for ele in expanded_range]
expanded_line = get_effective_address(row[TAG_CHIPLET], expanded_line)
if(VERBOSE):
- print s_list_hex("range:", expanded_range, 8)
+ print(s_list_hex("range:", expanded_range, 8))
if(row[TAG_TYPE].strip().lower() == TAG_NAME_GREYLIST):
if(( bit_mask == 0 ) or ( bit_mask == 0xffffffffffffffff)):
exit(PRINT_AND_EXIT, "Wrong mask for Greylist")
greylist_line = expanded_line
if(VERBOSE):
- print s_list_hex("greylist_line:", greylist_line, 8)
- print "mask:", bit_mask
+ print(s_list_hex("greylist_line:", greylist_line, 8))
+ print("mask:", bit_mask)
for ele in greylist_line:
greylist.append((ele, bit_mask))
elif(row[TAG_TYPE].strip().lower() == TAG_NAME_WHITELIST):
whitelist_line = expanded_line
if(VERBOSE):
- print s_list_hex("whitelist_line:", whitelist_line, 8)
+ print(s_list_hex("whitelist_line:", whitelist_line, 8))
whitelist += whitelist_line
elif(row[TAG_TYPE].strip().lower() == TAG_NAME_BLACKLIST):
blacklist_line = expanded_line
if(VERBOSE):
- print s_list_hex("blacklist_line:", blacklist_line, 8)
+ print(s_list_hex("blacklist_line:", blacklist_line, 8))
blacklist += blacklist_line
except:
- print "Error in line ["+str(idx+2)+"]"
+ print("Error in line ["+str(idx+2)+"]")
exit(PRINT_AND_EXIT, sys.exc_info()[0])
whitelist = remove_duplicates(whitelist)
@@ -668,13 +670,13 @@ def main(argv):
exit(PRINT_AND_EXIT, greylist)
if(VERBOSE):
- print s_list_hex("whitelist:", whitelist, 8)
- print s_list_hex("blacklist:", blacklist, 8)
+ print(s_list_hex("whitelist:", whitelist, 8))
+ print(s_list_hex("blacklist:", blacklist, 8))
if(DEBUG):
- print "security list version ["+version+"]"
- print "Whitelist len ["+s_list_len(whitelist)+"]"
- print "Blacklist len ["+s_list_len(blacklist)+"]"
- print "Greylist len ["+s_list_len(greylist)+"]"
+ print("security list version ["+version+"]")
+ print("Whitelist len ["+s_list_len(whitelist)+"]")
+ print("Blacklist len ["+s_list_len(blacklist)+"]")
+ print("Greylist len ["+s_list_len(greylist)+"]")
whitelist_tables = get_tables("Whitelist", whitelist)
blacklist_tables = get_tables("Blacklist", blacklist)
diff --git a/src/build/updateBuildTag.py b/src/build/updateBuildTag.py
index 6a49c8ce..d6dbab95 100755
--- a/src/build/updateBuildTag.py
+++ b/src/build/updateBuildTag.py
@@ -23,7 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import os
import sys
import subprocess
@@ -38,7 +38,7 @@ def updateBuildTag(argv):
image_dir = argv[2]
seeprom_name = argv[3]
except:
- print "Missing Xip Tool Path/Image Directory/Seeprom Binary Name"
+ print("Missing Xip Tool Path/Image Directory/Seeprom Binary Name")
exit(-1)
# Commandline cmds getting formed here
diff --git a/src/test/testcases/testAbort.py b/src/test/testcases/testAbort.py
index 6c5ccdfc..4feb5317 100755
--- a/src/test/testcases/testAbort.py
+++ b/src/test/testcases/testAbort.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testAduMem_124B.py b/src/test/testcases/testAduMem_124B.py
index f89c05fd..a9d3661a 100644
--- a/src/test/testcases/testAduMem_124B.py
+++ b/src/test/testcases/testAduMem_124B.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import os
import struct
@@ -50,8 +51,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read ADU byte["+str(byte)+"] offset[" + str(offset)+"]")
else:
- print [hex(a) for a in data]
- print [hex(a) for a in readData]
+ print([hex(a) for a in data])
+ print([hex(a) for a in readData])
raise Exception('data mistmach')
# Test case 2: Invalid length - 3
diff --git a/src/test/testcases/testAduMem_ecc.py b/src/test/testcases/testAduMem_ecc.py
index bcd03645..07a9d325 100644
--- a/src/test/testcases/testAduMem_ecc.py
+++ b/src/test/testcases/testAduMem_ecc.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -44,8 +45,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read ADU with ECC")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
@@ -59,10 +60,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read ADU with ECC")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
#-------------------------------------------------
diff --git a/src/test/testcases/testAduMem_itag.py b/src/test/testcases/testAduMem_itag.py
index 1b5be988..f01cf314 100644
--- a/src/test/testcases/testAduMem_itag.py
+++ b/src/test/testcases/testAduMem_itag.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -56,8 +57,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read ADU with Itag")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
@@ -71,10 +72,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read ADU with Itag")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
#-------------------------------------------------
# Calling all test code
diff --git a/src/test/testcases/testAduMem_noEccNoItag.py b/src/test/testcases/testAduMem_noEccNoItag.py
index 2d54334c..aa88da5a 100644
--- a/src/test/testcases/testAduMem_noEccNoItag.py
+++ b/src/test/testcases/testAduMem_noEccNoItag.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import os
import struct
@@ -57,8 +58,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read ADU")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
@@ -71,10 +72,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read ADU")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
diff --git a/src/test/testcases/testAduMem_withEccItag.py b/src/test/testcases/testAduMem_withEccItag.py
index 5a04f484..93d31dea 100644
--- a/src/test/testcases/testAduMem_withEccItag.py
+++ b/src/test/testcases/testAduMem_withEccItag.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -44,8 +45,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read ADU with ECC,Itag")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
@@ -59,10 +60,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read ADU with ECC,Itag")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
#-------------------------------------------------
# Calling all test code
diff --git a/src/test/testcases/testAduMem_withEccWithItagReadWrite.py b/src/test/testcases/testAduMem_withEccWithItagReadWrite.py
index c5c4f307..4c9f3483 100644
--- a/src/test/testcases/testAduMem_withEccWithItagReadWrite.py
+++ b/src/test/testcases/testAduMem_withEccWithItagReadWrite.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testCntlInstruction.py b/src/test/testcases/testCntlInstruction.py
index c6bacede..d877a982 100644
--- a/src/test/testcases/testCntlInstruction.py
+++ b/src/test/testcases/testCntlInstruction.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testContinueMpipl.py b/src/test/testcases/testContinueMpipl.py
index bb79d0e2..7987d85e 100755
--- a/src/test/testcases/testContinueMpipl.py
+++ b/src/test/testcases/testContinueMpipl.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testContinueSbeBoot.py b/src/test/testcases/testContinueSbeBoot.py
index 532ece01..a238d6ad 100755
--- a/src/test/testcases/testContinueSbeBoot.py
+++ b/src/test/testcases/testContinueSbeBoot.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testEnterMpipl.py b/src/test/testcases/testEnterMpipl.py
index c4907945..9adaedc6 100755
--- a/src/test/testcases/testEnterMpipl.py
+++ b/src/test/testcases/testEnterMpipl.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testExecutorCntrlTimer.py b/src/test/testcases/testExecutorCntrlTimer.py
index fae474d7..febf542c 100644
--- a/src/test/testcases/testExecutorCntrlTimer.py
+++ b/src/test/testcases/testExecutorCntrlTimer.py
@@ -23,6 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
import testUtil
@@ -100,12 +101,12 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test set1 [ PutCntrlTimer ] ...\n"
+ print("\n Execute SBE Test set1 [ PutCntrlTimer ] ...\n")
'''
Test Case 1
'''
- print "\n Test Start timer\n"
+ print("\n Test Start timer\n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_startTimer )
@@ -116,13 +117,13 @@ def main():
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_Timer_Cmd_success )
#Poll on HOST DoorBell Register for interrupt
- print "\n Poll on Host side for Timer INTR ...\n"
+ print("\n Poll on Host side for Timer INTR ...\n")
regObj.pollingOn( testPSUUtil.simSbeObj, timer_polling_data, 50 )
'''
Test Case 2. Stop timer when timer already expired
'''
- print "\n Test Stop timer\n"
+ print("\n Test Stop timer\n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_StopTimer )
diff --git a/src/test/testcases/testExecutorMemory.py b/src/test/testcases/testExecutorMemory.py
index 8bd1dab7..f0515e9d 100644
--- a/src/test/testcases/testExecutorMemory.py
+++ b/src/test/testcases/testExecutorMemory.py
@@ -36,7 +36,7 @@
# 1.0 gkeishin 29/03/16 Initial create
#############################################################
'''
-
+from __future__ import print_function
import testClass as testObj
import testRegistry as reg
@@ -64,17 +64,17 @@ sbe_test_data = (
def main():
# Intialize the class obj instances
- print "\n Initializing Registry instances ...."
+ print("\n Initializing Registry instances ....")
regObj = testObj.registry() # Registry obj def for operation
- print "\n Execute SBE Test set [ Indirect Commands ] ...\n"
+ print("\n Execute SBE Test set [ Indirect Commands ] ...\n")
# Sim obj Target Test set
rc_test = regObj.ExecuteTestOp(testObj.simMemObj,sbe_test_data)
if rc_test != testObj.SUCCESS:
- print " SBE Test data set .. [ FAILED ] .."
+ print(" SBE Test data set .. [ FAILED ] ..")
else:
- print " SBE Test data set .. [ SUCCESS ] "
- print "\n"
+ print(" SBE Test data set .. [ SUCCESS ] ")
+ print("\n")
if __name__=="__main__":
main()
diff --git a/src/test/testcases/testExecutorPSU.py b/src/test/testcases/testExecutorPSU.py
index b201f4b6..bccfff46 100644
--- a/src/test/testcases/testExecutorPSU.py
+++ b/src/test/testcases/testExecutorPSU.py
@@ -36,7 +36,7 @@
# 1.0 gkeishin 29/03/16 Initial create
#############################################################
'''
-
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
@@ -116,25 +116,25 @@ sample_test_data = (
def main():
# Intialize the class obj instances
- print "\n Initializing Registry instances ...."
+ print("\n Initializing Registry instances ....")
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test set [ PSU ] ...\n"
+ print("\n Execute SBE Test set [ PSU ] ...\n")
# Sim obj Target Test set Raise Exception
rc_test = regObj.ExecuteTestOp(testPSUUtil.simSbeObj,sbe_test_data, True)
if rc_test != testPSUUtil.SUCCESS:
- print " SBE Test data set .. [ Failed ] .."
+ print(" SBE Test data set .. [ Failed ] ..")
else:
- print " SBE Test data set .. [ OK ] "
- print "\n Poll on Host side for INTR ...\n"
+ print(" SBE Test data set .. [ OK ] ")
+ print("\n Poll on Host side for INTR ...\n")
# Sim obj Target Test set Max timedout
rc_intr = regObj.pollingOn(testPSUUtil.simSbeObj,host_test_data,20)
if rc_intr == testPSUUtil.SUCCESS:
- print " Interrupt Event Recieved .. Success !!"
+ print(" Interrupt Event Recieved .. Success !!")
else:
- print " Interrupt not Recieved.. Exiting .."
+ print(" Interrupt not Recieved.. Exiting ..")
- print "\n"
+ print("\n")
if __name__=="__main__":
main()
diff --git a/src/test/testcases/testExecutorPutRing.py b/src/test/testcases/testExecutorPutRing.py
index db5f8769..aaba1ba9 100644
--- a/src/test/testcases/testExecutorPutRing.py
+++ b/src/test/testcases/testExecutorPutRing.py
@@ -143,7 +143,7 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test set1 [ Put Ring ] ...\n"
+ print("\n Execute SBE Test set1 [ Put Ring ] ...\n")
'''
Test Case 1
@@ -151,7 +151,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data1 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
@@ -160,56 +160,56 @@ def main():
# Commenting out test cases for perv and proc chiplets, as there is no
# way to stop cloks for these chiplets from the test framework
-# print "\n Execute SBE Test set2 [ Put Ring ] ...\n"
+# print("\n Execute SBE Test set2 [ Put Ring ] ...\n")
# '''
# Test Case 2
# '''
# # HOST->SBE data set execution
# regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data2 )
#
-# print "\n Poll on Host side for INTR ...\n"
+# print("\n Poll on Host side for INTR ...\n")
# #Poll on HOST DoorBell Register for interrupt
# regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#
# #SBE->HOST data set execution
# regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
#
-# print "\n Execute SBE Test set3 [ Put Ring ] ...\n"
+# print("\n Execute SBE Test set3 [ Put Ring ] ...\n")
# '''
# Test Case 3
# '''
# # HOST->SBE data set execution
# regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data3 )
#
-# print "\n Poll on Host side for INTR ...\n"
+# print("\n Poll on Host side for INTR ...\n")
# #Poll on HOST DoorBell Register for interrupt
# regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#
# #SBE->HOST data set execution
# regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
#
- print "\n Execute SBE Test set4 [ Put Ring ] ...\n"
+ print("\n Execute SBE Test set4 [ Put Ring ] ...\n")
'''
Test Case 4
'''
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data4 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
- print "\n Execute SBE Test set5 [ Put Ring ] ...\n"
+ print("\n Execute SBE Test set5 [ Put Ring ] ...\n")
'''
Test Case 5
'''
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data5 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
diff --git a/src/test/testcases/testExecutorStopTimer.py b/src/test/testcases/testExecutorStopTimer.py
index 9d0b1384..ed1cb8ec 100644
--- a/src/test/testcases/testExecutorStopTimer.py
+++ b/src/test/testcases/testExecutorStopTimer.py
@@ -23,6 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
import testUtil
@@ -98,12 +99,12 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test set1 [ PutCntrlTimer ] ...\n"
+ print("\n Execute SBE Test set1 [ PutCntrlTimer ] ...\n")
'''
Test Case 1
'''
- print "\n Test Start timer\n"
+ print("\n Test Start timer\n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_startTimer )
@@ -113,7 +114,7 @@ def main():
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_Timer_Cmd_success )
- print "\n Test Stop timer\n"
+ print("\n Test Stop timer\n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_StopTimer )
@@ -126,13 +127,13 @@ def main():
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_Timer_Cmd_success )
try:
#Poll on HOST DoorBell Register for interrupt
- print "\n Poll on Host side for Timer INTR ...\n"
+ print("\n Poll on Host side for Timer INTR ...\n")
regObj.pollingOn( testPSUUtil.simSbeObj, timer_polling_data, 20 )
except:
isTimerFired = False
if isTimerFired:
- print "\n Problem. Timer not cancelled\n"
+ print("\n Problem. Timer not cancelled\n")
raise Exception('Timer Not cancelled ');
if __name__ == "__main__":
diff --git a/src/test/testcases/testFastArray.py b/src/test/testcases/testFastArray.py
index 69c062e6..1d41182e 100644
--- a/src/test/testcases/testFastArray.py
+++ b/src/test/testcases/testFastArray.py
@@ -21,6 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testFifoReset.py b/src/test/testcases/testFifoReset.py
index a9596738..738f896d 100644
--- a/src/test/testcases/testFifoReset.py
+++ b/src/test/testcases/testFifoReset.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest")
import testUtil
diff --git a/src/test/testcases/testFlushNVDIMM.py b/src/test/testcases/testFlushNVDIMM.py
index 3350bd77..584b1d4c 100755
--- a/src/test/testcases/testFlushNVDIMM.py
+++ b/src/test/testcases/testFlushNVDIMM.py
@@ -21,7 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testGetCapabilities.py b/src/test/testcases/testGetCapabilities.py
index 5fd8491e..c8262fbe 100755
--- a/src/test/testcases/testGetCapabilities.py
+++ b/src/test/testcases/testGetCapabilities.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -62,7 +63,7 @@ EXPDATA3 = [0xa8,0x0,0x0,0x03, #getcapability/getSbeFFDC/quiesce
def main( ):
( rc, out ) = quiet_run_command( "sbe-ddlevel 0", output_modes.regular )
if(rc == "DD1"):
- print "Not running Get Capabilities on DD1"
+ print("Not running Get Capabilities on DD1")
return
testUtil.runCycles( 10000000 )
testUtil.writeUsFifo( TESTDATA )
diff --git a/src/test/testcases/testGetMem.py b/src/test/testcases/testGetMem.py
index 8f9b7563..bdda2e21 100644
--- a/src/test/testcases/testGetMem.py
+++ b/src/test/testcases/testGetMem.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testGetMem_expdata.py b/src/test/testcases/testGetMem_expdata.py
index 890042ac..6930767f 100644
--- a/src/test/testcases/testGetMem_expdata.py
+++ b/src/test/testcases/testGetMem_expdata.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testGetRing.py b/src/test/testcases/testGetRing.py
index e241fd54..6b64afee 100644
--- a/src/test/testcases/testGetRing.py
+++ b/src/test/testcases/testGetRing.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testHostFFDC.py b/src/test/testcases/testHostFFDC.py
index 60c61e24..73bab681 100644
--- a/src/test/testcases/testHostFFDC.py
+++ b/src/test/testcases/testHostFFDC.py
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testPSUUtil
@@ -116,12 +116,12 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test - Set FFDC Address\n"
+ print("\n Execute SBE Test - Set FFDC Address\n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
@@ -134,7 +134,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_invalid_ring )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
diff --git a/src/test/testcases/testIstepAuto.py b/src/test/testcases/testIstepAuto.py
index 1d2cda07..aa92eb50 100755
--- a/src/test/testcases/testIstepAuto.py
+++ b/src/test/testcases/testIstepAuto.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import copy
from sim_commands import *
@@ -79,7 +80,7 @@ def sbe_istep_func( inum1, inum2, node=0, isfleetwood=0):
lIstepArray[startMajor][1] = lIstepArray[startMajor][0]
for major in range(startMajor, endMajor+1):
for minor in range(lIstepArray[major][0], lIstepArray[major][1] + 1):
- print "Running:"+str(major)+"."+str(minor)
+ print("Running:"+str(major)+"."+str(minor))
try:
TESTDATA = [0,0,0,3,
diff --git a/src/test/testcases/testIstepInvalid.py b/src/test/testcases/testIstepInvalid.py
index f735ea3e..fb73ba30 100755
--- a/src/test/testcases/testIstepInvalid.py
+++ b/src/test/testcases/testIstepInvalid.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testIstepInvalidFenced.py b/src/test/testcases/testIstepInvalidFenced.py
index 57a9bdf7..4c9ba55a 100755
--- a/src/test/testcases/testIstepInvalidFenced.py
+++ b/src/test/testcases/testIstepInvalidFenced.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testIstepSuccess.py b/src/test/testcases/testIstepSuccess.py
index 6c98f9d8..9275c00c 100755
--- a/src/test/testcases/testIstepSuccess.py
+++ b/src/test/testcases/testIstepSuccess.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testMatchStashPair.py b/src/test/testcases/testMatchStashPair.py
index 95606266..96dad640 100644
--- a/src/test/testcases/testMatchStashPair.py
+++ b/src/test/testcases/testMatchStashPair.py
@@ -21,6 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -47,8 +48,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read PBA - WO FMODE, WO LCO")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
#-------------------------------------------------
# Calling all test code
diff --git a/src/test/testcases/testMemPBA.py b/src/test/testcases/testMemPBA.py
index dc52bc38..b108339a 100644
--- a/src/test/testcases/testMemPBA.py
+++ b/src/test/testcases/testMemPBA.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
@@ -42,8 +43,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read PBA - WO FMODE, WO LCO")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
readData = testMemUtil.getmem(0x08000000, 128*3, 0x02)
@@ -55,10 +56,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read PBA - WO FMODE, WO LCO")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
# Second Case with Fast Mode without LCO
@@ -72,8 +73,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read PBA - W FMODE, WO LCO")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
readData = testMemUtil.getmem(0x08000000, 128*3, 0x22)
@@ -85,10 +86,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read PBA - W FMODE, WO LCO")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
# Third Case with Fast Mode with LCO
@@ -102,8 +103,8 @@ def main( ):
if(data == readData):
print ("Success - Write-Read PBA - W FMODE, W LCO")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Partial Write test
readData = testMemUtil.getmem(0x08000000, 128*3, 0x62)
@@ -115,10 +116,10 @@ def main( ):
if(sandwichData == readBackData):
print ("Success - Write_Part-Read PBA - W FMODE, W LCO")
else:
- print readData
- print data
- print readBackData
- print sandwichData
+ print(readData)
+ print(data)
+ print(readBackData)
+ print(sandwichData)
raise Exception('data mistmach')
#-------------------------------------------------
diff --git a/src/test/testcases/testMemUtil.py b/src/test/testcases/testMemUtil.py
index b73a5f39..c84c4dbb 100644
--- a/src/test/testcases/testMemUtil.py
+++ b/src/test/testcases/testMemUtil.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import os
import struct
@@ -140,8 +141,8 @@ def getmem(addr, len, flags):
readLen = testUtil.readDsEntryReturnVal()
if(getsingleword(lenExp) != list(readLen)):
- print getsingleword(lenExp)
- print list(readLen)
+ print(getsingleword(lenExp))
+ print(list(readLen))
raise Exception("Invalid Length")
expResp = [0xc0,0xde,0xa4,0x01,
@@ -184,7 +185,7 @@ def setUnsecureMemRegion(addr, size, controlFlag, responseWord):
# Host to SBE req
regObj = testPSUUtil.registry()
regObj.ExecuteTestOp(testPSUUtil.simSbeObj, req)
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5)
diff --git a/src/test/testcases/testPSUGetCapabilities.py b/src/test/testcases/testPSUGetCapabilities.py
index 922eb80e..4e4a5e82 100644
--- a/src/test/testcases/testPSUGetCapabilities.py
+++ b/src/test/testcases/testPSUGetCapabilities.py
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
import os
import struct
@@ -113,7 +113,7 @@ def getCapabilities(addr, size, exp_status):
)
# HOST->SBE data set execution - Less length setup
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
@@ -126,12 +126,12 @@ def main():
# Run Simics initially
testUtil.runCycles( 100000000 )
- print "\n Execute SBE Test - negative testcase - less size\n"
+ print("\n Execute SBE Test - negative testcase - less size\n")
getCapabilities(0x08000000, 30, 0x00020019)
- print "\n Execute SBE Test - negative testcase - not multiple of PBA\n"
+ print("\n Execute SBE Test - negative testcase - not multiple of PBA\n")
getCapabilities(0x08000000, 129, 0x00020019)
- print "\n Execute SBE Test - positive testcase \n"
+ print("\n Execute SBE Test - positive testcase \n")
getCapabilities(0x08000000, 128, 0)
testUtil.runCycles( 100000000 );
@@ -144,8 +144,8 @@ def main():
if(capMsg == readData):
print ("Success - PSU get capabilities")
else:
- print capMsg
- print readData
+ print(capMsg)
+ print(readData)
raise Exception('data mistmach')
if __name__ == "__main__":
diff --git a/src/test/testcases/testPSUReadSbeMem.py b/src/test/testcases/testPSUReadSbeMem.py
index a91fbc48..fb3d4620 100644
--- a/src/test/testcases/testPSUReadSbeMem.py
+++ b/src/test/testcases/testPSUReadSbeMem.py
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testPSUUtil
@@ -87,7 +87,7 @@ def readSeeprom(offset, size, destAddr, primStatus, secStatus):
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
@@ -101,13 +101,13 @@ def main():
# Run Simics initially
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test - Read SBE Mem\n"
+ print("\n Execute SBE Test - Read SBE Mem\n")
'''
Test Case 1
'''
readSeeprom(0, 128, 0x08000000, 0, 0)
- print "SUCCESS: read seeprom valid"
+ print("SUCCESS: read seeprom valid")
# Read data from cache and verify its contents
# seeprom header
@@ -117,34 +117,34 @@ def main():
for byte in range(len(seepprmHdr)):
if( ord(seepprmHdr[byte]) != readData[byte ]):
- print "Data mismtach at: ", byte ;
- print " expected: ", ord(seepprmHdr[byte]);
- print " Actual: ", readData[byte];
+ print("Data mismtach at: ", byte)
+ print(" expected: ", ord(seepprmHdr[byte]))
+ print(" Actual: ", readData[byte])
raise Exception('data mistmach');
'''
Test Case 2
'''
readSeeprom(0x38CA0, 0x180, 0x8973780, 0, 0)
- print "SUCCESS: read seeprom HB testcase"
+ print("SUCCESS: read seeprom HB testcase")
'''
Test Case 3
'''
readSeeprom(0x0, 0x40, 0x08000000, 0x03, 0x19)
- print "SUCCESS: read seeprom size not aligned"
+ print("SUCCESS: read seeprom size not aligned")
'''
Test Case 4
'''
readSeeprom(0x3fe80, 0x180, 0x08000000, 0x03, 0x19)
- print "SUCCESS: read seeprom size exceeded"
+ print("SUCCESS: read seeprom size exceeded")
'''
Test Case 5
'''
readSeeprom(0x7, 0x40, 0x08000000, 0x03, 0x19)
- print "SUCCESS: read seeprom offset not aligned"
+ print("SUCCESS: read seeprom offset not aligned")
if __name__ == "__main__":
main()
diff --git a/src/test/testcases/testPSUSetFFDCAddr.py b/src/test/testcases/testPSUSetFFDCAddr.py
index 5e0a3bc4..a113d42f 100644
--- a/src/test/testcases/testPSUSetFFDCAddr.py
+++ b/src/test/testcases/testPSUSetFFDCAddr.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
import testUtil
@@ -85,7 +86,7 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test - Set FFDC Address\n"
+ print("\n Execute SBE Test - Set FFDC Address\n")
'''
Test Case 1
@@ -93,7 +94,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
diff --git a/src/test/testcases/testPSUSetStashPair.py b/src/test/testcases/testPSUSetStashPair.py
index 378b101c..789f1841 100644
--- a/src/test/testcases/testPSUSetStashPair.py
+++ b/src/test/testcases/testPSUSetStashPair.py
@@ -21,7 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
import os
import struct
@@ -184,80 +184,80 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data1 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data2 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data3 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data4 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data5 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data6 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data7 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, host_test_data_success )
testUtil.runCycles( 10000000 );
- print "\n Execute SBE Test \n"
+ print("\n Execute SBE Test \n")
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data8 )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
#SBE->HOST data set execution
diff --git a/src/test/testcases/testPSUUserUtil.py b/src/test/testcases/testPSUUserUtil.py
index d6eac4af..86cd79b9 100644
--- a/src/test/testcases/testPSUUserUtil.py
+++ b/src/test/testcases/testPSUUserUtil.py
@@ -37,7 +37,7 @@
# 1.0 gkeishin 29/03/16 Initial create
#############################################################
'''
-
+from __future__ import print_function
import testPSUUtil
'''
@@ -55,5 +55,5 @@ either SUCCESS or FAILURE as an end result for generalization purpose.
##########################################################################
def classUtilFuncSample(i_paramArray):
for input in i_paramArray:
- print " classUtilFuncSample : parm: ",input
+ print(" classUtilFuncSample : parm: ",input)
return testPSUUtil.SUCCESS
diff --git a/src/test/testcases/testPSUUtil.py b/src/test/testcases/testPSUUtil.py
index 553f5ca1..34a0af50 100644
--- a/src/test/testcases/testPSUUtil.py
+++ b/src/test/testcases/testPSUUtil.py
@@ -40,6 +40,7 @@
#-------------------------
# Imports packages
#-------------------------
+from __future__ import print_function
import time
import conf
import testUtil
@@ -102,9 +103,9 @@ class registry(object):
# Read Reg value set or updated
#------------------------------
def getRegData(self):
- print " Addr : ",hex(self.regAddr)
- print " Value : ",self.regVal
- print " Size : ",self.regSize
+ print(" Addr : ",hex(self.regAddr))
+ print(" Value : ",self.regVal)
+ print(" Size : ",self.regSize)
#------------------------------
# Write to a Registry
@@ -113,9 +114,9 @@ class registry(object):
address = self.regAddr
value = self.stringToByte(self.regVal)
size = self.regSize
-# print " WData : 0x%s -> Byte Data %s"% (self.regVal,value)
-# print " Addr :", hex(address)
-# print " Size : %s Bytes"% size
+# print(" WData : 0x%s -> Byte Data %s"% (self.regVal,value))
+# print(" Addr :", hex(address))
+# print(" Size : %s Bytes"% size)
self.__write(objType,address,value,size)
return
@@ -130,8 +131,8 @@ class registry(object):
size = 8
for i in range (entryCount):
value = stringToByte(data[i])
-# print "\n Writting ", hex(REGDATA_SBE[i])
-# print " %x %x %x %x %x %x %x %x" % (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7])
+# print("\n Writting ", hex(REGDATA_SBE[i]))
+# print(" %x %x %x %x %x %x %x %x" % (value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]))
simObj.write(None, REGDATA_SBE[regIndex],
(value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]),
size)
@@ -151,7 +152,7 @@ class registry(object):
simObj.write(None, address,
(value[0],value[1],value[2],value[3],value[4],value[5],value[6],value[7]),
size)
- print " SIM obj: Write %s bytes [ OK ] " % size
+ print(" SIM obj: Write %s bytes [ OK ] " % size)
return
#---------------------------
@@ -162,9 +163,9 @@ class registry(object):
size = self.regSize
value = self.regVal
# if int(value) !=0:
-# print " RData :", value
-# print " Addr :", hex(address)
-# print " Size : %s Bytes"% size
+# print(" RData :", value)
+# print(" Addr :", hex(address))
+# print(" Size : %s Bytes"% size)
value = self.__read(objType,address,size)
return value
@@ -181,20 +182,20 @@ class registry(object):
value = self.regVal # Max lentgth it should read
MaxAddr = address + value # This is the addres range it could read
-# print " MaxAddr Range:",hex(MaxAddr)
+# print(" MaxAddr Range:",hex(MaxAddr))
OffsetAddr = address
-# print " OffsetAddr:",hex(OffsetAddr)
+# print(" OffsetAddr:",hex(OffsetAddr))
-# print " Memory Entries to be read : %d" % (value/8)
-# print " Match Magic Number : ", magicNum
+# print(" Memory Entries to be read : %d" % (value/8))
+# print(" Match Magic Number : ", magicNum)
while ( OffsetAddr <= MaxAddr):
sim_data = self.__read(objType,OffsetAddr,size)
-# print " ", hex(OffsetAddr),self.joinListDataToHex(sim_data).upper()
+# print(" ", hex(OffsetAddr),self.joinListDataToHex(sim_data).upper())
OffsetAddr += 8
if self.validateTestMemOp(sim_data,magicNum) == True:
-# print " Test validated .. [ OK ]"
+# print(" Test validated .. [ OK ]")
return SUCCESS
return FAILURE # Failed validation
@@ -205,7 +206,7 @@ class registry(object):
def __read(self, Targetobj, address, size):
simObj = SIM_get_interface(Targetobj, "memory_space")
value = simObj.read(None, address, size, 0x0)
- #print " SIM obj: Read %s bytes [ OK ] " % size
+ #print(" SIM obj: Read %s bytes [ OK ] " % size)
return value
#--------------------------------
@@ -251,14 +252,14 @@ class registry(object):
#--------------------------------------------
for l_params in test_bucket:
#--------------------------------------------
-# print " Desc : %s " % l_params[5]
-# print " Op : %s " % l_params[0]
+# print(" Desc : %s " % l_params[5])
+# print(" Op : %s " % l_params[0])
if "func" == l_params[0]:
- print " Func : %s " % l_params[1]
+ print(" Func : %s " % l_params[1])
if l_params[4] != "None":
- print " Expect : %s " % l_params[4]
+ print(" Expect : %s " % l_params[4])
if "func" == l_params[0]:
- print " Function Params :",l_params[2]
+ print(" Function Params :",l_params[2])
else:
# addr, value, size
self.setRegData(l_params[1],l_params[2],l_params[3])
@@ -277,16 +278,16 @@ class registry(object):
'''
if l_params[4] != "None":
if self.validateTestOp(sim_data,l_params[4]) == True:
- print " Test validated .. [ OK ]"
+ print(" Test validated .. [ OK ]")
else:
- print " ++++++++++++++++++++++++++++++++++++++++++"
- print " simics Data : ", sim_data
- print " simics Hex : ", self.joinListDataToHex(sim_data).upper()
+ print(" ++++++++++++++++++++++++++++++++++++++++++")
+ print(" simics Data : ", sim_data)
+ print(" simics Hex : ", self.joinListDataToHex(sim_data).upper())
if(raiseException == True):
raise Exception('Data mistmach');
return FAILURE # Failed validation
# else:
-# print " ++++++++++++++++++++++++++++++++++++++++++"
+# print(" ++++++++++++++++++++++++++++++++++++++++++")
elif "write" == l_params[0]:
self.writeToReg(testOp)
elif "memRead" == l_params[0]:
@@ -297,27 +298,27 @@ class registry(object):
rc = self.loadFunc( l_params[1], l_params[2] )
return rc
else:
- print "\n Invalid Test Data"
+ print("\n Invalid Test Data")
if(raiseException == True):
raise Exception('Invalid Test Data');
return FAILURE # Unknown entry op
- print "\n"
+ print("\n")
return SUCCESS
#----------------------------------------------------
# Validate simulator data against test data
#----------------------------------------------------
def validateTestOp(self, sim_data, test_data):
- print " Test Expects : 0x%s " % test_data
- print " Expect bytes : ", self.stringToByte(test_data)
+ print(" Test Expects : 0x%s " % test_data)
+ print(" Expect bytes : ", self.stringToByte(test_data))
if self.compareList(self.stringToByte(test_data), sim_data, "None") == True:
- print " Test ... [ OK ] "
- print " ++++++++++++++++++++++++++++++++++++++++++"
+ print(" Test ... [ OK ] ")
+ print(" ++++++++++++++++++++++++++++++++++++++++++")
return SUCCESS
else:
- print " Test Failed... !!!"
- print " ++++++++++++++++++++++++++++++++++++++++++"
+ print(" Test Failed... !!!")
+ print(" ++++++++++++++++++++++++++++++++++++++++++")
return FAILURE
#----------------------------------------------------
@@ -336,11 +337,11 @@ class registry(object):
def compareList(self, expList, resList, opType):
for i in range(0,8):
if int(expList[i]) == int(resList[i]):
- #print " %s : %s " % (expList[i],resList[i])
+ #print(" %s : %s " % (expList[i],resList[i]))
continue
else:
if opType != "memRead":
- print " Error \t %s : %s [ Mismatch ]" % (expList[i],resList[i])
+ print(" Error \t %s : %s [ Mismatch ]" % (expList[i],resList[i]))
return False # mismatch
return # Return nothing for Next Mem byte read
return True
@@ -357,7 +358,7 @@ class registry(object):
if rc == SUCCESS:
break
elif retries <= 0:
- print " Retrials exhausted... Exiting polling"
+ print(" Retrials exhausted... Exiting polling")
raise Exception('Polling Failed for - ' + l_param[5]);
break
else:
diff --git a/src/test/testcases/testPsuHostPassThrough.py b/src/test/testcases/testPsuHostPassThrough.py
index d63bd212..8d3beb96 100644
--- a/src/test/testcases/testPsuHostPassThrough.py
+++ b/src/test/testcases/testPsuHostPassThrough.py
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testPSUUtil
@@ -97,7 +97,7 @@ def main():
# Intialize the class obj instances
regObj = testPSUUtil.registry() # Registry obj def for operation
- print "\n Execute SBE Test - Set Pass through Address\n"
+ print("\n Execute SBE Test - Set Pass through Address\n")
'''
Test Case 1
@@ -105,7 +105,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
@@ -125,8 +125,8 @@ def main():
if(data == readData):
print ("Success - Write-Read PBA - With Pass through Mode")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# Send an invalid size, it should fail
testMemUtil.getmem_failure(0x00000000, 128*4, 0x102, 0x0002000a)
diff --git a/src/test/testcases/testPutGetRegFpr.py b/src/test/testcases/testPutGetRegFpr.py
index 95444633..4f2e1a37 100755
--- a/src/test/testcases/testPutGetRegFpr.py
+++ b/src/test/testcases/testPutGetRegFpr.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testPutGetRegGpr.py b/src/test/testcases/testPutGetRegGpr.py
index 6a0463a0..d8ddcd38 100755
--- a/src/test/testcases/testPutGetRegGpr.py
+++ b/src/test/testcases/testPutGetRegGpr.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testPutGetRegSpr.py b/src/test/testcases/testPutGetRegSpr.py
index 5b77d297..acb3919d 100755
--- a/src/test/testcases/testPutGetRegSpr.py
+++ b/src/test/testcases/testPutGetRegSpr.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testPutMem_fail.py b/src/test/testcases/testPutMem_fail.py
index f683a9c8..822a39b3 100644
--- a/src/test/testcases/testPutMem_fail.py
+++ b/src/test/testcases/testPutMem_fail.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testQuiesce.py b/src/test/testcases/testQuiesce.py
index c6e6c987..a0edf412 100755
--- a/src/test/testcases/testQuiesce.py
+++ b/src/test/testcases/testQuiesce.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testRunTillSbeBooted.py b/src/test/testcases/testRunTillSbeBooted.py
index 0e5898e4..87098c89 100644
--- a/src/test/testcases/testRunTillSbeBooted.py
+++ b/src/test/testcases/testRunTillSbeBooted.py
@@ -21,6 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
@@ -35,11 +36,11 @@ lbus = conf.p9Proc0.proc_lbus_map
while True:
try:
if testUtil.read(lbus, 0x2824, 4)[0] & 0x80 :
- print "SBE is booted, continue"
+ print("SBE is booted, continue")
break
else:
- print "SBE is still not booted"
+ print("SBE is still not booted")
except:
- print "."
+ print(".")
testUtil.runCycles( 10000000 )
diff --git a/src/test/testcases/testSbeDump.py b/src/test/testcases/testSbeDump.py
index f4f472a2..cb5022c8 100644
--- a/src/test/testcases/testSbeDump.py
+++ b/src/test/testcases/testSbeDump.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest")
import testUtil
@@ -92,7 +93,7 @@ def main():
#read user data id
data = testUtil.readDsEntryReturnVal()
id = (data[0] << 8) | data[1]
- print "User data Id ["+str(hex(id))+"]"
+ print("User data Id ["+str(hex(id))+"]")
len = (data[2] << 8) | data[3]
#if it is trace field SBE_FFDC_TRACE_DUMP
fileName = ""
diff --git a/src/test/testcases/testSecurity.py b/src/test/testcases/testSecurity.py
index 770ef012..65f8edd6 100644
--- a/src/test/testcases/testSecurity.py
+++ b/src/test/testcases/testSecurity.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import sys
import struct
@@ -82,23 +83,23 @@ def main():
whitelist_table1,
whitelist_table2,
whitelist_table3)
- print "generated whitelist validation passed"
+ print("generated whitelist validation passed")
test_normal('blacklist',
blacklist,
blacklist_table1,
blacklist_table2,
blacklist_table3)
- print "generated blacklist validation passed"
+ print("generated blacklist validation passed")
# getscom success
testScomUtil.getscom(0x0204001A)
- print "getscom success testcase - passed"
+ print("getscom success testcase - passed")
# getscom failure
testScomUtil.getscom(eval(BLACKLISTED_REG_FOR_READ_TEST), [0x00, 0x05, 0x00, 0x23])
- print "getscom failure testcase - passed"
+ print("getscom failure testcase - passed")
# putscom success
testScomUtil.putscom(eval(WHITELISTED_REG_FOR_WRITE_TEST), testScomUtil.getscom(eval(WHITELISTED_REG_FOR_WRITE_TEST)))
- print "putscom success testcase - passed"
+ print("putscom success testcase - passed")
# putscom failure
while(True):
random_addr = struct.unpack('>L', os.urandom(4))[0]
@@ -106,21 +107,21 @@ def main():
if not ((random_addr & 0x80000000) or (random_addr & 0x00F00000)):
testScomUtil.putscom(random_addr, 0, [0x00, 0x05, 0x00, 0x23])
break
- print "putscom failure testcase - passed"
+ print("putscom failure testcase - passed")
# modify scom success
dataWritten = testScomUtil.getscom(0x00040006)
testScomUtil.modifyScom(0x01, 0x00040006, 0x0)
dataRead = testScomUtil.getscom(0x00040006)
if(dataRead != dataWritten):
raise Exception('modify scom failed %x != %x' % (dataRead, dataWritten))
- print "modify scom success testcase - passed"
+ print("modify scom success testcase - passed")
# putscom under mask success
dataWritten = testScomUtil.getscom(0x00040006)
testScomUtil.putScomUnderMask(0x00040006, dataWritten, 0xFFFFFFFFFFFFFFFF)
dataRead = testScomUtil.getscom(0x00040006)
if(dataRead != dataWritten):
raise Exception('PutScom under mask failed %x != %x' % (dataRead, dataWritten))
- print "putscom under mask success testcase - passed"
+ print("putscom under mask success testcase - passed")
# Greylist test cases
dataWritten = testScomUtil.getscom(0x0901080B)
@@ -132,7 +133,7 @@ def main():
testScomUtil.putScomUnderMask(0x0901080B, dataWritten, 0xFF0FFFFFFF0FFFFF)
# Do putScomUnderMask with superset mask
testScomUtil.putScomUnderMask(0x0901080B, dataWritten, 0xFF00FFFFFF0FFFFF)
- print "Greylist testcases - passed"
+ print("Greylist testcases - passed")
# indirect scom test
dataWritten = testScomUtil.getscom(0x8000000D06010C3F)
@@ -141,7 +142,7 @@ def main():
dataRead = testScomUtil.getscom(0x8000000D06010C3F)
if(dataRead != dataWritten):
raise Exception('indirect scom test failed %x != %x' % (dataRead, dataWritten))
- print "Indirect scom success testcase - passed"
+ print("Indirect scom success testcase - passed")
except Exception, error:
raise Exception(error)
@@ -154,11 +155,11 @@ def test_normal(id, list, table1, table2, table3):
table1,
table2,
table3)):
- print id, list
- print 'table1:', table1
- print 'table2:', table2
- print 'table3:', table3
- print "Failed Addr", hex(addr)
+ print(id, list)
+ print('table1:', table1)
+ print('table2:', table2)
+ print('table3:', table3)
+ print("Failed Addr", hex(addr))
raise Exception(id+' positive testcase')
# negative testcase - number of random addresses checked is configurable
i = 0
@@ -169,11 +170,11 @@ def test_normal(id, list, table1, table2, table3):
i = i-1
else:
if(True == is_present(random_addr, table1, table2, table3)):
- print id, list
- print 'table1:', table1
- print 'table2:', table2
- print 'table3:', table3
- print "Failed Addr", hex(random_addr)
+ print(id, list)
+ print('table1:', table1)
+ print('table2:', table2)
+ print('table3:', table3)
+ print("Failed Addr", hex(random_addr))
raise Exception(id+' negative testcase')
def test_brute_force(id, list, table1, table2, table3):
@@ -186,18 +187,18 @@ def test_brute_force(id, list, table1, table2, table3):
sys.stdout.write("Progress: addr[0x%08x] last_addr[0x%08x]" % (addr, last_addr) )
sys.stdout.flush()
if(True == is_present(addr, table1, table2, table3)):
- print id, list
- print 'table1:', table1
- print 'table2:', table2
- print 'table3:', table3
- print "Failed Addr", hex(addr)
+ print(id, list)
+ print('table1:', table1)
+ print('table2:', table2)
+ print('table3:', table3)
+ print("Failed Addr", hex(addr))
raise Exception(id+' brute force testcase')
addr = addr + 1
def is_present(addr, table1, table2, table3):
t1_addr = (addr & 0xFF000000) >> 24;
if(DEBUG):
- print "find", t1_addr, "in table1"
+ print("find", t1_addr, "in table1")
for id1, (chiplet_range, count) in enumerate(table1):
start = (chiplet_range & 0xFF00) >> 8
end = chiplet_range & 0x00FF
@@ -209,7 +210,7 @@ def is_present(addr, table1, table2, table3):
last_t2 = count-1
t2_addr = (addr & 0x00FF0000) >> 16;
if(DEBUG):
- print "find", t2_addr, "in table2", first_t2, last_t2
+ print("find", t2_addr, "in table2", first_t2, last_t2)
(found, id2) = binary_search(t2_addr, table2, first_t2, last_t2, True)
if(found):
if(id2-1 < 0):
@@ -219,11 +220,11 @@ def is_present(addr, table1, table2, table3):
last_t3 = table2[id2][1]-1
t3_addr = (addr & 0x0000FFFF)
if(DEBUG):
- print "find",t3_addr,"in table3", first_t3, last_t3
+ print("find",t3_addr,"in table3", first_t3, last_t3)
(found, id3) = binary_search(t3_addr, table3, first_t3, last_t3)
if(found):
if(DEBUG):
- print "found"
+ print("found")
return True
return False
diff --git a/src/test/testcases/testSecurityListDump.py b/src/test/testcases/testSecurityListDump.py
index fb529b5a..f6932a6e 100644
--- a/src/test/testcases/testSecurityListDump.py
+++ b/src/test/testcases/testSecurityListDump.py
@@ -21,6 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
import testUtil
@@ -75,7 +76,7 @@ def main():
regObj = testPSUUtil.registry() # Registry obj def for operation
testUtil.runCycles( 1000000 );
- print "\n Execute SBE Test [ System Fabric Map ] ...\n"
+ print("\n Execute SBE Test [ System Fabric Map ] ...\n")
'''
Test Case 1
@@ -83,7 +84,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
diff --git a/src/test/testcases/testSram.py b/src/test/testcases/testSram.py
index 8e775127..a8bbb47e 100644
--- a/src/test/testcases/testSram.py
+++ b/src/test/testcases/testSram.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import os
sys.path.append("targets/p9_nimbus/sbeTest" )
@@ -79,8 +80,8 @@ def getsram(addr, mode, length, primStatus, secStatus):
data += list(testUtil.readDsEntryReturnVal())
readLen = testUtil.readDsEntryReturnVal()
if(getsingleword(length) != list(readLen)):
- print getsingleword(length)
- print list(readLen)
+ print(getsingleword(length))
+ print(list(readLen))
raise Exception("Invalid Length")
expResp = (getsingleword(0xc0dea403)
@@ -110,8 +111,8 @@ def main( ):
if(data == readData):
print("Success: put - get sram")
else:
- print data
- print readData
+ print(data)
+ print(readData)
raise Exception('data mistmach')
# secure mem - write to disallowed mem
@@ -154,7 +155,7 @@ def main( ):
#testUtil.readDsFifo( GETSRAM_OCC_EXPDATA_1 )
#testUtil.readEot( )
except:
- print "FAILED Test Case:"+str(testcase)
+ print("FAILED Test Case:"+str(testcase))
raise Exception('Failure')
#-------------------------------------------------
diff --git a/src/test/testcases/testStartInstruction.py b/src/test/testcases/testStartInstruction.py
index 5150a13d..c46004c8 100644
--- a/src/test/testcases/testStartInstruction.py
+++ b/src/test/testcases/testStartInstruction.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testStopClocks.py b/src/test/testcases/testStopClocks.py
index 6d665010..c6b498ca 100644
--- a/src/test/testcases/testStopClocks.py
+++ b/src/test/testcases/testStopClocks.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testStopInstruction.py b/src/test/testcases/testStopInstruction.py
index 0ee8e177..6fe6dfbc 100644
--- a/src/test/testcases/testStopInstruction.py
+++ b/src/test/testcases/testStopInstruction.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testSuspendIO.py b/src/test/testcases/testSuspendIO.py
index 2d30b44d..ecec1384 100755
--- a/src/test/testcases/testSuspendIO.py
+++ b/src/test/testcases/testSuspendIO.py
@@ -21,7 +21,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testSystemFabricMap.py b/src/test/testcases/testSystemFabricMap.py
index 56163c02..bf41f051 100644
--- a/src/test/testcases/testSystemFabricMap.py
+++ b/src/test/testcases/testSystemFabricMap.py
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-
+from __future__ import print_function
import testPSUUtil
import testRegistry as reg
import testUtil
@@ -77,7 +77,7 @@ def main():
regObj = testPSUUtil.registry() # Registry obj def for operation
testUtil.runCycles( 1000000 );
- print "\n Execute SBE Test [ System Fabric Map ] ...\n"
+ print("\n Execute SBE Test [ System Fabric Map ] ...\n")
'''
Test Case 1
@@ -85,7 +85,7 @@ def main():
# HOST->SBE data set execution
regObj.ExecuteTestOp( testPSUUtil.simSbeObj, sbe_test_data )
- print "\n Poll on Host side for INTR ...\n"
+ print("\n Poll on Host side for INTR ...\n")
#Poll on HOST DoorBell Register for interrupt
regObj.pollingOn( testPSUUtil.simSbeObj, host_polling_data, 5 )
diff --git a/src/test/testcases/testTraceArray.py b/src/test/testcases/testTraceArray.py
index eb6c67d7..32a65ac2 100644
--- a/src/test/testcases/testTraceArray.py
+++ b/src/test/testcases/testTraceArray.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
sys.path.append("targets/p9_nimbus/sbeTest" )
import testUtil
diff --git a/src/test/testcases/testUnsecureMemRegions.py b/src/test/testcases/testUnsecureMemRegions.py
index a3c19cd7..350242f9 100644
--- a/src/test/testcases/testUnsecureMemRegions.py
+++ b/src/test/testcases/testUnsecureMemRegions.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import sys
import os
import struct
diff --git a/src/test/testcases/testUtil.py b/src/test/testcases/testUtil.py
index 35c20720..5551cad3 100644
--- a/src/test/testcases/testUtil.py
+++ b/src/test/testcases/testUtil.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import time
import conf
from sim_commands import *
@@ -249,13 +250,13 @@ def runCycles( cycles ):
syscmd = "run-cycles %d"%(cycles)
( rc, out ) = quiet_run_command( syscmd, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( syscmd, rc )
+ print("simics ERROR running %s: %d "%( syscmd, rc ))
def checkEqual( data, expdata ):
""" Throw exception if data is not equal """
if( cmp(data, expdata )):
- print "Eqality check failed"
- print "Data:", data
- print "Expected Data", expdata
+ print("Eqality check failed")
+ print("Data:", data)
+ print("Expected Data", expdata)
raise Exception('data mistmach');
diff --git a/src/tools/debug/sbe-debug.py b/src/tools/debug/sbe-debug.py
index 234d1501..8ae5cfa0 100755
--- a/src/tools/debug/sbe-debug.py
+++ b/src/tools/debug/sbe-debug.py
@@ -23,6 +23,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import subprocess
import re
@@ -63,7 +64,7 @@ def getFilePath(filename):
retPath = os.path.join(dir, filename)
if(os.path.exists(retPath)):
return os.path.abspath(retPath)
- print "ERROR: file " + filename +" not found"
+ print("ERROR: file " + filename +" not found")
return 1
def getTraceFilePath():
@@ -84,7 +85,7 @@ def fillSymTable():
if( len( words ) == 4 ):
syms[words[3]] = [words[0], words[1]]
except:
- print "Symbol file not found, limited commands avaliable"
+ print("Symbol file not found, limited commands avaliable")
def getSymbolInfo( symbol ):
symAddr = ''
@@ -93,7 +94,7 @@ def getSymbolInfo( symbol ):
if(re.search(symbol, key)!= None):
symAddr = val[0]
length = val[1]
- print "\n symAddress :", symAddr
+ print("\n symAddress :", symAddr)
offset = int(symAddr, base = 16) - baseAddr;
return (hex(offset), length)
@@ -126,13 +127,13 @@ def getSymbolVal(symbol, hexdump=False):
if hexdump:
invokeOsCmd( "hexdump -C "+ output_path +"DumpPIBMEM" )
else:
- print "symbol not found"
+ print("symbol not found")
def invokeOsCmd(cmd):
- print "Running command [" + cmd + "]"
+ print("Running command [" + cmd + "]")
rc = os.system( cmd )
if ( rc ):
- print "ERROR running command: %d " % ( rc )
+ print("ERROR running command: %d " % ( rc ))
return 1
'''
@@ -169,13 +170,13 @@ def forcedCollectTrace():
trace_pattern = [0, 2, 0, 0] + [ord(a) for a in image_str] + [0]
data_read = [0] * len(trace_pattern)
trace_index = 0
- #print trace_pattern
+ #print(trace_pattern)
with open(output_path+"DumpPIBMEM", "r") as f:
byte = 'x'
while byte != "":
byte = f.read(1)
data_read = data_read[1:]+[ord(byte)]
- #print [chr(a) for a in data_read]
+ #print([chr(a) for a in data_read])
if data_read == trace_pattern:
trace_index -= len(trace_pattern)-1
break
@@ -216,8 +217,8 @@ def collectStackUsage():
# Dump stack memory to binary file
invokeOsCmd( "cat "+ output_path +"DumpPIBMEM >"+ output_path + thread )
- print "==================================Stack usage==================================="
- print "Thread".ljust(40)+"Least Available[bytes]".ljust(30)+"Max usage[%]"
+ print("==================================Stack usage===================================")
+ print("Thread".ljust(40)+"Least Available[bytes]".ljust(30)+"Max usage[%]")
for thread in threads:
with open(output_path+thread, "rb") as f:
word = struct.unpack('I', f.read(4))[0]
@@ -231,7 +232,7 @@ def collectStackUsage():
break
else:
break
- print str("["+thread+"]").ljust(40) + str(leastAvailable).ljust(30) + str("%.2f" % (100 * (1 - (leastAvailable/float(int("0x"+syms[thread][1], 16))))))
+ print(str("["+thread+"]").ljust(40) + str(leastAvailable).ljust(30) + str("%.2f" % (100 * (1 - (leastAvailable/float(int("0x"+syms[thread][1], 16)))))))
def getSbeCommit():
getSymbolVal( 'SBEGlobalsSingleton.*fwCommitId' )
@@ -239,7 +240,7 @@ def getSbeCommit():
with open(output_path+"DumpPIBMEM", "rb") as f:
# Big Endian word
word = struct.unpack('>I', f.read(4))[0]
- print "SBE commit:", hex(word)
+ print("SBE commit:", hex(word))
def ppeStateFfdc():
# Keep this structure in sync with src/sbefw/core/sbeirqregistersave.H
@@ -264,25 +265,25 @@ def ppeStateFfdc():
data = f.read()
ctypes.memmove(ctypes.addressof(ppestateffdc), data, ctypes.sizeof(ppestateffdc))
- print '''
+ print('''
---------------------------------------------------------------------------------
Please verify sbe_DD2.syms is valid for this dump, before depending on the values
----------------------------------------------------------------------------------'''
+---------------------------------------------------------------------------------''')
if ppestateffdc.validbyte == 0x1 and ppestateffdc.magicbyte == 0xA5:
- print "ppestateffdc.version 0x%04X" % ppestateffdc.version
- print "ppestateffdc.magicbyte 0x%02X" % ppestateffdc.magicbyte
- print "ppestateffdc.validbyte 0x%02X" % ppestateffdc.validbyte
- print "ppestateffdc.register_SRR0 0x%08X" % ppestateffdc.register_SRR0
- print "ppestateffdc.register_SRR1 0x%08X" % ppestateffdc.register_SRR0
- print "ppestateffdc.register_ISR 0x%08X" % ppestateffdc.register_ISR
- print "ppestateffdc.register_FI2C_CONFIG_LOWER_32BITS 0x%08X" % ppestateffdc.register_FI2C_CONFIG_LOWER_32BITS
- print "ppestateffdc.register_FI2C_CONFIG_UPPER_32BITS 0x%08X" % ppestateffdc.register_FI2C_CONFIG_UPPER_32BITS
- print "ppestateffdc.register_FI2C_STAT_LOWER_32BITS 0x%08X" % ppestateffdc.register_FI2C_STAT_LOWER_32BITS
- print "ppestateffdc.register_FI2C_STAT_UPPER_32BITS 0x%08X" % ppestateffdc.register_FI2C_STAT_UPPER_32BITS
- print "ppestateffdc.register_LR 0x%08X" % ppestateffdc.register_LR
+ print("ppestateffdc.version 0x%04X" % ppestateffdc.version)
+ print("ppestateffdc.magicbyte 0x%02X" % ppestateffdc.magicbyte)
+ print("ppestateffdc.validbyte 0x%02X" % ppestateffdc.validbyte)
+ print("ppestateffdc.register_SRR0 0x%08X" % ppestateffdc.register_SRR0)
+ print("ppestateffdc.register_SRR1 0x%08X" % ppestateffdc.register_SRR0)
+ print("ppestateffdc.register_ISR 0x%08X" % ppestateffdc.register_ISR)
+ print("ppestateffdc.register_FI2C_CONFIG_LOWER_32BITS 0x%08X" % ppestateffdc.register_FI2C_CONFIG_LOWER_32BITS)
+ print("ppestateffdc.register_FI2C_CONFIG_UPPER_32BITS 0x%08X" % ppestateffdc.register_FI2C_CONFIG_UPPER_32BITS)
+ print("ppestateffdc.register_FI2C_STAT_LOWER_32BITS 0x%08X" % ppestateffdc.register_FI2C_STAT_LOWER_32BITS)
+ print("ppestateffdc.register_FI2C_STAT_UPPER_32BITS 0x%08X" % ppestateffdc.register_FI2C_STAT_UPPER_32BITS)
+ print("ppestateffdc.register_LR 0x%08X" % ppestateffdc.register_LR)
else:
- print "Register ffdc is not valid, probably SBE has not hit any internal halt condition"
- print '''---------------------------------------------------------------------------------'''
+ print("Register ffdc is not valid, probably SBE has not hit any internal halt condition")
+ print('''---------------------------------------------------------------------------------''')
def ppeState():
if(target == 'FILE'):
@@ -351,12 +352,12 @@ def ppeState():
30 : ["R30", False],
31 : ["R31", False]
}
- print "File path: ", file_path
+ print("File path: ", file_path)
fileHandle = open(file_path)
l_cnt = 0
- print '********************************************************************'
- print 'Reg'.ljust(15),'Reg Value'.ljust(20)
- print '--------------------------------------------------------------------'
+ print('********************************************************************')
+ print('Reg'.ljust(15),'Reg Value'.ljust(20))
+ print('--------------------------------------------------------------------')
while(l_cnt < os.path.getsize(file_path)):
regNum = int(binascii.hexlify(fileHandle.read(2)), 16)
str1 = ''
@@ -371,10 +372,10 @@ def ppeState():
except:
str1 = hex(regNum)
str3 = binascii.hexlify(fileHandle.read(4))
- print str(str1).ljust(15),str(str3).ljust(20)
+ print(str(str1).ljust(15),str(str3).ljust(20))
l_cnt = l_cnt + 6;
- print '********************************************************************'
+ print('********************************************************************')
fileHandle.close()
else:
invokeOsCmd(getFilePath("p9_ppe_state_wrap.exe")+" -verbose -sbe -snapshot"+
@@ -382,19 +383,19 @@ def ppeState():
def sbeLocalRegister():
if(target == 'FILE'):
- print "File path: ", file_path
+ print("File path: ", file_path)
fileHandle = open(file_path)
l_cnt = 0
- print '********************************************************************'
- print 'Reg Number Reg Value Reg String'
+ print('********************************************************************')
+ print('Reg Number Reg Value Reg String')
while(l_cnt < os.path.getsize(file_path)):
str1 = binascii.hexlify(fileHandle.read(2))
str2 = fileHandle.read(32)
str3 = binascii.hexlify(fileHandle.read(8))
- print str(str1).ljust(11),str(str3).ljust(20),str2.ljust(40)
+ print(str(str1).ljust(11),str(str3).ljust(20),str2.ljust(40))
l_cnt = l_cnt + 42;
- print '********************************************************************'
+ print('********************************************************************')
fileHandle.close()
else:
invokeOsCmd(getFilePath("p9_sbe_localreg_dump_wrap.exe")+" -verbose -halt"+
@@ -402,19 +403,19 @@ def sbeLocalRegister():
def sbeState():
if(target == 'FILE'):
- print "File path: ", file_path
+ print("File path: ", file_path)
fileHandle = open(file_path)
l_cnt = 0
- print '********************************************************************'
- print 'Reg Number Reg Value Reg String'
+ print('********************************************************************')
+ print('Reg Number Reg Value Reg String')
while(l_cnt < os.path.getsize(file_path)):
str1 = binascii.hexlify(fileHandle.read(4))
str2 = fileHandle.read(32)
str3 = binascii.hexlify(fileHandle.read(8))
- print str(str1).ljust(11),str(str3).ljust(20),str2.ljust(40)
+ print(str(str1).ljust(11),str(str3).ljust(20),str2.ljust(40))
l_cnt = l_cnt + 44;
- print '********************************************************************'
+ print('********************************************************************')
fileHandle.close()
else:
invokeOsCmd(getFilePath("p9_pibms_reg_dump_wrap.exe")+" -verbose" +\
@@ -422,17 +423,17 @@ def sbeState():
def sbeStatus():
if(target == 'FILE'):
- print "Error - not supported for FILE Target"
+ print("Error - not supported for FILE Target")
else:
cmd = ("getcfam pu 2809" +\
" -n" + str(node) + " -p" + str(proc))
- print "cmd:", cmd
+ print("cmd:", cmd)
output = os.popen(cmd).read()
output = output.split()
expected_out = 'k0:n%1d:s0:p%02d'%(node,proc)
if (expected_out not in output):
- print "Error while getting the status register"
- print ' '.join(output)
+ print("Error while getting the status register")
+ print(' '.join(output))
else:
parsevalue(bin(int(output[output.index(expected_out)+1], 16)))
@@ -446,30 +447,30 @@ def parsevalue(iValue):
tempVal = iValue[2:3]
tempVal = 'True' if tempVal == '1' else 'False'
- print "SBE Booted : %s" %(tempVal)
+ print("SBE Booted : %s" %(tempVal))
tempVal = iValue[3:4]
tempVal = 'True' if tempVal == '1' else 'False'
- print "Async FFDC : %s" %(tempVal)
+ print("Async FFDC : %s" %(tempVal))
tempVal = iValue[4:6]
- print "Reserver Bit [2:3] : %s" %(tempVal)
+ print("Reserver Bit [2:3] : %s" %(tempVal))
tempVal = iValue[6:10]
- print "SBE Previous State : %s (%s)" %(sbeStates[tempVal], tempVal)
+ print("SBE Previous State : %s (%s)" %(sbeStates[tempVal], tempVal))
tempVal = iValue[10:14]
- print "SBE Current State : %s (%s)" %(sbeStates[tempVal], tempVal)
+ print("SBE Current State : %s (%s)" %(sbeStates[tempVal], tempVal))
tempVal = iValue[14:22]
- print "Istep Major : %s" %(int(tempVal, 2))
+ print("Istep Major : %s" %(int(tempVal, 2)))
tempVal = iValue[22:28]
- print "Istep Minor : %s" %(int(tempVal, 2))
+ print("Istep Minor : %s" %(int(tempVal, 2)))
tempVal = iValue[28:34]
- print "Reserved Bit [26:31] : %s" %(tempVal)
+ print("Reserved Bit [26:31] : %s" %(tempVal))
'''
@@ -506,7 +507,7 @@ def main( argv ):
try:
opts, args = getopt.getopt(sys.argv[1:], "l:t:n:p:d:s:f:o:h", ['level=', 'target=', 'node=', 'proc=', 'ddlevel=', 'symbol=', 'file_path=', 'output_path=','help'])
except getopt.GetoptError as err:
- print str(err)
+ print(str(err))
usage()
exit(1)
@@ -524,45 +525,45 @@ def main( argv ):
if arg in LEVELS_ARRAY:
level = arg
else:
- print "level should be one of " + str(LEVELS_ARRAY)
+ print("level should be one of " + str(LEVELS_ARRAY))
exit(1)
elif opt in ('-t', '--target'):
if arg in ('AWAN', 'HW', 'FILE'):
target = arg
else:
- print "target should be one of {AWAN,HW,FILE}"
+ print("target should be one of {AWAN,HW,FILE}")
exit(1)
elif opt in ('-n', '--node'):
try:
node = int(arg)
except:
- print "node should be an integer number"
+ print("node should be an integer number")
exit(1)
elif opt in ('-p', '--proc'):
try:
proc = int(arg)
except:
- print "proc should be an integer number"
+ print("proc should be an integer number")
exit(1)
elif opt in ('-d', '--ddlevel'):
if arg in ('DD1', 'DD2', 'AXONE'):
ddsuffix = arg
else:
- print "target should be one of {DD1, DD2, AXONE}"
+ print("target should be one of {DD1, DD2, AXONE}")
exit(1)
elif opt in ('-f', '--file_path'):
try:
file_path = arg
assert os.path.exists(arg), "Did not find the file at,"+str(arg)
except:
- print "file_path should a string path"
+ print("file_path should a string path")
exit(1)
elif opt in ('-o', '--output_path'):
try:
output_path = arg+"/"
assert os.path.exists(arg)
except:
- print "output_path should a string path"
+ print("output_path should a string path")
exit(1)
elif opt in ('-s', '--symbol'):
symbol = arg
@@ -573,7 +574,7 @@ def main( argv ):
# Example output: 'CNFG FILE GLOBAL_DEBUG: 8.VI.B\n\tk0 \nUSE_SBE_FIFO = off\n/afs/awd.austin.ibm.com/projects/eng/tools/cronus/p9/exe/dev/p9sim_dev_x86_64.exe getconfig USE_SBE_FIFO \n'
regEx = re.search('USE_SBE_FIFO.*=(.*)', cmdFifoLastState)
if (regEx == None):
- print "ERROR in getting USE_SBE_FIFO config"
+ print("ERROR in getting USE_SBE_FIFO config")
return 1
cmdFifoLastState = regEx.group(1).split()[0]
# On cronus, disabe FIFO mode
@@ -586,7 +587,7 @@ def main( argv ):
fillSymTable()
if ( level == 'all' ):
- print "Parsing everything"
+ print("Parsing everything")
collectTrace()
collectAttr()
sbeStatus()
diff --git a/src/tools/debug/simics-debug-framework.py b/src/tools/debug/simics-debug-framework.py
index 62be477f..23c3cab1 100755
--- a/src/tools/debug/simics-debug-framework.py
+++ b/src/tools/debug/simics-debug-framework.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import os
import os.path
import subprocess
@@ -46,7 +47,7 @@ def check_sbe_tools_path ():
cmd1 = "pipe \"echo $cec_type\" \"cat > temp1.map\""
( rc, out ) = quiet_run_command( cmd1, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd1, rc )
+ print("simics ERROR running %s: %d "%( cmd1, rc ))
with open('temp1.map', 'r') as f:
map = f.read().strip()
if(map == "p9_fleetwood"):
@@ -63,10 +64,10 @@ def get_dd_level(procNr = 0, nodeNr = 0):
else:
cmd = "pipe \"p9Proc"+str(procNr)+".sbe.mibo_space.map\" \"cat > temp.map\""
- print "simics running %s: "%( cmd)
+ print("simics running %s: "%( cmd))
( rc, out ) = quiet_run_command( cmd, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd, rc )
+ print("simics ERROR running %s: %d "%( cmd, rc ))
ddlevel = 'DD1'
with open('temp.map', 'r') as f:
map = f.read()
@@ -81,7 +82,7 @@ def get_dd_level(procNr = 0, nodeNr = 0):
ddlevel = "DD1"
if map[map.index('p9Proc'+str(procNr)+'.sbe.fi2c_bo:fi2cfsm')-1] == '0xff800000':
ddlevel = "DD2"
- print "running image - ["+ddlevel+"]"
+ print("running image - ["+ddlevel+"]")
return ddlevel
def register_sbe_debug_framework_tools():
@@ -125,12 +126,12 @@ def register_sbe_debug_framework_tools():
short = "Runs the debug framework for register ffdc ",
doc = "")
- print "SBE Debug Framework: Registered tool:", "sbe-istep"
- print "SBE Debug Framework: Registered tool:", "sbe-trace"
- print "SBE Debug Framework: Registered tool:", "sbe-stack"
- print "SBE Debug Framework: Registered tool:", "sbe-ddlevel"
- print "SBE Debug Framework: Registered tool:", "sbe-attrdump"
- print "SBE Debug Framework: Registered tool:", "sbe-regffdc"
+ print("SBE Debug Framework: Registered tool:", "sbe-istep")
+ print("SBE Debug Framework: Registered tool:", "sbe-trace")
+ print("SBE Debug Framework: Registered tool:", "sbe-stack")
+ print("SBE Debug Framework: Registered tool:", "sbe-ddlevel")
+ print("SBE Debug Framework: Registered tool:", "sbe-attrdump")
+ print("SBE Debug Framework: Registered tool:", "sbe-regffdc")
def fillSymTable():
@@ -153,7 +154,7 @@ def collectStackUsage ( procNr, nodeNr=0 ):
'sbeCommandReceiver_stack',
'sbe_Kernel_NCInt_stack',
'sbeAsyncCommandProcessor_stack')
- print "==================================Stack usage==================================="
+ print("==================================Stack usage===================================")
# Dump stack memory to binary files
for thread in threads:
if g_isFleetwood:
@@ -161,12 +162,12 @@ def collectStackUsage ( procNr, nodeNr=0 ):
cmd = "pipe \"D"+str(node)+"Proc"+str(procNr)+".sbe.mibo_space.x 0x" + syms[thread][0] + " 0x"+syms[thread][1]+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> "+thread+"\""
else:
cmd = "pipe \"p9Proc" + `procNr` + ".sbe.mibo_space.x 0x" + syms[thread][0] + " 0x"+syms[thread][1]+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> "+thread+"\""
- print "simics running %s: "%( cmd)
+ print("simics running %s: "%( cmd))
( rc, out ) = quiet_run_command( cmd, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd, rc )
+ print("simics ERROR running %s: %d "%( cmd, rc ))
- print "Thread".ljust(40)+"Least Available[bytes]".ljust(30)+"Max usage[%]"
+ print("Thread".ljust(40)+"Least Available[bytes]".ljust(30)+"Max usage[%]")
for thread in threads:
with open(thread, "rb") as f:
word = struct.unpack('I', f.read(4))[0]
@@ -177,7 +178,7 @@ def collectStackUsage ( procNr, nodeNr=0 ):
word = struct.unpack('I', f.read(4))[0]
else:
break
- print str("["+thread+"]").ljust(40) + str(leastAvailable).ljust(30) + str("%.2f" % (100 * (1 - (leastAvailable/float(int("0x"+syms[thread][1], 16))))))
+ print(str("["+thread+"]").ljust(40) + str(leastAvailable).ljust(30) + str("%.2f" % (100 * (1 - (leastAvailable/float(int("0x"+syms[thread][1], 16)))))))
def collectAttr( procNr, nodeNr=0 ):
global g_isFleetwood
@@ -186,10 +187,10 @@ def collectAttr( procNr, nodeNr=0 ):
cmd= "pipe \"D"+str(node)+"Proc"+str(procNr)+".sbe.mibo_space.x " + '0xFFFE8000' + " "+hex(96*1024)+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> DumpFullPIBMEM\""
else:
cmd= "pipe \"p9Proc" + `procNr` + ".sbe.mibo_space.x " + '0xFFFE8000' + " "+hex(96*1024)+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> DumpFullPIBMEM\""
- print "simics running %s: "%( cmd)
+ print("simics running %s: "%( cmd))
( rc, out ) = quiet_run_command( cmd, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd, rc )
+ print("simics ERROR running %s: %d "%( cmd, rc ))
ddlevel = get_dd_level(procNr, nodeNr)
sbeDebug.ddsuffix = ddlevel
sbeDebug.target = 'FILE'
@@ -204,10 +205,10 @@ def collectRegFfdc( procNr, nodeNr=0 ):
cmd= "pipe \"D"+str(node)+"Proc"+str(procNr)+".sbe.mibo_space.x " + '0xFFFE8000' + " "+hex(96*1024)+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> DumpFullPIBMEM\""
else:
cmd= "pipe \"p9Proc" + `procNr` + ".sbe.mibo_space.x " + '0xFFFE8000' + " "+hex(96*1024)+"\" \"sed 's/^p:0x........ //g' | sed 's/ ................$//g' | sed 's/ //g' | xxd -r -p> DumpFullPIBMEM\""
- print "simics running %s: "%( cmd)
+ print("simics running %s: "%( cmd))
( rc, out ) = quiet_run_command( cmd, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd, rc )
+ print("simics ERROR running %s: %d "%( cmd, rc ))
ddlevel = get_dd_level(procNr, nodeNr)
sbeDebug.ddsuffix = ddlevel
sbeDebug.target = 'FILE'
@@ -232,10 +233,10 @@ def collectTrace ( procNr, nodeNr=0 ):
cmd3 = "shell \"" + "fsp-trace -s " + SBE_TOOLS_PATH + "/sbeStringFile_"+get_dd_level(procNr, nodeNr)+" sbetrace.bin >" + fileName + "\""
cmd4 = "shell \"" + "cat " + fileName + "\""
- print "simics running %s: "%( cmd1)
+ print("simics running %s: "%( cmd1))
( rc, out ) = quiet_run_command( cmd1, output_modes.regular )
if ( rc ):
- print "simics ERROR running %s: %d "%( cmd1, rc )
+ print("simics ERROR running %s: %d "%( cmd1, rc ))
run_command ( cmd2 )
run_command ( cmd3 )
@@ -253,7 +254,7 @@ def sbe_magic_instruction_callback(user_arg, cpu, inst_num):
if inst_num == 8000: #MAGIC_SIMICS_CHECK
iface = SIM_get_interface(cpu, "int_register")
iface.write(iface.get_number("r3"), 1)
- print "SBE::isSimicsRunning = true"
+ print("SBE::isSimicsRunning = true")
# Run the registration automatically whenever this script is loaded.
register_sbe_debug_framework_tools()
diff --git a/src/tools/utils/CommitSbeImageToCMVC.py b/src/tools/utils/CommitSbeImageToCMVC.py
index c177e72f..f5394e46 100755
--- a/src/tools/utils/CommitSbeImageToCMVC.py
+++ b/src/tools/utils/CommitSbeImageToCMVC.py
@@ -41,6 +41,7 @@
#-------------------------
# Imports
#-------------------------
+from __future__ import print_function
import getopt
import os, sys, glob
import shutil
@@ -58,37 +59,37 @@ def main():
# Usage tool option
#------------------------------------------
def usage():
- print " ---------------------------------------------------------------------------------------------------"
- print " :: Command line USAGE options for Uploading FW SBE image to CMVC :: \n"
- print " CommitSbeImageToCMVC.py -d <cmvc defect/feature id> -r <fips release> -p <SBE repo Path> -i <file1,file2.file3>"
-
- print " \n"
- print " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- print " | By default user MUST pass CMVC/Release/Path input. |"
- print " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- print " \n ***** Options Supported *****"
- print " \t -d,--defect = Defect CMVC number"
- print " \t -f,--feature = Feature CMVC number"
- print " \t -r,--release = FW fips release string EX: fips910"
- print " \t -p,--path = Absolute path of the SBE repo"
- print " \t -i,--input = [ Optional ] List of image or file to upload"
- print " \t -b,--bvt = BVT xml file for CI"
- print " \t -h,--help = Help"
- print " ------------------------------------------------------------------------------------"
+ print(" ---------------------------------------------------------------------------------------------------")
+ print(" :: Command line USAGE options for Uploading FW SBE image to CMVC :: \n")
+ print(" CommitSbeImageToCMVC.py -d <cmvc defect/feature id> -r <fips release> -p <SBE repo Path> -i <file1,file2.file3>")
+
+ print(" \n")
+ print(" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
+ print(" | By default user MUST pass CMVC/Release/Path input. |")
+ print(" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
+ print(" \n ***** Options Supported *****")
+ print(" \t -d,--defect = Defect CMVC number")
+ print(" \t -f,--feature = Feature CMVC number")
+ print(" \t -r,--release = FW fips release string EX: fips910")
+ print(" \t -p,--path = Absolute path of the SBE repo")
+ print(" \t -i,--input = [ Optional ] List of image or file to upload")
+ print(" \t -b,--bvt = BVT xml file for CI")
+ print(" \t -h,--help = Help")
+ print(" ------------------------------------------------------------------------------------")
#------------------------------------------
# Exit from this Main
#------------------------------------------
def exit_main(rc):
if rc == errorcode.HELP_EXIT:
- print " [ HELP DOCUMENTATION ]\n"
+ print(" [ HELP DOCUMENTATION ]\n")
sys.exit(0)
if rc:
- print "\n [ ERROR - MAIN ] Exiting with error code = ", rc
+ print("\n [ ERROR - MAIN ] Exiting with error code = ", rc)
sys.exit(rc)
else:
- print "\n SBE Image Upload to CMVC completed [ OK ] "
+ print("\n SBE Image Upload to CMVC completed [ OK ] ")
sys.exit(0)
#------------------------------------------
@@ -128,10 +129,10 @@ def main():
#----------------------------------
# Preping the data for Image Upload
#----------------------------------
- print " \n"
- print " ******************************************************"
- print " ****** Stagging PPE image Files Upload to CMVC ******"
- print " ******************************************************"
+ print(" \n")
+ print(" ******************************************************")
+ print(" ****** Stagging PPE image Files Upload to CMVC ******")
+ print(" ******************************************************")
#------------------------------------------------------
# Make sure that it has passed atleast one arg with it
@@ -144,45 +145,45 @@ def main():
# Check user inputs and display
#-------------------------------------------------------------
def input_setting():
- print " ---------------------------------------------------------------------------------"
- print " [ Display User Inputs ]"
- print " ---------------------------------------------------------------------------------"
+ print(" ---------------------------------------------------------------------------------")
+ print(" [ Display User Inputs ]")
+ print(" ---------------------------------------------------------------------------------")
# Look elsewhere for the name instead of assigning to it locally.
# This is now gloabal var
global g_cmvc_num
if ( defect_num != "None" ) or ( feature_num != "None" ):
if not defect_num == "None":
g_cmvc_num = 'D'+defect_num #D1234
- print " [ CMVC Defect ] \t\t#Number\t = %s"%(g_cmvc_num)
+ print(" [ CMVC Defect ] \t\t#Number\t = %s"%(g_cmvc_num))
else:
g_cmvc_num = 'F'+feature_num # F1234
- print " [ CMVC Feature ] \t\t#Number\t = %s"%(g_cmvc_num)
+ print(" [ CMVC Feature ] \t\t#Number\t = %s"%(g_cmvc_num))
else:
- print " [ CMVC Defect/Feature ] Neeed CMVC number. This can't be empty "
+ print(" [ CMVC Defect/Feature ] Neeed CMVC number. This can't be empty ")
exit_main(errorcode.ERROR_EXIT)
if not release_name == "None":
- print " [ Fips Release Name ] \t#String\t = %s"%(release_name)
+ print(" [ Fips Release Name ] \t#String\t = %s"%(release_name))
else:
- print " [ Fips release ] Neeed fips release string. This can't be empty "
+ print(" [ Fips release ] Neeed fips release string. This can't be empty ")
exit_main(errorcode.ERROR_EXIT)
if not path_name == "None":
- print " [ Build Repo Path ] \t\t#String\t = %s"%(path_name)
+ print(" [ Build Repo Path ] \t\t#String\t = %s"%(path_name))
else:
- print " [ User Build Repo Path ] \t\t#String\t = %s"%(path_name)
+ print(" [ User Build Repo Path ] \t\t#String\t = %s"%(path_name))
# Optional, by default looks up predefined files
if not file_name == "None":
- print " [ Files for Check-in - User List ]"
+ print(" [ Files for Check-in - User List ]")
for files in file_name.split(","):
- print " \t\t\t\t#",files
+ print(" \t\t\t\t#",files)
else:
- print " [ Files for Check-in - Default List ]"
+ print(" [ Files for Check-in - Default List ]")
for files in errorcode.CMVC_FILE_LIST.split(","):
- print " \t\t\t\t# ",files
+ print(" \t\t\t\t# ",files)
- print " ---------------------------------------------------------------------------------"
+ print(" ---------------------------------------------------------------------------------")
#-------------------------------------------------------------
# CMVC ENV check
@@ -200,17 +201,17 @@ def main():
l_found_cmvc_conf = False
for key in os.environ.keys():
if "CMVC" in key:
- print "\t %s : %s" % (key,os.environ[key])
+ print("\t %s : %s" % (key,os.environ[key]))
l_found_cmvc_conf = True
if l_found_cmvc_conf == False:
- print "\n [ ERROR SETTING ] : The CMVC specific ENV is not set"
- print " Please add the following CMVC details in ~/.bashrc"
- print " ------------------------------------------------------"
- print " export CMVC_FAMILY=aix@<yourcmvcdomian>@<portnumber>"
- print " export CMVC_BECOME=<your cmvc id>"
- print " export CMVC_AUTH_METHOD=PWD"
- print " ------------------------------------------------------"
+ print("\n [ ERROR SETTING ] : The CMVC specific ENV is not set")
+ print(" Please add the following CMVC details in ~/.bashrc")
+ print(" ------------------------------------------------------")
+ print(" export CMVC_FAMILY=aix@<yourcmvcdomian>@<portnumber>")
+ print(" export CMVC_BECOME=<your cmvc id>")
+ print(" export CMVC_AUTH_METHOD=PWD")
+ print(" ------------------------------------------------------")
return errorcode.ERROR_SETTING
return errorcode.SUCCESS_EXIT
@@ -231,67 +232,67 @@ def main():
#------------------------------
input_setting()
- print "\n [ Checking PPE ENV Pre-req ] "
+ print("\n [ Checking PPE ENV Pre-req ] ")
# Check if User has passed the path, else get it from ENV
if path_name == "None":
# Get the PPE path
l_ppe_path = utilcode.utilppeSbENV("SBEROOT")
if l_ppe_path == "None":
- print " PPE Repo ENV Setting Path : [ ERROR CODE: %s ] " % l_ppe_path
+ print(" PPE Repo ENV Setting Path : [ ERROR CODE: %s ] " % l_ppe_path)
exit_main(errorcode.ERROR_SETTING)
else:
- print " PPE Repo path Setting : [ %s ]"% l_ppe_path
+ print(" PPE Repo path Setting : [ %s ]"% l_ppe_path)
path_name = l_ppe_path
- print "\n [ Checking CMVC user ENV Pre-req ] "
+ print("\n [ Checking CMVC user ENV Pre-req ] ")
rc_code = UserCmvcENV()
if rc_code == errorcode.SUCCESS_EXIT :
- print " CMVC Setting : [ OK ] "
+ print(" CMVC Setting : [ OK ] ")
else:
- print " CMVC Setting : [ ERORR CODE: %s ]"% rc_code
+ print(" CMVC Setting : [ ERORR CODE: %s ]"% rc_code)
#------------------------------
# 2) Check the CMVC login access
#------------------------------
- print "\n [ Checking CMVC user Login Session access ] "
+ print("\n [ Checking CMVC user Login Session access ] ")
rc_cmvc = CheckCmvcAccess()
if rc_cmvc == errorcode.ERROR_CMVC_LOGIN:
- print " CMVC Login Access : [ ERORR CODE: %s ]"% rc_cmvc
- print "\t No cmvc login was found in this session."
- print "\t Issue the cmvclog command to establish a login and re-run."
- print "\t Command : cmvclog -in <login user id>"
+ print(" CMVC Login Access : [ ERORR CODE: %s ]"% rc_cmvc)
+ print("\t No cmvc login was found in this session.")
+ print("\t Issue the cmvclog command to establish a login and re-run.")
+ print("\t Command : cmvclog -in <login user id>")
exit_main(rc_cmvc)
else:
- print " CMVC Session Login : [ OK ] "
+ print(" CMVC Session Login : [ OK ] ")
# Call API/Utility funcs def here
#------------------------------
# 3) Check track status
#------------------------------
- print "\n [ Checking CMVC track state ] "
+ print("\n [ Checking CMVC track state ] ")
l_trackFix = utilcode.utilCheckTrackState(g_cmvc_num,release_name)
if l_trackFix == errorcode.SUCCESS_TRACK_STATE :
- print " Track in fix state. Suitable to continue."
+ print(" Track in fix state. Suitable to continue.")
else :
- print " Track not in fix state. Aborting activity."
+ print(" Track not in fix state. Aborting activity.")
return errorcode.ERROR_TRACK_STATE
#------------------------------
# 4) Checkout the code
#------------------------------
- print "\n [ Creating Sandbox ]"
+ print("\n [ Creating Sandbox ]")
origDir = os.getcwd()
utilcode.utilCmvcChangeDir(g_cmvc_num)
sbDir = os.getcwd()
- print "\n [ Checkout Files from CMVC ] "
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print("\n [ Checkout Files from CMVC ] ")
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
if file_name == "None":
file_name = errorcode.CMVC_FILE_LIST
for l_filename in file_name.split(","):
rc_checkout = utilcode.utilCmvcCheckout(l_filename,release_name,g_cmvc_num)
if rc_checkout == errorcode.ERROR_CMVC_CHECKOUT:
- print " [ CMVC File Checkout Failed ] [Error code : %s]\t:%s"%(rc_checkout,l_filename)
+ print(" [ CMVC File Checkout Failed ] [Error code : %s]\t:%s"%(rc_checkout,l_filename))
# Undo checkout.. dont check errors just do it
utilcode.utilRollBack("checkout",g_cmvc_num,release_name)
# Return to initial directory of operation
@@ -299,38 +300,38 @@ def main():
shutil.rmtree(sbDir)
exit_main(rc_checkout)
else:
- print " CMVC File Checkout [ OK ]"
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print(" CMVC File Checkout [ OK ]")
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
#------------------------------
# 4) Copy the binaries and file
#------------------------------
# Find the files from the repo and copy to the Checkout dir
- print "\n [ Find files and Overide the checkout file ] "
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print("\n [ Find files and Overide the checkout file ] ")
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
rc_copy = utilcode.utilCmvcRepoPath(path_name,g_cmvc_num,file_name)
if rc_copy == errorcode.ERROR_CMVC_FILE_COPY:
- print " [ File copy Failed ] [ Error code : %s]"%rc_copy
+ print(" [ File copy Failed ] [ Error code : %s]"%rc_copy)
# Return to initial directory of operation
os.chdir(origDir)
shutil.rmtree(sbDir)
exit_main(rc_copy)
else:
- print " Files Copied Successfully : [ OK ] "
+ print(" Files Copied Successfully : [ OK ] ")
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
#---------------------
# 6) Checkin the files
#---------------------
- print "\n [ Check-in Files from CMVC ] "
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print("\n [ Check-in Files from CMVC ] ")
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
if file_name == "None":
file_name = errorcode.CMVC_FILE_LIST
for files in file_name.split(","):
rc_checkin = utilcode.utilCmvcCheckin(files,release_name,g_cmvc_num)
if rc_checkin == errorcode.ERROR_CMVC_CHECKIN:
- print " [ CMVC File Checkin Failed ] [Error code : %s]\t:%s"%(rc_checkin,files)
+ print(" [ CMVC File Checkin Failed ] [Error code : %s]\t:%s"%(rc_checkin,files))
# Undo checkin.. dont check errors just do it
utilcode.utilRollBack("checkin",g_cmvc_num,release_name)
# Return to initial directory of operation
@@ -338,28 +339,28 @@ def main():
shutil.rmtree(sbDir)
exit_main(rc_checkin)
else:
- print " CMVC File Checkin [ OK ]"
- print " ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ print(" CMVC File Checkin [ OK ]")
+ print(" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
#---------------------------------
# 7) Fix record the defect/release
#---------------------------------
- print "\n [ Fix the Record to complete in CMVC ] "
+ print("\n [ Fix the Record to complete in CMVC ] ")
utilcode.utilCmvcFixComplete(g_cmvc_num, release_name)
#---------------------------------
# 8) Trigger Jenkins CI Job
#---------------------------------
- print "\n [ Trigering Jenkins job ] "
+ print("\n [ Trigering Jenkins job ] ")
rc_ci = utilcode.utilTriggerJenkins(g_cmvc_num, release_name, bvt)
if rc_ci == errorcode.ERROR_CI_TRIGGER :
- print " [ CI Trigger Failed ] [Error code : %s]\t"%(rc_ci)
+ print(" [ CI Trigger Failed ] [Error code : %s]\t"%(rc_ci))
# Return to initial directory of operation
os.chdir(origDir)
shutil.rmtree(sbDir)
exit_main(rc_ci)
else :
- print " CI Trigger [ OK ]"
+ print(" CI Trigger [ OK ]")
#-----------------------------------------
# Return to initial directory of operation
@@ -368,7 +369,7 @@ def main():
shutil.rmtree(sbDir)
# Clean exit
- print "\n [ Manually Integrate on CMVC post CI ] "
+ print("\n [ Manually Integrate on CMVC post CI ] ")
exit_main(errorcode.SUCCESS_EXIT)
diff --git a/src/tools/utils/cmvcRelease.py b/src/tools/utils/cmvcRelease.py
index 6dd6b74c..4dc6e832 100755
--- a/src/tools/utils/cmvcRelease.py
+++ b/src/tools/utils/cmvcRelease.py
@@ -22,6 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
+from __future__ import print_function
import subprocess
import os
import sys
@@ -42,7 +43,7 @@ CMVC_PASSWORD = "xxxxxx"
# cmd = ['Feature','-open', '-remarks',' \"SBE release '+build_name+'\"', '-component', 'esw_sbei']
# result = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
# cmvc_feature = result.split()[-1].split('.')[0]
-# print "cmvc track ["+cmvc_feature+']'
+# print("cmvc track ["+cmvc_feature+']')
# os.system('Feature -assign '+cmvc_feature+' -owner '+CMVC_USER)
# os.system('Feature -accept '+cmvc_feature)
# os.system('Track -create -feature '+cmvc_feature+' -release fips911')
@@ -77,46 +78,46 @@ def step_2(branch, cmvc_feature):
filterarray += [ele]
last_release = filterarray[-1].split()[0].split('/')[-1]
- print "last release ["+last_release+"]"
+ print("last release ["+last_release+"]")
# build-name generation
cmd = [REL_TOOL,'build-name', '-release', RELEASE[branch]]
build_name = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].split('\n')[0]
- print "build name ["+build_name+"]"
+ print("build name ["+build_name+"]")
# latest commit
cmd = ['git','log', '-1', '--pretty=format:%H']
commit = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].split('\n')[0]
- print "commit ["+commit+"]"
+ print("commit ["+commit+"]")
# define release level
cmd = REL_TOOL+' define --level '+str(build_name)+' --base '+str(commit)+' --released '+str(last_release)
os.system(cmd)
- print cmd
+ print(cmd)
# release
cmd = REL_TOOL+' release --level '+build_name
os.system(cmd)
- print cmd
+ print(cmd)
# make SBE
cmd = 'make clean'
- print cmd
+ print(cmd)
os.system(cmd)
cmd = 'make install'
- print cmd
+ print(cmd)
os.system(cmd)
# trigger CI
cmd = './sb cmvc -f '+str(cmvc_feature)+' -r ' + 'fips'+RELEASE[branch]
os.system(cmd)
- print cmd
+ print(cmd)
# after ci pass
def step_3(branch, track):
# integrate track
cmd = 'Track -integrate -feature '+track+' -release fips'+RELEASE[branch]
os.system(cmd)
- print cmd
+ print(cmd)
# get last release tag
cmd = ['git', 'for-each-ref', '--sort=taggerdate', '--format','\'%(refname) %(taggerdate)\'','refs/tags']
@@ -129,10 +130,10 @@ def step_3(branch, track):
filterarray += [ele]
last_release = filterarray[-1].split()[0].split('/')[-1]
- print "last release ["+last_release+"]"
+ print("last release ["+last_release+"]")
cmd = 'git push '+REMOTE+' '+last_release
os.system(cmd)
- print cmd
+ print(cmd)
# cmvc log in
diff --git a/src/tools/utils/sbeCmvcUtility.py b/src/tools/utils/sbeCmvcUtility.py
index 405503e2..f5c02621 100755
--- a/src/tools/utils/sbeCmvcUtility.py
+++ b/src/tools/utils/sbeCmvcUtility.py
@@ -41,6 +41,7 @@
#-------------------------
# Imports
#-------------------------
+from __future__ import print_function
import os, sys
import time
import os.path
@@ -66,7 +67,7 @@ import sbeCmvcConstants as errorcode
def utilCmvcChangeDir(i_cmvcnum):
l_home_path= expanduser("~") + "/" + errorcode.CMVC_DIR_CREATE + i_cmvcnum
- print " Sandbox path\t: ",l_home_path
+ print(" Sandbox path\t: ",l_home_path)
cmd='mkdir -p ' + l_home_path
os.system(cmd)
os.chdir(l_home_path)
@@ -87,8 +88,8 @@ def utilCmvcRepoPath(i_pathname, i_cmvcnum, i_filename):
l_home_path= expanduser("~") + "/" + errorcode.CMVC_DIR_CREATE + i_cmvcnum
# Strip the last string from the file path input
- print " Sandbox path\t: ",l_home_path
- print " SBE Repo path\t: ",i_pathname
+ print(" Sandbox path\t: ",l_home_path)
+ print(" SBE Repo path\t: ",i_pathname)
if i_filename == "None":
i_filename = errorcode.CMVC_FILE_LIST
@@ -100,10 +101,10 @@ def utilCmvcRepoPath(i_pathname, i_cmvcnum, i_filename):
l_repo_path = utilFindFile(l_filename,i_pathname)
if l_sb_path is None :
- print " ERROR: Checked out sandbox does not contain " + l_filename
+ print(" ERROR: Checked out sandbox does not contain " + l_filename)
return errorcode.ERROR_CMVC_FILE_COPY
if l_repo_path is None :
- print " ERROR: File Not Found in SBE repo " + l_filename
+ print(" ERROR: File Not Found in SBE repo " + l_filename)
return errorcode.ERROR_CMVC_FILE_COPY
cp_cmd = 'cp ' + l_repo_path + ' ' + l_sb_path
@@ -180,8 +181,8 @@ def utilFindFilePPE(i_filename, i_path, i_sandbox_name):
#
##########################################################################
def utilCmvcCheckout(i_filename, i_release, i_cmvcnum):
- print " File Name\t: ",i_filename
- print " Release\t: ",i_release
+ print(" File Name\t: ",i_filename)
+ print(" Release\t: ",i_release)
# The file simics.tar,releaseNotes.html is not unique so provide
# the relative path
@@ -190,7 +191,7 @@ def utilCmvcCheckout(i_filename, i_release, i_cmvcnum):
elif i_filename == "releaseNotes.html":
i_filename = 'src/sbei/sbfw/releaseNotes.html'
- print " CMVC #\t: ",i_cmvcnum[1:]
+ print(" CMVC #\t: ",i_cmvcnum[1:])
l_home_path= expanduser("~") + "/" + errorcode.CMVC_DIR_CREATE + i_cmvcnum
cmd='File -checkout ' + i_filename + ' -release '+ i_release + ' -relative ' + l_home_path
@@ -199,12 +200,12 @@ def utilCmvcCheckout(i_filename, i_release, i_cmvcnum):
else:
cmd += ' -feature ' + i_cmvcnum[1:]
- print " Executing\t: ", cmd
+ print(" Executing\t: ", cmd)
rc = os.system(cmd)
if rc:
# rc 256 File not found in CMVC
if rc == 256:
- print " * File was not found or Error operation in CMVC"
+ print(" * File was not found or Error operation in CMVC")
return errorcode.ERROR_CMVC_CHECKOUT
else:
return errorcode.SUCCESS_CMVC_CHECKOUT
@@ -223,9 +224,9 @@ def utilCmvcCheckout(i_filename, i_release, i_cmvcnum):
#
##########################################################################
def utilCmvcCheckin(i_filename, i_release, i_cmvcnum):
- print " File Name\t: ",i_filename
- print " Release\t: ",i_release
- print " CMVC #\t: ",i_cmvcnum[1:]
+ print(" File Name\t: ",i_filename)
+ print(" Release\t: ",i_release)
+ print(" CMVC #\t: ",i_cmvcnum[1:])
l_home_path= expanduser("~") + "/" + errorcode.CMVC_DIR_CREATE + i_cmvcnum
l_base_path = utilFindFile(i_filename,l_home_path)
@@ -240,7 +241,7 @@ def utilCmvcCheckin(i_filename, i_release, i_cmvcnum):
else:
cmd += ' -feature ' + i_cmvcnum[1:]
- print " Executing\t: ", cmd
+ print(" Executing\t: ", cmd)
rc = os.system(cmd)
if rc:
return errorcode.ERROR_CMVC_CHECKIN
@@ -259,7 +260,7 @@ def utilCmvcCheckin(i_filename, i_release, i_cmvcnum):
#
##########################################################################
def utilCmvcFixComplete(i_cmvcnum, i_release):
- print " CMVC #\t: ",i_cmvcnum
+ print(" CMVC #\t: ",i_cmvcnum)
l_cmvcnum =i_cmvcnum[1:]
if i_cmvcnum[:1] == "D":
@@ -267,7 +268,7 @@ def utilCmvcFixComplete(i_cmvcnum, i_release):
else:
cmd='Fix -complete ' + ' -feature ' + l_cmvcnum + ' -r ' + i_release + ' -component esw_sbei'
- print " Executing\t: ", cmd
+ print(" Executing\t: ", cmd)
rc = os.system(cmd)
if rc:
return errorcode.ERROR_CMVC_FIX_RECORD
@@ -285,8 +286,8 @@ def utilCmvcFixComplete(i_cmvcnum, i_release):
#
##########################################################################
def utilCheckTrackState(i_cmvcnum, i_release):
- print " CMVC #\t: ",i_cmvcnum
- print " Release\t: ",i_release
+ print(" CMVC #\t: ",i_cmvcnum)
+ print(" Release\t: ",i_release)
l_cmvcnum =i_cmvcnum[1:]
cmd = 'Track -view -release ' + i_release
@@ -296,7 +297,7 @@ def utilCheckTrackState(i_cmvcnum, i_release):
cmd += ' -feature ' + l_cmvcnum
cmd += ' | grep state '
- print " Executing\t: ", cmd
+ print(" Executing\t: ", cmd)
ex_cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
for line in ex_cmd.stdout :
if not line: continue
@@ -316,24 +317,24 @@ def utilCheckTrackState(i_cmvcnum, i_release):
#
##########################################################################
def utilCheckFileHash(i_src, i_dest):
- print " Source\t: ",i_src
- print " Destination\t: ",i_dest
+ print(" Source\t: ",i_src)
+ print(" Destination\t: ",i_dest)
sha_orig = hashlib.sha256()
sha_orig.update(file(i_src).read())
orig_hash=sha_orig.hexdigest()
- print " * Orig Hash\t [ %s : %s ] "% (os.path.basename(i_src),orig_hash)
+ print(" * Orig Hash\t [ %s : %s ] "% (os.path.basename(i_src),orig_hash))
sha_copy = hashlib.sha256()
sha_copy.update(file(i_dest).read())
copied_hash=sha_copy.hexdigest()
- print " * Copied Hash\t [ %s : %s ] "% (os.path.basename(i_dest),copied_hash)
+ print(" * Copied Hash\t [ %s : %s ] "% (os.path.basename(i_dest),copied_hash))
if orig_hash == copied_hash:
- print " -> Hash Match .. Continue\n"
+ print(" -> Hash Match .. Continue\n")
return errorcode.SUCCESS_HASH_CHECK
else:
- print " Mismatch Hash.. Abort"
+ print(" Mismatch Hash.. Abort")
return errorcode.ERROR_HASH_CHECK
##########################################################################
@@ -349,27 +350,27 @@ def utilCheckFileHash(i_src, i_dest):
#
##########################################################################
def utilRollBack(i_action, i_cmvcnum, i_release):
- print "\n * Action request\t: ",i_action
+ print("\n * Action request\t: ",i_action)
if i_action == "checkin":
- print " * Undoing All default File list"
+ print(" * Undoing All default File list")
if i_cmvcnum[:1] == "D":
cmd = 'File -undo ' + errorcode.CMVC_FILE_UNDO_LIST + ' -release ' + i_release + ' -defect ' + i_cmvcnum[1:] + ' >/dev/null 2>&1'
else:
cmd = 'File -undo ' + errorcode.CMVC_FILE_UNDO_LIST + ' -release ' + i_release + ' -feature ' + i_cmvcnum[1:] + ' >/dev/null 2>&1'
else:
- print " * Unlocking All default Files list"
+ print(" * Unlocking All default Files list")
if i_cmvcnum[:1] == "D":
cmd = 'File -unlock ' + errorcode.CMVC_FILE_UNDO_LIST + ' -release ' + i_release + ' >/dev/null 2>&1'
else:
cmd = 'File -unlock ' + errorcode.CMVC_FILE_UNDO_LIST + ' -release ' + i_release + ' >/dev/null 2>&1'
- #print " Executing : ", cmd
+ #print(" Executing : ", cmd)
rc = os.system(cmd)
# CMVC throws this rc even if its successfull
if rc != 1024 and rc !=0:
- print "\n Error [ %s ] in Undoing/Unlocking Files.. Please check manually"%rc
+ print("\n Error [ %s ] in Undoing/Unlocking Files.. Please check manually"%rc)
else:
- print "\n Roll Back Successfull.. Please Revisit your inputs [ OK ] "
+ print("\n Roll Back Successfull.. Please Revisit your inputs [ OK ] ")
##########################################################################
@@ -385,7 +386,7 @@ def utilRollBack(i_action, i_cmvcnum, i_release):
#
##########################################################################
def utilTriggerJenkins(i_cmvcnum,i_release,i_bvt):
- print " Jenkins job for %s" % i_cmvcnum
+ print(" Jenkins job for %s" % i_cmvcnum)
#PATH : /afs/austin.ibm.com/projects/esw/bin/fsp-CI-jenkins
cmd = "fsp-CI-jenkins -r " + i_release + " -t " + i_cmvcnum[1:] + " --test_on_hardware=y"
if not i_bvt == "None" :
@@ -411,14 +412,14 @@ def utilTriggerJenkins(i_cmvcnum,i_release,i_bvt):
##########################################################################
def utilCopyFileToSandbox(i_pathname,i_sandboxname,i_filename):
- print "\n *** For Development *** \n"
- print " Sandbox path\t: ",i_sandboxname
- print " SBE Repo path\t: ",i_pathname
- print "\n"
+ print("\n *** For Development *** \n")
+ print(" Sandbox path\t: ",i_sandboxname)
+ print(" SBE Repo path\t: ",i_pathname)
+ print("\n")
if i_filename == "None":
i_filename = errorcode.CMVC_FILE_LIST
- #print " No User supplied Files to copy"
+ #print(" No User supplied Files to copy")
#return errorcode.ERROR_FILE_INPUT
for l_filename in i_filename.split(","):
@@ -426,7 +427,7 @@ def utilCopyFileToSandbox(i_pathname,i_sandboxname,i_filename):
l_sandbox_name = os.path.basename(i_sandboxname)
l_repo_path = utilFindFilePPE(l_filename,i_pathname,l_sandbox_name)
if l_repo_path is None :
- print " File [ %s ] not found in Repo..\t Check your repo and retry "%l_filename
+ print(" File [ %s ] not found in Repo..\t Check your repo and retry "%l_filename)
return errorcode.ERROR_CMVC_FILE_COPY
else:
for files in errorcode.FILE_LOOKUP_LIST.split(","):
@@ -439,18 +440,18 @@ def utilCopyFileToSandbox(i_pathname,i_sandboxname,i_filename):
# Check if this path exist in the sandbox , if not create and copy
if os.path.exists(sb_cp_path) == False:
cmd='mkdir -p ' + os.path.dirname(sb_cp_path)
- #print " Creating dir %s "%cmd
+ #print(" Creating dir %s "%cmd)
os.system(cmd)
# Copy the file
copy_cmd = 'cp -rf ' + l_repo_path + ' ' + sb_cp_path
rc = os.system(copy_cmd)
if rc:
- print " RC code :",rc
- print " ERROR : Copying file : ",copy_cmd
+ print(" RC code :",rc)
+ print(" ERROR : Copying file : ",copy_cmd)
return errorcode.ERROR_CMVC_FILE_COPY
else:
- print " Copied file : ",copy_cmd
+ print(" Copied file : ",copy_cmd)
return errorcode.SUCCESS_DEV_EXIT
@@ -471,15 +472,15 @@ def utilppeSbENV(i_env_key):
env_ppe_path="None"
for key in os.environ.keys():
if i_env_key in key:
- #print "\t %s : %s" % (key,os.environ[key])
+ #print("\t %s : %s" % (key,os.environ[key]))
env_ppe_path = os.environ[key]
l_found_ppe_conf = True
if l_found_ppe_conf == False:
- print " ---------------------------------------------------------"
- print " | [ ERROR SETTING ] : The PPE Repository ENV is not set |"
- print " | Please do ./sb workon to set/load the PPE repo ENV |"
- print " ---------------------------------------------------------"
+ print(" ---------------------------------------------------------")
+ print(" | [ ERROR SETTING ] : The PPE Repository ENV is not set |")
+ print(" | Please do ./sb workon to set/load the PPE repo ENV |")
+ print(" ---------------------------------------------------------")
return env_ppe_path
diff --git a/src/tools/utils/sbePatchUtility.py b/src/tools/utils/sbePatchUtility.py
index bbb6d883..2ab1ecaa 100644
--- a/src/tools/utils/sbePatchUtility.py
+++ b/src/tools/utils/sbePatchUtility.py
@@ -40,6 +40,7 @@
#-------------------------
# Imports
#-------------------------
+from __future__ import print_function
import os, sys
import time
import os.path
@@ -65,7 +66,7 @@ import sbeCmvcUtility as utilcode
#
##########################################################################
def utilPatchSimics(i_sandbox_path, i_sandbox_root):
- print "\n ... Patching simics files "
+ print("\n ... Patching simics files ")
sb_name=os.path.basename(i_sandbox_path)
@@ -76,7 +77,7 @@ def utilPatchSimics(i_sandbox_path, i_sandbox_root):
return errorcode.ERROR_HOOKING_FILE
l_sim_cmd = "workon -m ppc " + sb_name + " -c " + l_sim_file + " -rc " + i_sandbox_root +"/sbesandboxrc"
- print " ", l_sim_cmd
+ print(" ", l_sim_cmd)
os.system(l_sim_cmd)
@@ -96,7 +97,7 @@ def utilPatchSimics(i_sandbox_path, i_sandbox_root):
#
##########################################################################
def utilExecuteShell(i_ppe_root, i_sandbox_path, i_shell_file):
- print "\n ... Executing shell : ",i_shell_file
+ print("\n ... Executing shell : ",i_shell_file)
# Sanbox name
if i_sandbox_path != "None":
@@ -105,7 +106,7 @@ def utilExecuteShell(i_ppe_root, i_sandbox_path, i_shell_file):
# Find the file and execute
l_path_name = i_ppe_root + '/src'
l_shell_path=utilcode.utilFindFile(i_shell_file, l_path_name)
- print " [ %s ]"%l_shell_path
+ print(" [ %s ]"%l_shell_path)
if i_sandbox_path != "None":
# Load the shell onto the Sandbox env and execute
@@ -132,7 +133,7 @@ def utilExecuteShell(i_ppe_root, i_sandbox_path, i_shell_file):
def utilShell_hooks(i_sandbox_path):
# Find the simics machine from ENV
l_machine = os.environ['MACHINE'].rstrip('\n')
- print " Machine : ",l_machine
+ print(" Machine : ",l_machine)
l_cmd_exec = 'start_simics -no_start -machine ' + l_machine + ' -batch_mode '
# Write the compile shell hook on the fips sandbox location
diff --git a/src/tools/utils/sbePrime.py b/src/tools/utils/sbePrime.py
index 8f522bda..dd3ab153 100755
--- a/src/tools/utils/sbePrime.py
+++ b/src/tools/utils/sbePrime.py
@@ -41,6 +41,7 @@
#-------------------------
# Imports
#-------------------------
+from __future__ import print_function
import getopt
import os, sys, glob
import shutil
@@ -60,49 +61,49 @@ def main():
# Usage tool option
#------------------------------------------
def usage():
- print " \n"
- print " :: Command line USAGE options for Copying SBE FW files for compilation :: \n"
- print " sbeDistribute.py -s <Sandbox Name> -i <file1,file2...>"
-
- print " \n"
- print " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- print " | By default NO argument is needed as an input . |"
- print " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
- print " \n ***** Options Supported *****"
- print " \t -p,--patch = [ Optional ] Patch Simics related files on Sandbox "
- print " \t -s,--sb = [ Optional ] Sandbox base name"
- print " \t By default it picks up the ppe Repo test_sb sandbox"
- print " \t but if you have created a sandbox of your own manually "
- print " \t and you want to compile, use this option then only"
- print " \t -i,--files = [ Optional ] Firmware Files coma ',' separated input file1,file2"
- print " \t Only the pre-define listed files bellow:"
- print " \t sbe_sp_intf.H,simics.tar,"
- print " \t sbe_seeprom_DD2.bin"
- print " \t -r,--rc_file = [ Optional ] The RC file for the sandbox (with absolute path)"
- print " \t -n,--no_build = [ Optional ] Flag to determine if sbei component should be compiled"
- print " \t -h,--help = Help"
- print " ------------------------------------------------------------------------------------"
+ print(" \n")
+ print(" :: Command line USAGE options for Copying SBE FW files for compilation :: \n")
+ print(" sbeDistribute.py -s <Sandbox Name> -i <file1,file2...>")
+
+ print(" \n")
+ print(" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
+ print(" | By default NO argument is needed as an input . |")
+ print(" +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
+ print(" \n ***** Options Supported *****")
+ print(" \t -p,--patch = [ Optional ] Patch Simics related files on Sandbox ")
+ print(" \t -s,--sb = [ Optional ] Sandbox base name")
+ print(" \t By default it picks up the ppe Repo test_sb sandbox")
+ print(" \t but if you have created a sandbox of your own manually ")
+ print(" \t and you want to compile, use this option then only")
+ print(" \t -i,--files = [ Optional ] Firmware Files coma ',' separated input file1,file2")
+ print(" \t Only the pre-define listed files bellow:")
+ print(" \t sbe_sp_intf.H,simics.tar,")
+ print(" \t sbe_seeprom_DD2.bin")
+ print(" \t -r,--rc_file = [ Optional ] The RC file for the sandbox (with absolute path)")
+ print(" \t -n,--no_build = [ Optional ] Flag to determine if sbei component should be compiled")
+ print(" \t -h,--help = Help")
+ print(" ------------------------------------------------------------------------------------")
#------------------------------------------
# Exit from this Main
#------------------------------------------
def exit_main(rc):
if rc == errorcode.HELP_EXIT:
- print " [ HELP DOCUMENTATION ]\n"
+ print(" [ HELP DOCUMENTATION ]\n")
sys.exit(0)
if rc == errorcode.ERROR_BUILD_FAILED:
- print " Compilation Failed .. Error "
+ print(" Compilation Failed .. Error ")
if rc == errorcode.SUCCESS_DEV_EXIT:
- print " [ Files Copy done! ]\n"
+ print(" [ Files Copy done! ]\n")
sys.exit(0)
if rc:
- print "\n [ ERROR - MAIN ] Exiting with error code = ", rc
+ print("\n [ ERROR - MAIN ] Exiting with error code = ", rc)
sys.exit(rc)
else:
- print "\n Fips Sandbox compilation and simics patching completed [ OK ] "
+ print("\n Fips Sandbox compilation and simics patching completed [ OK ] ")
sys.exit(0)
#------------------------------------------
@@ -154,17 +155,17 @@ def main():
#------------------------------
# 1) User input params/ Check ENV
#------------------------------
- print "\n [ Checking SBE user ENV Pre-req ] "
+ print("\n [ Checking SBE user ENV Pre-req ] ")
# Get it from ENV
if path_name == "None":
# Get the PPE path
l_ppe_path = utilcode.utilppeSbENV("SBEROOT")
if l_ppe_path == "None":
- print "\n Couldn't find PPE repo info from ENV currently set... "
- print " [ ERROR ] PPE Repo ENV Setting Path : %s " % l_ppe_path
+ print("\n Couldn't find PPE repo info from ENV currently set... ")
+ print(" [ ERROR ] PPE Repo ENV Setting Path : %s " % l_ppe_path)
exit_main(errorcode.ERROR_SETTING)
else:
- print " PPE Repo path Setting\t : %s "% l_ppe_path
+ print(" PPE Repo path Setting\t : %s "% l_ppe_path)
path_name = l_ppe_path
#-----------------------------------
@@ -177,7 +178,7 @@ def main():
sandbox_path = utilcode.utilFind_ENV_string("SANDBOXBASE").rstrip('\n')
else:
sandbox_path = utilcode.utilFind_sb_base(sandbox_name).rstrip('\n')
- print " Fips Sandbox path\t : ",sandbox_path
+ print(" Fips Sandbox path\t : ",sandbox_path)
#-----------------------------------
# 3) Get the Sanbox root path
@@ -189,11 +190,11 @@ def main():
sandbox_root = utilcode.utilFind_sb_rc(sandbox_name).rstrip('\n')
if sandbox_root == "None":
- print " ** [ ERROR ] Something Fishy about the ENV set -OR- Option used.. Please check manually ** "
+ print(" ** [ ERROR ] Something Fishy about the ENV set -OR- Option used.. Please check manually ** ")
usage()
exit_main(errorcode.ERROR_SETTING)
else:
- print " Sandbox root path\t : ",sandbox_root
+ print(" Sandbox root path\t : ",sandbox_root)
#---------------------------------------------
# sim setup if user initiates
@@ -204,22 +205,22 @@ def main():
#---------------------------------------------
rc_sb = utilpatch.utilExecuteShell(path_name,"None","sandbox-create")
if rc_sb == errorcode.SUCCESS_EXIT:
- print " Sandbox Created.. [ OK ] \n"
+ print(" Sandbox Created.. [ OK ] \n")
else:
- print " Sandbox Create.. [ ERROR ]",rc_sb
+ print(" Sandbox Create.. [ ERROR ]",rc_sb)
exit_main(rc_sb)
#----------------------------------------
# Patch up the simics patches files
#----------------------------------------
- print "\n *** Update Simics patches onto Sandbox *** \n "
+ print("\n *** Update Simics patches onto Sandbox *** \n ")
# Pre sim setup
rc_shell = utilpatch.utilExecuteShell(path_name,sandbox_path,"workarounds.presimsetup")
if rc_shell == errorcode.SUCCESS_EXIT:
- print " presimsetup [ OK ]\n"
+ print(" presimsetup [ OK ]\n")
else:
- print " presimsetup [ ERROR ] : ",rc_shell
+ print(" presimsetup [ ERROR ] : ",rc_shell)
exit_main(rc_shell)
# Patch the simics files
@@ -227,16 +228,16 @@ def main():
if rc_sim != errorcode.SUCCESS_EXIT:
exit_main(rc_sim)
else:
- print " Patch the simics files on Sandbox [ OK ] \n"
+ print(" Patch the simics files on Sandbox [ OK ] \n")
# Post sim setup
rc_shell = utilpatch.utilExecuteShell(path_name,sandbox_path,"workarounds.postsimsetup")
if rc_shell == errorcode.SUCCESS_EXIT:
- print " postsimsetup [ OK ]\n"
+ print(" postsimsetup [ OK ]\n")
# Clean exit Get out from here
exit_main(errorcode.SUCCESS_EXIT)
else:
- print " postsimsetup [ ERROR ] : ",rc_shell
+ print(" postsimsetup [ ERROR ] : ",rc_shell)
exit_main(rc_shell)
# Files to copy for sbe prime
@@ -257,22 +258,22 @@ def main():
if os.path.isdir(sandbox_path) == True:
rc_copy = utilcode.utilCopyFileToSandbox(path_name,sandbox_path,file_name)
if rc_copy == errorcode.SUCCESS_DEV_EXIT:
- print " Files Copied to Fips Sandbox : [ OK ]"
+ print(" Files Copied to Fips Sandbox : [ OK ]")
else:
exit_main(rc_copy)
else:
- print " Sandbox : %s [ Either doesn't exist or do workon to fips sb to load the ENV.. ]" % os.path.basename(sandbox_path)
- print " - OR - "
- print " [ Optional ] You can specify your sandbox name as input as well"
- print " -s <fips_sandbox Name >"
+ print(" Sandbox : %s [ Either doesn't exist or do workon to fips sb to load the ENV.. ]" % os.path.basename(sandbox_path))
+ print(" - OR - ")
+ print(" [ Optional ] You can specify your sandbox name as input as well")
+ print(" -s <fips_sandbox Name >")
usage()
exit_main(errorcode.ERROR_SANDBOX_EXIST)
else:
- print " Please Check your fips Sandbox and retry"
+ print(" Please Check your fips Sandbox and retry")
exit_main(errorcode.ERROR_SANDBOX_EXIST)
sb_name=os.path.basename(sandbox_path)
- print "\n Sandbox :",sb_name
+ print("\n Sandbox :",sb_name)
if build == "1":
#----------------------------------------
@@ -291,12 +292,12 @@ def main():
if rc_file == "None":
compile_cmd="workon -m ppc " + sb_name + " -c " + hook_file + " -rc " + sandbox_root +"/.sandboxrc"
else:
- print " getting rc file from user \n"
+ print(" getting rc file from user \n")
compile_cmd="workon -m ppc " + sb_name + " -c " + hook_file + " -rc " + rc_file
- print "\n [ COMPILE ] Executing :%s \n"%compile_cmd
+ print("\n [ COMPILE ] Executing :%s \n"%compile_cmd)
rc = os.system(compile_cmd)
- print " Compilation returned rc :",rc
+ print(" Compilation returned rc :",rc)
if rc != 0:
exit_main(errorcode.ERROR_BUILD_FAILED)
--
2.21.0
More information about the OpenPower-Firmware
mailing list