Skip to content

Commit

Permalink
Axone Simics Updates -- Finds Functional Master Proc
Browse files Browse the repository at this point in the history
  - Updates for new Simics infrastructure
  - Finds Functional Master Proc
  - Finds TPM
  - Boots to istep6.9 before failing target verification
    (more Axone FW changes needed)

Change-Id: Ib3f44008ed12202777c2edacea42d5cb20a4a7a3
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/67206
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
  • Loading branch information
wghoffa authored and Nicholas E. Bofferding committed Dec 14, 2018
1 parent bfac982 commit 2ad30a4
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 116 deletions.
1 change: 1 addition & 0 deletions src/build/citest/etc/simbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/gsa/ausgsa/projects/s/simics_published_builds//p10/a9436c91b1bea3089be80317b2c5f6569b8fbd6a/simics.tar.gz
1 change: 1 addition & 0 deletions src/build/debug/Hostboot/HwpfAttrOverride.pm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ use constant TARGET_TYPE_PHB => 0x00800000;
use constant TARGET_TYPE_L4 => 0x00000200;
use constant TARGET_TYPE_MC => 0x01000000;
use constant TARGET_TYPE_MCC => 0x08000000;
use constant TARGET_TYPE_OMIC => 0x04000000;
use constant TARGET_TYPE_OMI => 0x02000000;
use constant TARGET_TYPE_OMIC => 0x04000000;
use constant TARGET_TYPE_OCMB => 0x10000000;
Expand Down
85 changes: 40 additions & 45 deletions src/build/debug/simics-debug-framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,35 @@ def loads(self,string):
# types into the appropriate simics interface.
#
class DebugFrameworkProcess:
process = "" # subprocess object.
tool = "" # string - tool module name.
toolOptions = "" # string - tool options
outputToString = None # mode - String output instead of STDOUT.
imgPath = None # Image dir path override.
result = "" # Result string for Usage-mode.
outputFile = None # Output file for results in addition to STDOUT
process = ""; # subprocess object.
tool = ""; # string - tool module name.
toolOptions = ""; # string - tool options
outputToString = None; # mode - String output instead of STDOUT.
imgPath = None; # Image dir path override.
result = ""; # Result string for Usage-mode.
outputFile = None; # Output file for results in addition to STDOUT

def __init__(self, tool = "Printk", toolOptions = "",
outputToString = None, usage = None,
imgPath = None,
outputFile = None):
# Assign instance 'imgPath' variable.
self.imgPath = imgPath if imgPath else (os.environ['HB_TOOLPATH']+"/")
self.imgPath = imgPath if imgPath else (os.environ['HB_TOOLPATH']+"/");

# Determine sub-process arguments.
process_args = [self.imgPath+"simics-debug-framework.pl"]
process_args = [self.imgPath+"simics-debug-framework.pl"];
if (usage): # Pass --usage if Usage mode selected.
process_args = process_args + [ "--usage" ]
outputToString = True
process_args = process_args + [ "--usage" ];
outputToString = True;

# Spawn sub-process
self.process = subprocess.Popen(process_args,
stdin=subprocess.PIPE, stdout=subprocess.PIPE)
# Update instance variables.
self.tool = tool
self.toolOptions = toolOptions
self.outputToString = outputToString
self.outputFile = open(outputFile, 'w') if outputFile else None
self.tool = tool;
self.toolOptions = toolOptions;
self.outputToString = outputToString;
self.outputFile = open(outputFile, 'w') if outputFile else None;

# Read a message from the process pipe.
def recvMsg(self):
Expand Down Expand Up @@ -169,9 +169,9 @@ def write_data(self,data):

addr = int(match.group(1))
size = int(match.group(2))
data = map(ord, match.group(3).decode("hex"))
data = map(ord, match.group(3).decode("hex"));

conf.system_cmp0.phys_mem.memory[[addr, addr+size-1]] = data
conf.system_cmp0.phys_mem.memory[[addr, addr+size-1]] = data;

# Read data from PNOR.
# This message has data of the format "0dADDRESS,0dSIZE".
Expand Down Expand Up @@ -304,22 +304,22 @@ def register_hb_debug_framework_tools():
files = os.listdir(os.environ['HB_TOOLPATH']+"/Hostboot")

# Filter out any prefixed with '_' (utility module) or a '.' (hidden file).
pattern = re.compile("[^\._]")
pattern = re.compile("[^\._]");
files = [f for f in files if pattern.match(f)]

# Filter out modules written for vbu only
pattern = re.compile("AutoIpl|ContTrace")
pattern = re.compile("AutoIpl|ContTrace");
files = [f for f in files if not pattern.match(f)]

# Remove the .pm extension from the tool modules.
files = [re.sub("\.pm","",f) for f in files]
files = [re.sub("\.pm","",f) for f in files];

# Create an entry for each module.
for tool in files:
# Get usage information for each module, fix text to HTML-like.
usage = run_hb_debug_framework(tool, usage = 1)
usage = re.sub("<","&lt;", usage)
usage = re.sub(">","&gt;", usage)
usage = re.sub("<","&lt;", usage);
usage = re.sub(">","&gt;", usage);
usage = re.sub("\t"," ",usage)
usage = "<pre>"+usage+"</pre>"

Expand Down Expand Up @@ -372,11 +372,6 @@ def getHRMOR():
result = SIM_get_object(simenv.hb_cpu).hrmor
return result

# Fetch the current HRMOR value for inputted cpu obj
def getHrmorCpu(cpu):
# Use the cpu object to get the hrmor value
iface = SIM_get_interface(cpu, "int_register")
return iface.read(iface.get_number("hrmor"))

# Read simics memory and return a list of strings such as ['0x0','0x2b','0x8']
# representing the data read from simics. The list returned may be handed
Expand Down Expand Up @@ -409,20 +404,20 @@ def writeLong(address,datvalue):
def writeSimicsMemory(address,data):
address = address + getHRMOR()
size = len(data)
conf.system_cmp0.phys_mem.memory[[address, address+size-1]] = data
conf.system_cmp0.phys_mem.memory[[address, address+size-1]] = data;

# Convert an integer to a byte list <size> bytes long.
def intToList(n,size):
lst = []
for i in range(size):
b = n & 0xFF
b = n & 0xFF;
lst.insert(0,b)
n = n >> 8
return lst

# Convert a byte list to an integer.
def listToInt(l):
i = 0
i = 0;
for c in l:
i = (i << 8) | c
return i
Expand Down Expand Up @@ -503,19 +498,14 @@ def magic_instruction_callback(user_arg, cpu, arg):
# Disable our handler if someone tells us to
if( os.environ.has_key('HB_DISABLE_MAGIC')
and (os.environ['HB_DISABLE_MAGIC'] == '1') ):
#print 'Skipping HB magic (disabled)', arg
return

#Only respond to haps for cpu model types we care about (mambo)
if 'mambo_core' not in cpu.classname:
#print 'Skipping HB magic (Not a Mambo core)', arg
print 'Skipping HB magic (disabled)', arg
return

# Disable our handler if we aren't inside HB part of IPL
# If HB is running then HRMOR==128MB (ignoring high bits)
# 0x40000000=1GB, 0x8000000=128MB
if( (getHrmorCpu(cpu) % 0x40000000) != 0x8000000 ):
#print 'Skipping HB magic (outside of HB)', arg
if( (cpu.hrmor % 0x40000000) != 0x8000000 ):
print 'Skipping HB magic (outside of HB)', arg
return

if arg == 7006: # MAGIC_SHUTDOWN
Expand Down Expand Up @@ -545,7 +535,7 @@ def magic_instruction_callback(user_arg, cpu, arg):
#print 'loading payload from', flash_file, 'to 0x%x' % load_addr
#cmd = 'shell "fcp --force -o0 -R %s:PAYLOAD simicsPayload.ecc; ecc --remove --p8 simicsPayload.ecc simicsPayload"; load-file simicsPayload 0x%x' % (flash_file, load_addr)
#SIM_run_alone( run_command, cmd )
print "MAGIC_LOAD_PAYLOAD not implemented\n"
print "MAGIC_LOAD_PAYLOAD not implemented\n";

if arg == 7018: # MAGIC_BREAK_ON_ERROR
# Stop the simulation if an env var is set
Expand Down Expand Up @@ -633,8 +623,8 @@ def magic_instruction_callback(user_arg, cpu, arg):
setLvlCommand = "%s"%(comp_str)+".log-level %d"%(log_level)
SIM_run_alone(run_command, setLvlCommand )
else :
couldNotFindCommand = "shell \" Unable to find valid object on this system type, neither %s nor %s were found \""%(D1Proc0String, P9Proc0String)
SIM_run_alone(run_command, couldNotFindCommand )
print "Unable to find valid object on this system type, neither %s nor %s were found"%(D1Proc0String, P9Proc0String)

if arg == 7023: # MAGIC_TOGGLE_OUTPUT
if( not os.environ.has_key('ENABLE_HB_SIMICS_LOGS') ):
#print("Skipping Hostboot Simics Logging because ENABLE_HB_SIMICS_LOGS is not set")
Expand All @@ -654,6 +644,7 @@ def magic_instruction_callback(user_arg, cpu, arg):
SIM_run_alone(run_command, stopCommand )

if arg == 7055: # MAGIC_CONTINUOUS_TRACE

hb_tracBinaryBuffer = cpu.r4
hb_tracBinaryBufferSz = cpu.r5
per_node = 0x200000000000 #32TB
Expand Down Expand Up @@ -712,7 +703,8 @@ def magic_instruction_callback(user_arg, cpu, arg):

# Figure out if we are running out of the cache or mainstore
# Add the HRMOR if we're running from memory
if 'cache' not in mem_object:
if 'cache' not in mem_object and 'l3' not in mem_object:
#print "Did not find cache"
hb_tracBinaryBuffer = (hb_tracBinaryBuffer +
hb_hrmor -
(per_node*node_num))
Expand All @@ -737,10 +729,13 @@ def magic_instruction_callback(user_arg, cpu, arg):
os.environ['HB_TOOLPATH'],\
tracmerg[node_num])

cmd3 = "(get-master-proc %d).proc_fsi2host_mbox->regs[95][1] = 0"%(node_num)

cmd3 = ""
if (simenv.hb_mode == 0): #new mode (Axone + beyond)
cmd3 = "(get-master-proc).reset-fsimbox-reg index=0x104"
else:
#old mode (Cumulus + prior)
cmd3 = "(get-master-proc %d).proc_fsi2host_mbox->regs[95][1] = 0"%(node_num)
saveCommand = "%s; %s; %s"%(cmd1,cmd2,cmd3)
#print "Command=%s" % (saveCommand)

if (simenv.fileSystemOk == 1):
SIM_run_alone(run_command, saveCommand )
Expand Down
1 change: 1 addition & 0 deletions src/build/mkrules/dist.targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ simics.tar_CONTENTS = \
img/procmvpd_ven.dat \
img/procmvpd_p9n.dat \
img/procmvpd_p9c.dat \
img/procmvpd_p9a.dat \
img/cvpd.dat \
img/dvpd.dat \
img/cvpd_cdimm.dat \
Expand Down
24 changes: 20 additions & 4 deletions src/build/simics/hb-pnor-vpd-preload.pl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
my $mvpdFile_ven = "procmvpd_ven.dat";
my $mvpdFile_p9n = "procmvpd_p9n.dat";
my $mvpdFile_p9c = "procmvpd_p9c.dat";
my $mvpdFile_p9a = "procmvpd_p9a.dat";
my $cvpdFile = "cvpd.dat";
my $cvpdCdimmFile = "cvpd_cdimm.dat";
my $dvpdFile = "dvpd.dat";
Expand Down Expand Up @@ -324,6 +325,10 @@ sub createMVPDData
{
$sourceFile = "$dataPath/$mvpdFile_p9c";
}
elsif( $procChipType eq "p9a")
{
$sourceFile = "$dataPath/$mvpdFile_p9a";
}
else
{
$sourceFile = "$dataPath/$mvpdFile";
Expand Down Expand Up @@ -384,6 +389,10 @@ sub createCVPDData
{
$numProcs = 4;
}
elsif( $procChipType eq "p9a")
{
$numProcs = 2;
}

#Centaurs are populated based on populated Processors and special
#MCS plugging rules. We can look at $procConfig and $maxProcs
Expand Down Expand Up @@ -607,8 +616,17 @@ sub getMemoryConfig
}
elsif( $procChipType eq "p9n")
{
#There are no centaurs within a NIMBUS machine, but need to set
#up the mcs array.
#There are no centaurs within a NIMBUS machine, but need to set
#up the mcs array.
if( $mcs < $numMcsPerProc)
{
$mcsArray[$mcs] = 1;
}
}
elsif( $procChipType eq "p9a")
{
#There are no centaurs within an AXONE machine, but need to set
#up the mcs array.
if( $mcs < $numMcsPerProc)
{
$mcsArray[$mcs] = 1;
Expand All @@ -622,6 +640,4 @@ sub getMemoryConfig
}

debugMsg( "mcsArray=@mcsArray" );


}
14 changes: 12 additions & 2 deletions src/build/simics/hb-pnor-vpd-preload.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@
#------------------------------------------------------------------------------
toolLoc = os.environ.get("HB_TOOLPATH");
thisSys = os.environ.get("HB_MACHINE").upper();
numProcs = os.environ.get( "NUM_PROCS");
dimmsPerProc = os.environ.get( "DIMMS_PER_PROC");
numProcs = "0"
if os.environ.has_key("NUM_PROCS"):
numProcs = os.environ.get("NUM_PROCS");
elif simenv.num_procs > 0:
numProcs = str(simenv.num_procs)

dimmsPerProc = "0"
if os.environ.has_key("DIMMS_PER_PROC"):
dimmsPerProc = os.environ.get("DIMMS_PER_PROC");
elif simenv.num_dimms > 0:
dimmsPerProc = str(simenv.num_dimms)

numCentaurPerProcParm = "";
numCentaurPerProc = "0";
dimmType = "ISDIMM";
Expand Down

0 comments on commit 2ad30a4

Please sign in to comment.