{ "cells": [ { "cell_type": "markdown", "id": "86e2fc22", "metadata": { "tags": [] }, "source": [ "# myhdl.v2we workspace\n", "\n", "Prototyping/examples for 'next generation' HDL.\n", "\n", "It is assumed, that you are familiar with Python and Jupyter Notebooks (see also [below](#Mybinder)).\n", "\n", "### myHDL emulation\n", "\n", "This is still a draft for some 'next generation' syntax, however *some* compatibility will be preserved.\n", "See 'Changes' below.\n", "\n", "For details, see \n", "\n", "* Syntax issues:\n", " * [Changes from 'classic' myHDL](../notebooks/myhdl_changes.ipynb)\n", " * [Migration notes](../myhdl_migration.ipynb) - Porting legacy myHDL code\n", "* Advanced tricks:\n", " * [Factory classes](class_factories.ipynb): Object oriented, fully parametrizeable `@block` creation\n", " * [Composite classes](composite_classes.ipynb):\n", " * Signals associated with RTL elements\n", " * Counter abstractions (Gray counter)\n", "* Pitfalls: Classical 'programming' mistakes and legacy issues\n", " * [Arithmetic issues and pitfalls](arith_pitfalls.ipynb)\n", " * [Boolean pitfalls](bool_pitfalls.ipynb)\n", " * [Conditional code issues](conditional_pitfalls.ipynb)\n", " * [Concat issues](myhdl_concat.ipynb)\n", "\n", "Basic examples:\n", "\n", "* [Gray counter](gray_counter.ipynb)\n", "* [Simple hysteresis example with FSM](example_fsm_hysteresis.ipynb)\n", "* [Barrel shifter](example_barrelshifter.ipynb)\n", " * From the 'library': [Cythonized barrel shifter](example_cython_barrelshifter.ipynb)\n", "\n", "Direct synthesis and CXXRTL simulation via **yosys**:\n", "\n", "* [RTLIL target](target_rtlil.ipynb) - Direct generation and simulation of synthesizable elements\n", "* [Memory inference tests](yosys_memory.ipynb) - From functional memory description to FPGA block RAM\n", "\n", "### IRL extension examples\n", "\n", "* [Generators](generator_functions.ipynb) - Advanced procedural generation of RTL\n", " * [Pipeline generator example](pipeline_generators.ipynb)\n", " * [Advanced generators](advanced_generators.ipynb) - Advanced generator examples for verification\n", " * [CRC generator](crc.ipynb)\n", " * [10b8b encoder/decoder](codec10b8b.ipynb) - Digital Video (HDMI) 10b8b coding\n", "* Creation by derivation - Examples from the Cyrite library (Memory, ...)\n", " * [Register map / SoC auxiliaries](soc_auxiliaries.ipynb) - Register map decoders\n", " * [Dual port memory (VHDL)](tdpram.ipynb)\n", " * [Vector operations: RGB to YUV conversion](rgb2yuv.ipynb) - Pipeline and basic vector extensions\n", "* [Fun stuff](fun_stuff.ipynb) - Things you could do but maybe shouldn't...\n", " * Defining your own infix operators\n", " * Using HDL style `<=` for signal assignments\n", "\n", "## Kernel reference and examples\n", "\n", "[Documentation examples/HOWTOs](../notebooks/index.ipynb) - The HOWTO and kernel reference 'manual' for developers\n", "\n", "## Mybinder\n", "\n", "The [mybinder](https://mybinder.org) environment allows you to run your HDL simulation demos via the browser in a virtual machine, spinning somewhere in the cloud. This virtual machine is supplied as a Docker container `hackfin/myhdl_v2we` (check for matching tag in the Dockerfile of this repo). If you don't feel safe with clouds in general, you can also run it locally as specified in the [myhdl_v2we README](https://hub.docker.com/repository/docker/hackfin/myhdl_v2we).\n", "\n", "To create your own notebooks, you may simply use your own repo and pull them using git, such as this fork from @pcornier's project (unverified to synthesize):" ] }, { "cell_type": "code", "execution_count": 1, "id": "1d506375", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fatal: destination path '1pCPU' already exists and is not an empty directory.\n" ] } ], "source": [ "!git clone https://github.com/hackfin/1pCPU.git -b v2we" ] }, { "cell_type": "markdown", "id": "f6ce50cd", "metadata": {}, "source": [ "[Open 1pCPU](1pCPU/pCPU.ipynb)" ] }, { "cell_type": "markdown", "id": "336ab2ed", "metadata": {}, "source": [ "Or, you might just create a fork of this project via github and change the code of the launch button in `README.md` (replace `hackfin` by your user ID).\n", "\n", "```\n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/hackfin/myhdl.v2we.git/HEAD?filepath=examples%2Findex.ipynb)\n", "```" ] }, { "cell_type": "markdown", "id": "e7075df5", "metadata": { "tags": [] }, "source": [ "**Note**: One important thing to know: Google binders can time out and your work is then lost. For persistent storage of your notebook, you can:\n", "\n", "* Use an authentication token to push your changes to a git repo\n", "* Download the notebook and store locally\n", "\n", "The safest method is to run the container locally and mount your project's directory as `/work` volume." ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.2" } }, "nbformat": 4, "nbformat_minor": 5 }