summaryrefslogtreecommitdiffstats
path: root/src/build
diff options
context:
space:
mode:
authorDan Crowell <dcrowell@us.ibm.com>2014-01-02 16:58:28 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2014-01-07 17:16:52 -0600
commitf3e453363fa9e92146a4bf578c8aab9f44af3933 (patch)
treee3630081aa4acbad58c1caeb76bf19e15bff53f3 /src/build
parent9eb6eb7b53f23ab5d253fb9f3c43ddbcdbc7ec37 (diff)
downloadtalos-hostboot-f3e453363fa9e92146a4bf578c8aab9f44af3933.tar.gz
talos-hostboot-f3e453363fa9e92146a4bf578c8aab9f44af3933.zip
Remove phys_mem hardcoding to handle map changes
Fixes 2 issues: -Memory map changes broke 2-node Brazos -P8_NO_SP config busted because HRMOR=0 CQ: SW239593 Change-Id: Id62f1d707b59849d8633a51bb4f74905e7318d78 Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/7883 Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Tested-by: Jenkins Server
Diffstat (limited to 'src/build')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index 3fca8c2ba..889d3bcfc 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -6,7 +6,7 @@
#
# IBM CONFIDENTIAL
#
-# COPYRIGHT International Business Machines Corp. 2011,2013
+# COPYRIGHT International Business Machines Corp. 2011,2014
#
# p1
#
@@ -505,15 +505,29 @@ def magic_instruction_callback(user_arg, cpu, arg):
if arg == 7055: # MAGIC_CONTINUOUS_TRACE
hb_tracBinaryBuffer = cpu.r4
hb_tracBinaryBufferSz = cpu.r5
+ per_node = 0x200000000000
hb_hrmor = cpu.hrmor
- node_num = (hb_hrmor - 0x8000000)/0x200000000000
+ node_num = hb_hrmor//per_node
+ mem_object = None
+
+ # Find the entry in the memory map that includes our
+ # base memory region
+ mem_map_entries = (conf.system_cmp0.phys_mem).map
+ for entry in mem_map_entries:
+ #print ">> %d:%s" % (entry[0], entry[1])
+ if entry[0] == (node_num*per_node):
+ mem_object = simics.SIM_object_name(entry[1])
+ #print "Found entry %s for hrmor %d" % (mem_object, hb_hrmor)
+ break
+ if mem_object == None:
+ print "Could not find entry for hrmor %d" % (hb_hrmor)
+ SIM_break_simulation( "No memory for trace" )
+ return
# Figure out if we are running out of the cache or mainstore
- runStr = "(system_cmp0.phys_mem)->map[%d][1]" % (2*node_num)
- ( result, out ) = quiet_run_command( runStr, output_modes.regular )
# Add the HRMOR if we're running from memory
- if 'cache' not in result:
- hb_tracBinaryBuffer = hb_tracBinaryBuffer + hb_hrmor
+ if 'cache' not in mem_object:
+ hb_tracBinaryBuffer = hb_tracBinaryBuffer + hb_hrmor - per_node*node_num
tracbin = ["hbTracBINARY","hbTracBINARY1","hbTracBINARY2","hbTracBINARY3"]
tracmerg = ["hbTracMERG","hbTracMERG1","hbTracMERG2","hbTracMERG3"]
@@ -523,11 +537,12 @@ def magic_instruction_callback(user_arg, cpu, arg):
# tracMERG. Once we extract the trace buffer, we need to reset
# mailbox scratch 1 (to 0) so that the trace daemon knows it can
# continue.
- cmd1 = "(system_cmp0.phys_mem)->map[%d][1]->image.save %s 0x%x %d"\
- %(2*node_num,\
+ cmd1 = "(%s)->image.save %s 0x%x %d"%(
+ mem_object,\
tracbin[node_num],\
hb_tracBinaryBuffer,\
hb_tracBinaryBufferSz)
+
cmd2 = "(shell \"(fsp-trace ./%s -s %s/hbotStringFile >> %s 2>/dev/null) || true\")"\
%(tracbin[node_num],\
OpenPOWER on IntegriCloud