67c67
< 'only_committed':0 # Set if only committed instructions are printed.
---
> 'only_committed':0, # Set if only committed instructions are printed.
71c71
< committed_only, start_tick, stop_tick, start_sn, stop_sn):
---
> committed_only, store_completions, start_tick, stop_tick, start_sn, stop_sn):
83,87d82
< # Read the first line
< line = trace.readline()
< if not line: return
< fields = line.split(':')
<
91,93d85
< if fields[0] != 'O3PipeView': continue
< if (int(fields[2]) > 0 and
< int(fields[2]) >= start_tick-insts['tick_drift']): break
97,100d88
<
< # Skip lines up to the starting sequence number
< if start_sn != 0:
< while True:
102,104c90,92
< if (fields[1] == 'fetch' and
< int(fields[5]) >= (start_sn-insts['max_threshold'])):
< break
---
> if int(fields[2]) >= start_tick: break
> elif start_sn != 0:
> while True:
107a96,101
> if fields[0] != 'O3PipeView': continue
> if fields[1] == 'fetch' and int(fields[5]) >= start_sn: break
> else:
> line = trace.readline()
> if not line: return
> fields = line.split(':')
117c111,116
< 'i = issue, c = complete, r = retire\n\n')
---
> 'i = issue, c = complete, r = retire')
>
> if store_completions:
> outfile.write(', s = store-complete')
> outfile.write('\n\n')
>
122c121
< ' ' + 'seq_num'.center(15))
---
> ' ' + 'seq_num'.center(10))
141c140,145
< queue_inst(outfile, curr_inst, cycle_time, width, color, timestamps)
---
> if curr_inst['retire'] == 0:
> curr_inst['disasm'] = '-----' + curr_inst['disasm']
> if store_completions:
> curr_inst[fields[3]] = int(fields[4])
> queue_inst(outfile, curr_inst, cycle_time, width, color, timestamps, store_completions)
>
143c147,149
< if not line: return
---
> if not line:
> print_insts(outfile, cycle_time, width, color, timestamps, store_completions, 0)
> return
153c159
< def queue_inst(outfile, inst, cycle_time, width, color, timestamps):
---
> def queue_inst(outfile, inst, cycle_time, width, color, timestamps, store_completions):
158c164
< print_insts(outfile, cycle_time, width, color, timestamps, insts['min_threshold'])
---
> print_insts(outfile, cycle_time, width, color, timestamps, store_completions, insts['min_threshold'])
161c167
< def print_insts(outfile, cycle_time, width, color, timestamps, lower_threshold):
---
> def print_insts(outfile, cycle_time, width, color, timestamps, store_completions, lower_threshold):
182c188
< print_inst(outfile, print_item, cycle_time, width, color, timestamps)
---
> print_inst(outfile, print_item, cycle_time, width, color, timestamps, store_completions)
185c191
< def print_inst(outfile, inst, cycle_time, width, color, timestamps):
---
> def print_inst(outfile, inst, cycle_time, width, color, timestamps, store_completions):
211c217,223
< 'shorthand': 'r'}]
---
> 'shorthand': 'r'}
> ]
> if store_completions:
> stages.append(
> {'name': 'store',
> 'color': termcap.Yellow + termcap.Reverse,
> 'shorthand': 's'})
221c233,235
< inst['dispatch'],inst['issue'], inst['complete'], inst['retire'])
---
> inst['dispatch'],inst['issue'], inst['complete'], inst['retire'])
> if store_completions:
> last_event_time = max(last_event_time, inst['store'])
271c285
< outfile.write('%s.%s %s [%s]' % (
---
> outfile.write('%s.%s %s [%s]' % (
275c289
< str(inst['sn']).rjust(15)))
---
> str(inst['sn']).rjust(10)))
331a346,349
> parser.add_option(
> '--store_completions',
> action='store_true', default=False,
> help="additionally display store completion ticks (default: '%default')")
350c368,369
< options.only_committed, *(tick_range + inst_range))
---
> options.only_committed, options.store_completions,
> *(tick_range + inst_range))