aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/benchmark/report.ipynb
diff options
context:
space:
mode:
authorEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-27 05:54:18 +0000
committerEddie Hung <eddie.hung+gitlab@gmail.com>2018-07-27 05:54:18 +0000
commit56d551d4071194b0484395cdd1418cdacd56679f (patch)
tree2dea519e47cf4181cc9d18cab3b2ae821a963da1 /ice40/benchmark/report.ipynb
parent771edd1fda8692930e186a8913b7588d18fda710 (diff)
parent4c40541484f0f0b571e1c7e4604c39c74dd5c93d (diff)
downloadnextpnr-56d551d4071194b0484395cdd1418cdacd56679f.tar.gz
nextpnr-56d551d4071194b0484395cdd1418cdacd56679f.tar.bz2
nextpnr-56d551d4071194b0484395cdd1418cdacd56679f.zip
Merge branch 'redist_slack' into 'redist_slack'
Redist slack See merge request eddiehung/nextpnr!10
Diffstat (limited to 'ice40/benchmark/report.ipynb')
-rw-r--r--ice40/benchmark/report.ipynb69
1 files changed, 69 insertions, 0 deletions
diff --git a/ice40/benchmark/report.ipynb b/ice40/benchmark/report.ipynb
new file mode 100644
index 00000000..3232f38c
--- /dev/null
+++ b/ice40/benchmark/report.ipynb
@@ -0,0 +1,69 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [],
+ "source": [
+ "%matplotlib inline\n",
+ "import numpy as np\n",
+ "import matplotlib.pyplot as plt\n",
+ "import subprocess\n",
+ "\n",
+ "gitrev = subprocess.getoutput(\"git rev-parse --short HEAD\")\n",
+ "\n",
+ "data_a = 1 + np.zeros(10)\n",
+ "data_n = 1 + np.zeros(10)\n",
+ "\n",
+ "for i in range(10):\n",
+ " try:\n",
+ " with open(\"report_a%d.txt\" % i, \"r\") as f:\n",
+ " for line in f:\n",
+ " if line.startswith(\"Total path delay:\"):\n",
+ " data_a[i] = float(line.split()[3])\n",
+ " except:\n",
+ " pass\n",
+ " try:\n",
+ " with open(\"report_n%d.txt\" % i, \"r\") as f:\n",
+ " for line in f:\n",
+ " if line.startswith(\"Total path delay:\"):\n",
+ " data_n[i] = float(line.split()[3])\n",
+ " except:\n",
+ " pass\n",
+ "\n",
+ "plt.figure(figsize=(9,3))\n",
+ "plt.title(\"nextpnr -- ice40/benchmark/ -- %s\" % gitrev)\n",
+ "plt.bar(np.arange(10), data_a, color='blue')\n",
+ "plt.bar(15+np.arange(10), data_n, color='red')\n",
+ "plt.ylabel('Longest path (ns)')\n",
+ "plt.xticks([5, 20], [\"arachne-pnr\", \"nextpnr\"])\n",
+ "plt.xlim(-2, 27)\n",
+ "plt.show()"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.5.2"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 1
+}