summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-24 18:15:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-24 18:15:53 +0100
commite2cd9c244b586281ccdd38678b174a439ed0026c (patch)
tree177b46a82b4f4ac4aecd5bef539369d46b65463f
parentcd73b1220a2952e3bfd106090c61e546cca4cbcc (diff)
deflatetest benchmark: support avr-size
-rwxr-xr-xsrc/app/deflatetest/benchmark.py18
-rw-r--r--src/app/deflatetest/deflate_data.cc10
2 files changed, 22 insertions, 6 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
diff --git a/src/app/deflatetest/deflate_data.cc b/src/app/deflatetest/deflate_data.cc
index db92e9f..336571d 100644
--- a/src/app/deflatetest/deflate_data.cc
+++ b/src/app/deflatetest/deflate_data.cc
@@ -1,8 +1,8 @@
// CINFO = 7 (window size = 32768)
// FDICT = 0 (no preset dictionary)
// first Huffman block: type=2 is_final=1
-// src/app/ws2812b_uart/Makefile.inc
-unsigned char const inflate_input[] = {120, 156, 77, 141, 49, 11, 131, 48, 20, 6, 231, 230, 87, 60, 112, 172, 150, 232, 40, 56, 41, 66, 161, 67, 161, 75, 183, 18, 204, 75, 253, 168, 38, 225, 37, 72, 251, 239, 43, 157, 58, 222, 113, 112, 5, 109, 88, 91, 151, 187, 213, 188, 88, 21, 170, 160, 62, 196, 143, 224, 57, 103, 106, 116, 163, 105, 48, 30, 188, 208, 40, 224, 196, 203, 175, 184, 93, 135, 123, 117, 193, 196, 62, 113, 117, 182, 236, 51, 28, 88, 90, 234, 123, 93, 213, 39, 173, 20, 156, 101, 71, 38, 70, 117, 8, 27, 139, 192, 50, 45, 33, 68, 234, 168, 254, 83, 70, 166, 249, 97, 5, 59, 39, 58, 118, 84, 166, 108, 225, 75, 207, 33, 226, 189, 207, 216, 91, 56, 245, 5, 51, 195, 52, 47};
-unsigned short const inflate_input_size = 144;
-unsigned char deflate_output[164];
-unsigned short const deflate_output_size = 164;
+// src/app/ledblink/main.cc
+unsigned char const inflate_input[] = {120, 156, 109, 144, 65, 79, 195, 48, 12, 133, 207, 203, 175, 48, 229, 210, 77, 148, 150, 29, 217, 78, 172, 32, 38, 129, 132, 232, 36, 184, 85, 93, 227, 118, 22, 94, 82, 37, 233, 36, 132, 248, 239, 164, 101, 208, 30, 122, 74, 108, 127, 121, 239, 57, 241, 66, 192, 2, 54, 186, 249, 52, 84, 31, 28, 44, 147, 101, 2, 105, 161, 8, 25, 30, 12, 161, 69, 246, 64, 199, 100, 47, 233, 123, 244, 68, 37, 42, 139, 209, 86, 162, 114, 84, 17, 154, 91, 184, 203, 210, 104, 25, 109, 184, 104, 45, 122, 48, 22, 151, 164, 74, 110, 37, 66, 80, 152, 242, 112, 125, 8, 70, 29, 105, 232, 132, 38, 174, 27, 210, 147, 3, 235, 164, 110, 221, 228, 168, 109, 28, 29, 177, 27, 137, 147, 38, 9, 172, 117, 19, 118, 183, 185, 248, 18, 179, 94, 145, 81, 230, 78, 215, 53, 99, 120, 51, 95, 121, 137, 74, 98, 5, 187, 237, 243, 253, 107, 158, 137, 217, 135, 151, 134, 245, 26, 36, 150, 221, 113, 22, 172, 209, 229, 54, 156, 119, 29, 84, 146, 253, 51, 100, 191, 201, 63, 29, 236, 17, 27, 216, 123, 183, 96, 204, 40, 73, 149, 248, 22, 130, 148, 131, 99, 65, 106, 136, 210, 111, 109, 209, 181, 77, 232, 67, 252, 38, 27, 202, 78, 118, 40, 71, 193, 181, 10, 147, 63, 160, 247, 125, 68, 102, 125, 5, 111, 218, 176, 188, 24, 121, 15, 196, 14, 173, 155, 0, 206, 17, 72, 50, 230, 253, 47, 245, 70, 198, 123, 26, 5, 201, 202, 167, 254, 1, 87, 177, 154, 147};
+unsigned short const inflate_input_size = 288;
+unsigned char deflate_output[504];
+unsigned short const deflate_output_size = 504;