diff options
author | Monte Copeland <copelanm@us.ibm.com> | 2012-02-02 10:14:17 -0600 |
---|---|---|
committer | Monte K. Copeland <copelanm@us.ibm.com> | 2012-02-03 10:21:51 -0600 |
commit | 672ca9b23baf4923d74152fec4872b5207f96de8 (patch) | |
tree | f87cd7139552fc8f312042659ce0f508373afbe3 /src/build | |
parent | 966df7556d9ebd045291921eda8c81bdba9b5d2e (diff) | |
download | talos-hostboot-672ca9b23baf4923d74152fec4872b5207f96de8.tar.gz talos-hostboot-672ca9b23baf4923d74152fec4872b5207f96de8.zip |
Continuous trace: clear mixed trace buffer from callback in Simics
Change-Id: Ia42c047c40e2d87200e4d3f531ff194a1c3af1ac
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/641
Tested-by: Jenkins Server
Reviewed-by: Van H. Lee <vanlee@us.ibm.com>
Reviewed-by: Monte K. Copeland <copelanm@us.ibm.com>
Diffstat (limited to 'src/build')
-rwxr-xr-x | src/build/debug/simics-debug-framework.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py index 8f4e0de78..d29fb1bdc 100755 --- a/src/build/debug/simics-debug-framework.py +++ b/src/build/debug/simics-debug-framework.py @@ -292,6 +292,27 @@ def readLongLong(address): return hexDumpToNumber(hexlist) + +# Write simics memory. address is an integer. +# data is a list of byte-sized integers. +def writeSimicsMemory(address,data): + size = len(data) + conf.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; + lst.insert(0,b) + n = n >> 8 + return lst + +# Write the 64-bit big endian n at the address given. +def writeLongLong(address,n): + writeSimicsMemory(address,intToList(n,8)) + + # MAGIC_INSTRUCTION hap handler # arg contains the integer parameter n passed to MAGIC_INSTRUCTION(n) # See src/include/arch/ppc.H for the definitions of the magic args. @@ -319,10 +340,16 @@ def magic_instruction_callback(user_arg, cpu, arg): SIM_run_alone(run_command, saveCommand ) # Run fsp-trace on tracBINARY file (implied), append output to tracMERG os.system( "fsp-trace ./ -s hbotStringFile >>tracMERG 2>/dev/null" ) + # Reset the buffer byte count in Simics memory to 1, preserving the byte + # at offset 0 of the buffer which contains a 0x02 in fsp-trace style. + writeLongLong(tracBinaryInfoAddr+8, 1 ) # Continuous trace: Open the symbols and find the address for # "g_tracBinaryInfo" Convert to a number and save in tracBinaryInfoAddr +# The layout of g_tracBinaryInfo is a 64-bit pointer to the mixed buffer +# followed by a 64-bit count of bytes used in the buffer. See +# src/usr/trace/trace.C and mixed_trace_info_t. for line in open('hbicore.syms'): if "g_tracBinaryInfo" in line: words=line.split(",") |