~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to scripts/plot-align.py

  • Committer: Will Newton
  • Date: 2013-06-21 14:42:10 UTC
  • Revision ID: will.newton@linaro.org-20130621144210-za4jb0kw9d4mcnml
Allow aligning source and destination buffers separately.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
    records = [x for x in records if x.bytes==bytes and x.function==function]
13
13
 
14
14
    variants = libplot.unique(records, 'variant', prefer='this')
15
 
    alignments = libplot.unique(records, 'alignment')
 
15
    alignments = libplot.unique(records, ('src_alignment', 'dst_alignment'))
16
16
 
17
17
    X = pylab.arange(len(alignments))
18
18
    width = 1.0/(len(variants)+1)
26
26
        heights = []
27
27
 
28
28
        for alignment in alignments:
29
 
            matches = [x for x in records if x.variant==variant and x.alignment==alignment]
 
29
            matches = [x for x in records if x.variant==variant and x.src_alignment==alignment[0] and x.dst_alignment==alignment[1]]
30
30
 
31
31
            if matches:
32
32
                match = matches[0]
38
38
 
39
39
 
40
40
    axes = pylab.axes()
41
 
    axes.set_xticklabels(alignments)
 
41
    if libplot.alignments_equal(alignments):
 
42
        alignment_labels = ["%s" % x[0] for x in alignments]
 
43
    else:
 
44
        alignment_labels = ["%s:%s" % (x[0], x[1]) for x in alignments]
 
45
    axes.set_xticklabels(alignment_labels)
42
46
    axes.set_xticks(X + 0.5)
43
47
 
44
48
    pylab.title('Performance of different variants of %(function)s for %(bytes)d byte blocks' % locals())