diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-24 18:15:53 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-24 18:15:53 +0100 |
commit | e2cd9c244b586281ccdd38678b174a439ed0026c (patch) | |
tree | 177b46a82b4f4ac4aecd5bef539369d46b65463f /src/app/deflatetest/benchmark.py | |
parent | cd73b1220a2952e3bfd106090c61e546cca4cbcc (diff) |
deflatetest benchmark: support avr-size
Diffstat (limited to 'src/app/deflatetest/benchmark.py')
-rwxr-xr-x | src/app/deflatetest/benchmark.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/app/deflatetest/benchmark.py b/src/app/deflatetest/benchmark.py index c9fc968..a88a28d 100755 --- a/src/app/deflatetest/benchmark.py +++ b/src/app/deflatetest/benchmark.py @@ -18,6 +18,7 @@ def main(arch): status = subprocess.run( ["./mp"] + make_args + ["deflate_nop=1"], stdout=subprocess.PIPE, + stderr=subprocess.PIPE, universal_newlines=True, ) @@ -26,9 +27,18 @@ def main(arch): if match: base_rom = int(match.group(1)) base_ram = int(match.group(2)) + match = re.match(r"Program: *(\d+) bytes", line) + if match: + base_rom = int(match.group(1)) + match = re.match(r"Data: *(\d+) bytes", line) + if match: + base_ram = int(match.group(1)) status = subprocess.run( - ["./mp"] + make_args, stdout=subprocess.PIPE, universal_newlines=True + ["./mp"] + make_args, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, ) for line in status.stdout.split("\n"): @@ -36,6 +46,12 @@ def main(arch): if match: defl_rom = int(match.group(1)) defl_ram = int(match.group(2)) + match = re.match(r"Program: *(\d+) bytes", line) + if match: + defl_rom = int(match.group(1)) + match = re.match(r"Data: *(\d+) bytes", line) + if match: + defl_ram = int(match.group(1)) rom_usage = int(np.ceil((defl_rom - base_rom) / 16)) * 16 ram_usage = int(np.ceil((defl_ram - base_ram) / 16)) * 16 |