summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-24 17:25:50 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-24 17:25:50 +0100
commitcd73b1220a2952e3bfd106090c61e546cca4cbcc (patch)
tree7bf13237ba8b6c3ef842d908411377dc01f0f95d
parent572721143ae46d9a1b9a3b4119fdca481b963a20 (diff)
deflatetest: add benchmark script
-rw-r--r--src/app/deflatetest/Makefile.inc6
-rwxr-xr-xsrc/app/deflatetest/benchmark.py61
-rwxr-xr-xsrc/app/deflatetest/deflate.py2
-rw-r--r--src/app/deflatetest/deflate_data.cc8
-rw-r--r--src/app/deflatetest/main.cc11
5 files changed, 80 insertions, 8 deletions
diff --git a/src/app/deflatetest/Makefile.inc b/src/app/deflatetest/Makefile.inc
index 11d1c8b..9d8756c 100644
--- a/src/app/deflatetest/Makefile.inc
+++ b/src/app/deflatetest/Makefile.inc
@@ -10,4 +10,8 @@ ifdef app
override arch_drivers += ,counter
endif
-CXX_TARGETS += src/lib/inflate.cc
+ifdef deflate_nop
+ COMMON_FLAGS += -DDEFLATE_NOP
+else
+ CXX_TARGETS += src/lib/inflate.cc
+endif
diff --git a/src/app/deflatetest/benchmark.py b/src/app/deflatetest/benchmark.py
new file mode 100755
index 0000000..c9fc968
--- /dev/null
+++ b/src/app/deflatetest/benchmark.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python3
+
+import numpy as np
+import re
+import subprocess
+import sys
+
+
+def main(arch):
+ make_args = [f"arch={arch}", "app=deflatetest"]
+ base_rom = None
+ base_ram = None
+ defl_rom = None
+ defl_ram = None
+ defl_ms = None
+ defl_size = None
+
+ status = subprocess.run(
+ ["./mp"] + make_args + ["deflate_nop=1"],
+ stdout=subprocess.PIPE,
+ universal_newlines=True,
+ )
+
+ for line in status.stdout.split("\n"):
+ match = re.search(r"ROM: (\d+) .* RAM: (\d+)", line)
+ if match:
+ base_rom = int(match.group(1))
+ base_ram = int(match.group(2))
+
+ status = subprocess.run(
+ ["./mp"] + make_args, stdout=subprocess.PIPE, universal_newlines=True
+ )
+
+ for line in status.stdout.split("\n"):
+ match = re.search(r"ROM: (\d+) .* RAM: (\d+)", line)
+ if match:
+ defl_rom = int(match.group(1))
+ defl_ram = int(match.group(2))
+
+ rom_usage = int(np.ceil((defl_rom - base_rom) / 16)) * 16
+ ram_usage = int(np.ceil((defl_ram - base_ram) / 16)) * 16
+ print(f"| {arch} | {rom_usage} B | {ram_usage} B")
+
+ status = subprocess.run(
+ ["make", "cat"] + make_args, stdout=subprocess.PIPE, universal_newlines=True
+ )
+
+ for line in status.stdout.split("\n"):
+ match = re.match(r"took ([0-9.]+) ms", line)
+ if match:
+ defl_ms = float(match.group(1))
+ match = re.match(r"inflate returned (\d+)", line)
+ if match:
+ defl_size = int(match.group(1))
+
+ defl_speed = defl_size / defl_ms
+ print(f"{defl_speed:3.0f} kB/s ({defl_size:4d} B @ {defl_ms:6.2f} ms)")
+
+
+if __name__ == "__main__":
+ main(*sys.argv[1:])
diff --git a/src/app/deflatetest/deflate.py b/src/app/deflatetest/deflate.py
index 3b1d9bd..89fad41 100755
--- a/src/app/deflatetest/deflate.py
+++ b/src/app/deflatetest/deflate.py
@@ -35,3 +35,5 @@ print(f"// first Huffman block: type={block_type} is_final={is_final}")
print(f"// {sys.argv[1]}")
print("unsigned char const inflate_input[] = {" + ", ".join(map(str, output)) + "};")
print(f"unsigned short const inflate_input_size = {len(output)};")
+print(f"unsigned char deflate_output[{len(input_data) + 1}];")
+print(f"unsigned short const deflate_output_size = {len(input_data) + 1};")
diff --git a/src/app/deflatetest/deflate_data.cc b/src/app/deflatetest/deflate_data.cc
index bcfd4b8..db92e9f 100644
--- a/src/app/deflatetest/deflate_data.cc
+++ b/src/app/deflatetest/deflate_data.cc
@@ -1,6 +1,8 @@
// CINFO = 7 (window size = 32768)
// FDICT = 0 (no preset dictionary)
// first Huffman block: type=2 is_final=1
-// /home/derf/var/projects/multipass/src/lib/inflate.cc
-unsigned char const inflate_input[] = {120, 156, 205, 90, 109, 111, 219, 56, 18, 254, 108, 255, 10, 110, 23, 215, 179, 19, 59, 177, 36, 203, 150, 235, 164, 135, 54, 73, 175, 197, 101, 219, 69, 155, 197, 29, 80, 4, 134, 108, 209, 177, 80, 89, 50, 36, 57, 105, 118, 147, 255, 126, 51, 124, 19, 37, 81, 142, 147, 251, 114, 133, 131, 218, 228, 112, 94, 159, 25, 14, 41, 29, 31, 180, 201, 1, 249, 51, 10, 231, 253, 128, 46, 35, 63, 167, 253, 56, 201, 242, 0, 6, 96, 2, 231, 206, 146, 205, 125, 26, 222, 172, 114, 98, 15, 108, 139, 156, 251, 113, 72, 35, 242, 33, 13, 105, 70, 35, 65, 243, 237, 247, 243, 255, 244, 47, 195, 5, 141, 51, 218, 255, 20, 208, 56, 15, 151, 33, 77, 223, 144, 247, 223, 206, 251, 118, 255, 44, 242, 183, 25, 5, 194, 227, 118, 251, 215, 48, 94, 68, 219, 128, 146, 87, 32, 226, 56, 140, 153, 204, 163, 213, 171, 118, 251, 152, 177, 186, 90, 81, 178, 72, 214, 155, 148, 102, 25, 13, 72, 71, 80, 4, 93, 18, 198, 155, 109, 78, 2, 63, 247, 143, 24, 171, 109, 156, 133, 55, 49, 208, 44, 86, 126, 74, 14, 132, 250, 51, 70, 54, 139, 147, 187, 233, 110, 10, 26, 7, 83, 93, 104, 64, 117, 177, 130, 22, 196, 38, 219, 28, 229, 102, 121, 74, 253, 245, 78, 201, 156, 114, 167, 104, 65, 82, 149, 189, 216, 166, 41, 56, 141, 204, 195, 156, 36, 203, 101, 70, 115, 176, 150, 228, 48, 195, 141, 230, 194, 123, 36, 92, 18, 63, 190, 63, 18, 94, 63, 231, 76, 197, 108, 70, 252, 148, 18, 248, 22, 144, 101, 154, 172, 73, 68, 253, 44, 39, 121, 66, 214, 16, 79, 130, 218, 64, 76, 22, 62, 151, 130, 44, 200, 187, 88, 10, 75, 150, 196, 2, 81, 1, 204, 231, 52, 3, 193, 126, 206, 164, 115, 30, 149, 181, 36, 204, 72, 246, 35, 220, 108, 104, 128, 92, 58, 225, 17, 61, 234, 145, 36, 142, 238, 113, 54, 35, 227, 30, 25, 245, 136, 219, 35, 195, 30, 113, 122, 196, 238, 129, 206, 1, 240, 151, 234, 117, 133, 19, 195, 56, 247, 102, 16, 80, 225, 26, 88, 59, 19, 234, 156, 146, 129, 114, 207, 123, 63, 67, 61, 226, 155, 124, 149, 145, 101, 146, 138, 239, 128, 145, 0, 52, 237, 224, 127, 196, 118, 199, 104, 168, 237, 185, 140, 55, 64, 86, 12, 46, 18, 240, 107, 182, 73, 226, 32, 67, 2, 31, 6, 54, 247, 104, 173, 67, 230, 247, 96, 105, 143, 208, 124, 81, 168, 99, 141, 64, 159, 69, 18, 103, 133, 86, 92, 154, 80, 44, 251, 126, 13, 186, 253, 213, 110, 57, 204, 56, 151, 25, 10, 230, 122, 61, 50, 233, 17, 107, 0, 127, 22, 252, 193, 172, 5, 115, 22, 204, 88, 48, 110, 163, 19, 224, 187, 3, 115, 14, 186, 5, 126, 187, 240, 221, 157, 244, 218, 173, 17, 46, 135, 129, 9, 50, 96, 171, 144, 204, 26, 33, 143, 9, 252, 180, 113, 165, 237, 122, 237, 71, 229, 145, 139, 159, 121, 234, 115, 87, 63, 215, 31, 43, 63, 35, 113, 66, 168, 226, 208, 35, 124, 193, 200, 101, 115, 86, 49, 197, 66, 139, 129, 43, 96, 225, 75, 89, 8, 23, 139, 128, 108, 203, 6, 71, 109, 0, 205, 97, 124, 3, 8, 32, 168, 211, 173, 31, 109, 105, 183, 226, 89, 175, 201, 177, 168, 132, 244, 42, 248, 207, 248, 177, 180, 143, 173, 125, 28, 237, 51, 44, 62, 237, 150, 203, 98, 195, 63, 3, 238, 185, 99, 2, 240, 37, 126, 148, 37, 100, 78, 193, 74, 153, 232, 96, 52, 148, 152, 128, 254, 36, 39, 100, 72, 30, 30, 8, 255, 113, 122, 10, 222, 235, 146, 127, 144, 1, 121, 35, 8, 250, 195, 46, 121, 251, 150, 216, 37, 96, 6, 97, 150, 251, 241, 130, 242, 80, 200, 95, 165, 96, 12, 88, 40, 38, 90, 36, 6, 37, 159, 170, 69, 232, 213, 167, 1, 41, 201, 171, 144, 180, 164, 75, 56, 48, 199, 28, 146, 14, 135, 161, 13, 35, 14, 206, 193, 216, 8, 190, 79, 16, 154, 54, 18, 76, 16, 156, 46, 162, 211, 115, 209, 115, 184, 98, 60, 98, 104, 198, 69, 150, 235, 224, 242, 1, 46, 116, 6, 99, 100, 49, 192, 197, 35, 107, 8, 179, 30, 91, 110, 217, 182, 55, 97, 152, 245, 16, 176, 67, 119, 60, 110, 70, 235, 222, 46, 106, 130, 234, 80, 0, 21, 134, 158, 196, 152, 242, 85, 19, 202, 116, 76, 233, 56, 114, 101, 114, 243, 252, 230, 41, 206, 179, 156, 39, 58, 248, 91, 102, 59, 254, 217, 226, 15, 189, 225, 60, 9, 56, 137, 55, 187, 140, 47, 155, 225, 203, 146, 142, 251, 20, 147, 121, 148, 44, 126, 144, 252, 126, 3, 25, 10, 91, 210, 125, 236, 175, 195, 5, 89, 109, 151, 203, 53, 240, 102, 30, 132, 68, 203, 87, 220, 155, 170, 74, 2, 144, 162, 48, 167, 169, 31, 29, 243, 33, 100, 135, 169, 172, 156, 239, 71, 155, 149, 63, 135, 74, 139, 53, 25, 214, 175, 97, 43, 191, 133, 112, 100, 121, 146, 114, 29, 75, 66, 142, 200, 85, 66, 50, 255, 22, 182, 154, 141, 191, 192, 141, 28, 183, 167, 5, 38, 0, 43, 251, 62, 89, 210, 187, 178, 14, 200, 24, 246, 252, 160, 166, 158, 8, 60, 206, 115, 105, 130, 27, 146, 45, 147, 40, 74, 238, 88, 45, 73, 3, 154, 130, 216, 21, 236, 53, 62, 14, 102, 66, 8, 3, 82, 206, 124, 138, 10, 5, 184, 37, 102, 201, 154, 139, 64, 86, 37, 5, 226, 45, 115, 57, 152, 142, 236, 197, 207, 154, 158, 98, 179, 131, 50, 134, 174, 99, 251, 30, 56, 106, 23, 176, 86, 11, 88, 63, 99, 97, 83, 249, 55, 18, 21, 223, 99, 200, 242, 100, 10, 142, 248, 198, 224, 114, 164, 12, 57, 80, 28, 142, 21, 132, 204, 144, 163, 208, 213, 82, 230, 172, 18, 76, 212, 232, 149, 166, 245, 43, 110, 66, 39, 163, 160, 251, 60, 185, 165, 13, 59, 234, 106, 33, 170, 108, 246, 221, 154, 92, 239, 100, 95, 198, 139, 25, 44, 153, 89, 74, 20, 5, 74, 140, 99, 121, 133, 156, 119, 89, 182, 93, 111, 242, 16, 60, 247, 6, 127, 31, 148, 64, 37, 225, 0, 1, 142, 194, 53, 136, 15, 48, 172, 22, 75, 236, 140, 147, 131, 98, 24, 29, 248, 139, 177, 139, 97, 80, 133, 213, 182, 235, 150, 225, 73, 238, 66, 96, 132, 102, 100, 254, 90, 50, 22, 61, 210, 87, 31, 21, 240, 35, 250, 134, 68, 73, 124, 67, 211, 202, 210, 53, 235, 108, 125, 104, 102, 160, 77, 187, 91, 209, 24, 202, 75, 12, 221, 47, 96, 48, 242, 211, 27, 202, 250, 77, 100, 132, 181, 246, 136, 252, 27, 6, 146, 248, 239, 96, 125, 194, 186, 164, 41, 64, 55, 203, 161, 169, 233, 145, 59, 150, 229, 116, 145, 11, 172, 105, 221, 100, 150, 108, 83, 112, 100, 158, 32, 163, 121, 197, 28, 142, 235, 31, 239, 49, 20, 69, 115, 43, 55, 25, 104, 183, 84, 222, 108, 99, 192, 62, 134, 38, 134, 170, 200, 157, 8, 77, 35, 54, 226, 172, 180, 94, 138, 24, 94, 138, 24, 138, 176, 137, 162, 186, 158, 135, 216, 142, 42, 87, 149, 178, 0, 242, 207, 16, 78, 150, 187, 144, 227, 107, 255, 7, 24, 180, 193, 95, 200, 171, 73, 14, 249, 70, 89, 49, 129, 145, 155, 36, 5, 57, 107, 228, 251, 245, 195, 25, 118, 50, 22, 56, 112, 129, 161, 32, 206, 145, 125, 100, 163, 194, 200, 43, 160, 185, 31, 70, 153, 236, 104, 63, 41, 61, 164, 236, 91, 63, 13, 253, 121, 36, 42, 6, 43, 167, 44, 137, 209, 96, 148, 37, 163, 169, 42, 90, 24, 51, 190, 149, 90, 201, 42, 105, 3, 128, 231, 209, 140, 249, 22, 76, 255, 110, 217, 128, 95, 181, 243, 74, 10, 244, 247, 12, 29, 166, 72, 94, 16, 158, 243, 106, 62, 61, 161, 77, 240, 164, 50, 130, 162, 13, 124, 115, 176, 181, 70, 153, 210, 219, 217, 29, 84, 210, 142, 154, 193, 95, 61, 34, 69, 98, 166, 117, 219, 80, 187, 212, 124, 42, 155, 239, 98, 104, 237, 103, 63, 96, 204, 130, 49, 180, 162, 224, 149, 202, 25, 114, 114, 66, 58, 172, 46, 247, 137, 213, 157, 138, 137, 183, 192, 70, 126, 125, 11, 84, 93, 44, 146, 45, 168, 214, 29, 84, 130, 188, 230, 115, 124, 180, 133, 114, 31, 78, 153, 44, 144, 211, 122, 132, 63, 182, 242, 228, 132, 75, 134, 1, 32, 217, 166, 49, 106, 56, 109, 63, 150, 108, 174, 28, 34, 112, 97, 71, 51, 145, 187, 147, 217, 41, 120, 116, 152, 202, 197, 20, 234, 93, 101, 90, 114, 228, 13, 205, 185, 35, 155, 188, 37, 244, 239, 212, 206, 160, 223, 7, 215, 184, 169, 215, 207, 56, 93, 109, 149, 100, 216, 37, 245, 245, 214, 53, 115, 175, 7, 58, 154, 153, 160, 71, 13, 51, 204, 175, 92, 0, 124, 33, 240, 79, 19, 99, 208, 211, 190, 38, 175, 49, 18, 173, 170, 39, 13, 188, 187, 76, 37, 107, 68, 250, 108, 5, 251, 215, 160, 221, 206, 192, 213, 124, 140, 32, 82, 161, 139, 183, 235, 89, 19, 66, 235, 129, 1, 89, 134, 131, 228, 225, 169, 98, 3, 4, 119, 171, 48, 162, 38, 111, 17, 0, 168, 199, 93, 86, 243, 204, 225, 225, 180, 221, 50, 241, 238, 195, 154, 170, 133, 0, 235, 170, 255, 148, 25, 186, 245, 183, 73, 24, 20, 148, 219, 16, 106, 174, 172, 10, 202, 126, 213, 202, 244, 10, 103, 101, 225, 159, 180, 199, 156, 14, 1, 45, 8, 101, 205, 208, 40, 15, 136, 170, 19, 101, 7, 134, 122, 114, 179, 34, 85, 75, 248, 159, 184, 1, 136, 97, 150, 243, 33, 251, 65, 66, 232, 89, 45, 27, 254, 63, 60, 228, 206, 146, 114, 191, 135, 215, 130, 28, 76, 172, 45, 65, 165, 181, 69, 8, 88, 217, 47, 132, 215, 162, 0, 40, 78, 197, 204, 53, 247, 252, 99, 109, 9, 148, 22, 161, 163, 88, 92, 104, 92, 16, 137, 165, 37, 125, 44, 174, 143, 36, 63, 100, 3, 82, 45, 225, 10, 126, 32, 57, 36, 133, 105, 88, 29, 174, 25, 228, 177, 18, 181, 148, 91, 185, 209, 248, 141, 217, 189, 3, 218, 184, 9, 237, 23, 86, 204, 211, 23, 198, 149, 13, 179, 210, 218, 144, 30, 170, 122, 235, 201, 197, 189, 162, 126, 241, 248, 202, 159, 210, 53, 101, 25, 98, 89, 109, 147, 81, 10, 244, 136, 134, 121, 30, 60, 229, 77, 57, 3, 213, 230, 181, 198, 14, 242, 175, 240, 171, 162, 17, 133, 171, 68, 121, 98, 34, 212, 227, 165, 6, 5, 56, 158, 172, 10, 173, 189, 234, 66, 99, 101, 216, 85, 27, 56, 122, 91, 210, 233, 120, 102, 216, 36, 232, 60, 101, 207, 84, 159, 95, 108, 83, 125, 190, 108, 35, 163, 44, 239, 192, 205, 57, 86, 75, 153, 211, 194, 100, 73, 193, 72, 148, 200, 83, 169, 157, 154, 150, 101, 45, 228, 86, 114, 83, 32, 79, 248, 10, 105, 252, 163, 180, 242, 81, 47, 133, 35, 215, 117, 92, 189, 224, 85, 79, 38, 188, 45, 211, 147, 34, 154, 213, 243, 2, 6, 203, 169, 161, 229, 70, 80, 166, 103, 220, 25, 117, 57, 45, 68, 126, 22, 57, 41, 6, 68, 204, 45, 61, 249, 5, 222, 74, 105, 171, 235, 37, 213, 49, 117, 142, 162, 42, 155, 58, 70, 149, 5, 76, 10, 28, 251, 221, 145, 112, 178, 190, 119, 23, 151, 199, 24, 140, 250, 125, 177, 140, 139, 240, 240, 249, 197, 135, 203, 119, 87, 23, 179, 139, 175, 95, 103, 95, 254, 184, 250, 253, 143, 171, 217, 229, 197, 231, 127, 94, 125, 44, 96, 103, 184, 151, 46, 10, 86, 1, 219, 98, 86, 20, 92, 66, 35, 104, 188, 149, 194, 120, 21, 166, 52, 22, 210, 7, 26, 225, 95, 18, 194, 60, 100, 128, 162, 91, 63, 210, 10, 68, 229, 6, 149, 241, 236, 227, 157, 211, 117, 9, 252, 236, 162, 167, 90, 92, 244, 75, 194, 234, 66, 84, 176, 88, 36, 221, 35, 229, 31, 158, 214, 59, 11, 141, 186, 240, 82, 160, 98, 95, 15, 190, 134, 177, 160, 64, 162, 222, 236, 168, 102, 189, 58, 163, 117, 233, 221, 105, 201, 67, 120, 174, 174, 184, 168, 118, 167, 199, 148, 226, 102, 26, 253, 82, 190, 216, 210, 168, 205, 78, 81, 34, 247, 246, 138, 72, 15, 225, 205, 126, 95, 47, 43, 207, 69, 236, 126, 144, 21, 245, 165, 206, 28, 91, 232, 83, 217, 243, 144, 3, 147, 248, 190, 114, 106, 119, 218, 192, 69, 212, 171, 71, 173, 163, 168, 21, 116, 44, 247, 181, 103, 68, 192, 124, 88, 6, 191, 110, 199, 167, 207, 101, 51, 30, 203, 173, 64, 165, 236, 233, 151, 2, 252, 44, 97, 222, 84, 244, 108, 66, 219, 89, 251, 190, 199, 49, 1, 246, 170, 67, 195, 228, 224, 90, 231, 25, 239, 205, 212, 217, 197, 20, 79, 158, 114, 151, 129, 182, 55, 86, 237, 152, 193, 75, 159, 193, 65, 188, 85, 174, 251, 28, 32, 57, 172, 28, 99, 180, 73, 230, 1, 83, 88, 26, 101, 85, 34, 242, 216, 110, 194, 108, 141, 119, 21, 185, 123, 192, 246, 177, 122, 40, 214, 182, 100, 224, 174, 237, 200, 38, 220, 226, 220, 169, 134, 104, 13, 4, 229, 179, 211, 96, 199, 86, 202, 71, 213, 142, 90, 111, 246, 43, 237, 56, 52, 124, 67, 71, 83, 204, 116, 141, 199, 58, 91, 79, 179, 143, 117, 207, 195, 161, 96, 96, 187, 238, 62, 12, 38, 21, 6, 176, 139, 72, 6, 227, 201, 62, 12, 198, 85, 6, 158, 52, 193, 246, 246, 210, 160, 106, 130, 237, 41, 13, 188, 17, 0, 192, 222, 75, 13, 87, 156, 107, 26, 206, 107, 198, 139, 51, 224, 223, 220, 38, 240, 86, 166, 177, 87, 216, 95, 14, 154, 128, 130, 236, 137, 137, 175, 182, 57, 53, 109, 75, 2, 95, 213, 182, 172, 209, 36, 131, 20, 163, 58, 221, 29, 128, 21, 87, 115, 117, 196, 122, 213, 211, 233, 42, 10, 115, 134, 155, 177, 86, 129, 212, 190, 229, 118, 167, 197, 186, 21, 110, 0, 236, 50, 234, 73, 202, 5, 63, 42, 14, 77, 148, 67, 160, 172, 31, 96, 217, 18, 3, 82, 180, 251, 117, 211, 131, 1, 56, 194, 214, 122, 74, 37, 201, 233, 86, 176, 41, 133, 136, 102, 62, 89, 118, 234, 98, 186, 47, 84, 66, 29, 205, 159, 128, 86, 193, 75, 143, 116, 179, 58, 59, 81, 7, 96, 111, 130, 184, 94, 161, 114, 186, 206, 102, 155, 52, 89, 240, 171, 114, 174, 171, 104, 63, 170, 147, 39, 28, 18, 135, 60, 220, 197, 225, 212, 83, 87, 25, 166, 22, 222, 96, 29, 123, 46, 255, 191, 116, 241, 208, 240, 88, 178, 39, 46, 52, 216, 220, 115, 78, 96, 133, 99, 130, 151, 221, 45, 159, 226, 188, 242, 142, 81, 48, 40, 29, 229, 140, 133, 169, 236, 25, 189, 67, 218, 131, 156, 93, 105, 240, 78, 169, 50, 163, 183, 73, 245, 115, 128, 53, 174, 152, 28, 111, 163, 104, 183, 201, 206, 110, 147, 11, 6, 47, 48, 153, 31, 67, 158, 107, 131, 183, 203, 6, 203, 88, 64, 198, 255, 15, 70, 148, 110, 51, 158, 224, 169, 14, 121, 70, 174, 143, 207, 223, 207, 48, 239, 94, 154, 237, 207, 219, 208, 152, 36, 158, 224, 47, 219, 212, 158, 183, 171, 53, 25, 214, 168, 20, 223, 218, 84, 249, 226, 111, 167, 117, 42, 175, 123, 241, 78, 110, 190, 93, 106, 151, 25, 124, 12, 120, 162, 184, 10, 189, 232, 9, 203, 11, 196, 32, 54, 214, 184, 69, 30, 31, 43, 232, 101, 179, 101, 24, 179, 19, 164, 18, 132, 167, 164, 215, 100, 240, 115, 96, 105, 123, 29, 123, 234, 53, 99, 239, 15, 156, 226, 91, 6, 85, 218, 17, 127, 227, 0, 219, 111, 190, 128, 93, 210, 155, 186, 116, 77, 210, 180, 58, 143, 135, 36, 109, 30, 220, 165, 76, 53, 223, 202, 67, 169, 208, 165, 148, 174, 39, 10, 79, 76, 107, 20, 92, 80, 65, 1, 146, 10, 31, 33, 199, 236, 46, 204, 23, 43, 188, 110, 148, 118, 179, 92, 100, 47, 42, 12, 222, 136, 7, 34, 69, 195, 95, 62, 142, 97, 102, 204, 83, 234, 227, 19, 40, 182, 194, 170, 175, 168, 54, 219, 181, 53, 118, 125, 77, 173, 223, 209, 23, 1, 145, 191, 141, 242, 55, 230, 227, 198, 251, 203, 47, 103, 255, 18, 91, 55, 214, 48, 100, 124, 66, 6, 165, 227, 9, 11, 25, 163, 168, 192, 190, 116, 62, 214, 221, 90, 135, 239, 12, 223, 255, 124, 54, 134, 249, 133, 220, 243, 129, 140, 150, 40, 70, 248, 218, 213, 51, 206, 114, 18, 217, 168, 240, 108, 77, 243, 85, 18, 24, 179, 96, 57, 173, 208, 130, 157, 55, 89, 137, 20, 119, 64, 174, 140, 206, 236, 23, 117, 227, 107, 208, 231, 183, 139, 171, 143, 95, 206, 181, 128, 104, 172, 81, 172, 61, 104, 92, 250, 225, 252, 211, 217, 149, 182, 178, 163, 31, 189, 75, 250, 243, 35, 247, 67, 73, 211, 46, 249, 27, 113, 172, 102, 230, 103, 31, 47, 10, 160, 232, 79, 202, 248, 49, 95, 86, 41, 61, 71, 237, 94, 17, 77, 188, 86, 235, 17, 61, 118, 90, 200, 166, 248, 206, 238, 18, 80, 165, 68, 50, 105, 223, 254, 248, 173, 0, 37, 156, 162, 7, 149, 103, 5, 42, 101, 44, 241, 244, 216, 48, 101, 139, 55, 61, 107, 23, 54, 60, 211, 235, 72, 70, 54, 108, 23, 126, 186, 118, 180, 74, 229, 92, 163, 59, 49, 28, 248, 119, 208, 171, 253, 92, 55, 72, 110, 24, 60, 136, 142, 173, 223, 159, 192, 252, 161, 218, 80, 180, 249, 142, 225, 62, 182, 139, 129, 29, 185, 174, 109, 149, 174, 100, 209, 49, 59, 69, 216, 102, 17, 133, 10, 37, 190, 136, 138, 157, 207, 137, 155, 158, 109, 168, 133, 29, 77, 242, 47, 178, 201, 38, 157, 221, 215, 71, 26, 150, 11, 58, 185, 214, 120, 135, 213, 149, 211, 15, 15, 133, 178, 224, 79, 38, 178, 245, 132, 56, 187, 65, 92, 203, 64, 235, 128, 168, 230, 75, 61, 137, 111, 213, 43, 253, 138, 111, 184, 46, 219, 213, 103, 217, 255, 5, 16, 252, 175, 19};
-unsigned short const inflate_input_size = 3260;
+// 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;
diff --git a/src/app/deflatetest/main.cc b/src/app/deflatetest/main.cc
index 41ff742..7e90138 100644
--- a/src/app/deflatetest/main.cc
+++ b/src/app/deflatetest/main.cc
@@ -12,17 +12,20 @@
#include "lib/inflate.h"
#include "deflate_data.cc"
-unsigned char deflate_output[1024];
-
int main(void)
{
arch.setup();
gpio.setup();
kout.setup();
- for (uint8_t i = 0; i < 5; i++) {
+ while (1) {
counter.start();
- int16_t ret = inflate_zlib((unsigned char*)inflate_input, inflate_input_size, deflate_output, sizeof(deflate_output));
+#ifdef DEFLATE_NOP
+ kout << (unsigned char*)inflate_input << endl;
+ uint16_t ret = 1;
+#else
+ int16_t ret = inflate_zlib((unsigned char*)inflate_input, inflate_input_size, deflate_output, deflate_output_size);
+#endif
counter.stop();
kout << "inflate returned " << ret << endl;
kout << "Output: " << (char*)deflate_output << endl;