Skip to content

Instantly share code, notes, and snippets.

@henrikh
Last active August 15, 2017 17:29
Show Gist options
  • Save henrikh/135de23f83c323b707261a7a670fceaf to your computer and use it in GitHub Desktop.
Save henrikh/135de23f83c323b707261a7a670fceaf to your computer and use it in GitHub Desktop.

benchmark.py goes in the t-crest folder. Running it requires Python 3.

benchmarking.patch is applied in the patmos folder using

git apply benchmarking.patch

A folder called benchmark must exist in the t-crest folder.

The benchmarks were run on SSPM-device branch. Take notice that configuration and programming happens and works.

import subprocess
bufferSizes = [2**x for x in range(1, 7)]
pairs = range(1, 5)
for pair in pairs:
for bufferSize in bufferSizes:
file = open('patmos/c/libsspm/sspm_benchmark.h', 'w')
headerContent = """
#define SENDER_RECEIVER_PAIRS ({pair})
#define CHANNEL_BUFFER_CAPACITY ({bufferSize})""".format(pair = pair, bufferSize = bufferSize)
print(headerContent)
file.write(headerContent)
file.close()
configProc = subprocess.run("make -C aegean AEGEAN_PLATFORM=default-altde2-115-9core config".split())
configProc.check_returncode()
uploadProc = subprocess.run("make -C patmos -B APP=sspm_speed_test comp download".split(), stdout=subprocess.PIPE, universal_newlines=True)
uploadProc.check_returncode()
outputFilename = 'benchmark/p{pair}b{bufferSize}'.format(pair = pair, bufferSize = bufferSize)
file = open(outputFilename, 'a')
file.write(headerContent)
file.write('\n')
file.write(uploadProc.stdout)
From 0604537dc902a935109b8faed91786906f26ab5a Mon Sep 17 00:00:00 2001
From: Henrik Enggaard Hansen <henrik.enggaard@gmail.com>
Date: Tue, 15 Aug 2017 19:23:15 +0200
Subject: [PATCH] benchmarking
---
c/sspm_speed_test.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/c/sspm_speed_test.c b/c/sspm_speed_test.c
index 9fab822..a5ac066 100644
--- a/c/sspm_speed_test.c
+++ b/c/sspm_speed_test.c
@@ -6,10 +6,7 @@
#include "libcorethread/corethread.c"
#include "libsspm/led.h"
#include "libsspm/sspm_properties.h"
-
-const int SENDER_RECEIVER_PAIRS = 2;
-
-const int CHANNEL_BUFFER_CAPACITY = 54;
+#include "libsspm/sspm_benchmark.h"
volatile _UNCACHED int ready[1+(2*SENDER_RECEIVER_PAIRS)];
--
2.7.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment