Last active
April 6, 2019 00:03
-
-
Save schelleg/3999759b14e381cdd69926b8b8e1459c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "cells": [ | |
| { | |
| "cell_type": "code", | |
| "execution_count": 1, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "data": { | |
| "application/javascript": [ | |
| "\n", | |
| "require(['notebook/js/codecell'], function(codecell) {\n", | |
| " codecell.CodeCell.options_default.highlight_modes[\n", | |
| " 'magic_text/x-csrc'] = {'reg':[/^%%microblaze/]};\n", | |
| " Jupyter.notebook.events.one('kernel_ready.Kernel', function(){\n", | |
| " Jupyter.notebook.get_cells().map(function(cell){\n", | |
| " if (cell.cell_type == 'code'){ cell.auto_highlight(); } }) ;\n", | |
| " });\n", | |
| "});\n" | |
| ] | |
| }, | |
| "metadata": {}, | |
| "output_type": "display_data" | |
| } | |
| ], | |
| "source": [ | |
| "import pynq" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 2, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "1 loop, best of 3: 6.77 s per loop\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "%%timeit\n", | |
| "import imp\n", | |
| "imp.reload(pynq)\n", | |
| "\n", | |
| "from pynq.overlays.base import BaseOverlay\n", | |
| "base = BaseOverlay(\"base.bit\")" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 3, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "from pynq.overlays.base import BaseOverlay\n", | |
| "base = BaseOverlay(\"base.bit\")\n", | |
| "base.leds[1].on()" | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 4, | |
| "metadata": {}, | |
| "outputs": [ | |
| { | |
| "name": "stdout", | |
| "output_type": "stream", | |
| "text": [ | |
| "1 loop, best of 3: 269 ms per loop\n" | |
| ] | |
| } | |
| ], | |
| "source": [ | |
| "%%timeit\n", | |
| "import imp\n", | |
| "imp.reload(pynq)\n", | |
| "\n", | |
| "from pynq import PL\n", | |
| "from pynq.overlay import OverlayFromPL\n", | |
| "base = OverlayFromPL(PL.bitfile_name) " | |
| ] | |
| }, | |
| { | |
| "cell_type": "code", | |
| "execution_count": 2, | |
| "metadata": {}, | |
| "outputs": [], | |
| "source": [ | |
| "from pynq import PL\n", | |
| "from pynq.overlay import OverlayFromPL\n", | |
| "base = OverlayFromPL(PL.bitfile_name) \n", | |
| "base.leds_gpio[0].on()\n" | |
| ] | |
| } | |
| ], | |
| "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.6.5" | |
| } | |
| }, | |
| "nbformat": 4, | |
| "nbformat_minor": 2 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment