aboutsummaryrefslogtreecommitdiff
path: root/fw/mapvis.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2017-06-10 19:14:18 +0200
committerjaseg <git@jaseg.net>2017-06-10 19:14:18 +0200
commit84de029e74859d98c82047b04b62d87a35d12a27 (patch)
treeaaed771646a9bee46dc5b7eaf10c954799ce0cbe /fw/mapvis.py
parent4dbd135d68335d27f0f1607ddcc7fea5343f42c5 (diff)
download7seg-84de029e74859d98c82047b04b62d87a35d12a27.tar.gz
7seg-84de029e74859d98c82047b04b62d87a35d12a27.tar.bz2
7seg-84de029e74859d98c82047b04b62d87a35d12a27.zip
fw working commit
Diffstat (limited to 'fw/mapvis.py')
-rw-r--r--fw/mapvis.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/fw/mapvis.py b/fw/mapvis.py
new file mode 100644
index 0000000..4a71222
--- /dev/null
+++ b/fw/mapvis.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+
+from matplotlib import pyplot as plt
+
+f, ax = plt.subplots(1, figsize=(3, 8))
+bar_width = 1
+
+ax.bar([-bar_width/2], top, bottom=bottom, width=bar_width, label='foo')
+ax.set_xticks([0], [filename])
+ax.set_ylabel('Memory usage (B)')
+ax.set_xlabel('')
+
+ax.set_xlim([-bar_width/2, bar_width/2])
+ax.set_ylim([0, mem_max])
+
+if __name__ == '__main__':
+ import argparse
+ import mapparse
+ parser = argparse.ArgumentParser(description='Visualize program memory usage using GCC map file')
+ parser.add_argument('mapfile', type=argparse.FileType('r'), description='Input GCC .map file')
+ args = parser.parse_args()
+
+ mapping = mapparse.MapFile(args.mapfile.read())
+ mapping.
+