New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Learning VHDL with GHDL #1291
Comments
@Domipheus' VHDL CPU series comes to mind; it started out as a custom ISA CPU called TPU and was later spun off into a RISC-V CPU called RPU, complete with an Arty-S7 based SoC. The source repos haven't been updated with the blog in a while unfortunately, but they still contain a lot of great reference designs. It's based entirely on Vivado, but at least the CPU should be fairly easy to port to ghdl if it doesn't work OOTB anyway. |
Should the content of this issue be moved on the wiki ?
|
@tgingold, on the one hand, there is no "discussion" feature in the wiki. Hence, I thought that it would be good to have an issue for that purpose, regardless of the main message being later moved elsewhere. On the other hand, if we create ghdl/ghdl-examples, this can be the first README. @Xiretza, thanks for the references. I added them above. |
Sure.
So we can either:
* create ghdl/ghdl-examples (or should it be ghdl/ghdl-tutorial ?)
* or stay with a wiki page.
Is it possible to submit a PR for a wiki page ? I don't think so, so having a list in a file would be simpler for updates.
Any opinion ?
|
The wiki is a git repo: https://github.com/ghdl/ghdl.wiki However, there is no GUI to handle PRs. We would need to create a separate repo and keep it in sync with the wiki here. Anyway, I think that the wiki is currently open for anyone to edit, not just for maintainers/contributors.
I think it should be ghdl-examples, because I'd expect it to contain different types of resources:
Some examples might be elaborated as tutorials, but many others might be contributed as code sources only. Overall, I'd expect to put in ghdl-examples all the MWEs that are not just tests for ghdl or ghdl-yosys-plugin. Nonetheless, ghdl or ghdl-yosys-plugin can use ghdl-examples as part of their test suites. |
Ok, so I will create ghdl-examples.
Overall, I'd expect to put in ghdl-examples all the MWEs that are not just tests for ghdl or ghdl-yosys-plugin. Nonetheless, ghdl or ghdl-yosys-plugin can use ghdl-examples as part of their test suites.
We must be careful here. It would be nice if the examples are easily testable and tested, but it must not be a testsuite.
|
@eine I have some examples with simple self-contained testbenches on github that might be of use for this. Combinatorial bit counting and testbench with simple makefile (mcode) flow: The following pieces of my homebrew RISC processor repo were written long ago for a Windows box (originally VHDL Simili 1.5, later GHDL) and use a simple .bat file flow for an mcode simulator. UART with self-checking testbench: Switch debouncer: -Brian p.s. probably off-topic for 'starter' examples, but the YARD-1 processor instruction verification tests use an simple yet effective technique in which small assembly test programs including 'verify' directives are simulated on the processor and post-processed to implement simulation time assertions regarding processor state, as described here back in 2001: |
@brimdavis, nice to meet you and thanks a lot! I added your references to the list above. When repo ghdl-examples is created, I might further copy your previous message almost as is. I cannot learn each resource to write an accurate description myself, but I'd like to briefly describe the resources whose authors do step by. Precisely, your comments about some of the resources being written 20 years ago are very relevant, because they allow users to understand the context and which language features were available at that time. Furthermore, the purpose is to gather resources for learning VHDL, which can be optionally and preferredly used with GHDL. However, neither do all resources need to be starters nor do all of them need to work with GHDL out of the box. With VHDL and GHDL one can never stop learning, so examples about 'intermediate' and 'advanced' features are much welcome too. Precisely, it is relatively easy to simulate any design (small or huge) with GHDL. However, we are lacking friendly resources related to other features: advanced verification methodologies/frameworks, formal verification, mixed-language synthesis, mixed-language simulation, mixed-signal simulation, code coverage, etc. Hence, your verification solution is very interesting for users to evaluate how to and how not to do it in 2020. |
I have lot of basic GHDL examples already available here: https://github.com/kost/ulx3s-ghdl-examples Feel free to take them. If there's any way I can make it more available for your needs - do let me know! |
@kost, thanks! I added it to the list above.
IMHO, it would be useful to have some minimal CI workflow that executes the examples. That allows new users to see what output they should expect when they execute them locally. There are multiple examples about how to setup GHDL in CI, with or without docker containers. Please, let us know if you want to discuss implementation alternatives. |
I forked some GHDL specifics off a Python/Jupyter notebook based playground (with Python being the general HDL), more or less for documentation purposes: https://github.com/hackfin/hdlplayground It's runnable as virtual machine in the pretty awesome mybinder.org service (hopefully for a while). From the current research it appears that the Binder approach of running HDL/synthesis from the browser is not too popular, but I think beginners might pick up on it, as one reads how-to instructions and executable example code 'inline (interactive step by step). So it can be used as a linear IDE. Plus there's kinda built-in testing framework to ensure that the examples reproduce. However it's far from complete and there's not much activity expected to happen on this end, but plans are to move 'stable' examples into the notebooks for the future for better documentation/presentation. |
I added a couple of references to hackaday projects by Yann Guidon in the list above. Nonetheless, at ygdes.com users will find many VHDL related projects: CPUs (F-CPU, YASEP, YGREC), co-simulation extensions (http://ygdes.com/GHDL)... |
I added references to some blogs posts about "Learning FPGA programming, key points for a software developer": @targeted, how did you draw all those nice diagrams? |
@eine |
Peter Ashenden wrote an 82 page tutorial on VHDL to go with an Elsevier book on computer design in 2004 also found as a companion material for another book. The VHDL Tutorial (PDF) is also found on the Internet Archive where it should remain available even should the book(s) become unavailable. |
I added the folowing references: I don't know a word of czech, |
From the pure similarity between Czech and Russian, this here https://datacipy.cz/ Also in the book itself: And from https://github.com/datacipy/VHDL |
@eine Thank you a lot. And I, as the author, have to say @targeted is right: The whole book content is under the CC-BY-ND license. The code examples I wrote (published at https://github.com/datacipy/VHDL) are under the MIT license. Some libraries or entities are from other authors - like T80 - and they're licensed under their own licenses (mostly MIT / BSD / GPL / LGPL). Let me say it is my third book (an "electronics trilogy"). The first one was about the gates, transistors, volts, sensors, etc. The second one was about the "computer building" (illustrated on the 8bit single board computers, based on CPUs 8085, 6502, and 6809) and "programming in assembler". And the whole trilogy is under the CC-BY-ND, all constructions and software are under MIT or CERN OHL... Thank you, guys, for awesome work with the GHDL! It is a great tool, which allows me not to focus only on the Quartus IDE and embedded Multisim, but on the VHDL code and its testing itself. |
I added @rodrigomelo9's "Fundamentals of VHDL (Hardware Description Language)" (slides, video) at the Joint ICTP-IAEA School on FPGA-based SoC and its Applications for Nuclear and Related Instrumentation. Find other talks: http://indico.ictp.it/event/9443/other-view?view=ictptimetable. |
Maybe you could add this marvelous tool, based on GHDL in the list. https://gitlab.ensta-bretagne.fr/bollenth/ghdl-vpi-virtual-board It allows to quickly play with a GHDL-based virtual board : LEDs, switches, buttons, seven segments. Regards |
@JC-LL, such an interesting reference! Congratulations to Théotime for that nice work! I added it to https://ghdl.github.io/ghdl-cosim/vpi/examples/other.html and https://github.com/dbhi/vboard. |
Added a ref to xupgit/VHDL (Open Hardware 2015: TU Crete; Game of Life), authored by @nkyparissas. Also to nkyparissas/Cellular_Automata_FPGA, by the same author. |
Added a ref to a tutorial about GHDL and OpenLane based on the adder from the Quick Start Guide: britovski/adder (translation of staydh/adder). /cc @britovski @staydh |
The documentation of GHDL contains a brief Quick Start Guide to introduce GHDL's CLI interface to users, but it does not contain an introduction to VHDL. There are many examples scattered in the repos:
However, since many users learn about both VHDL, GHDL and sometimes digital design at the same time, previous resources might be too harsh. The purpose of this document is to gather references to open/free (as in free beer) tutorials, guides, books, blog post, repositories, etc. which use VHDL (and optionally GHDL).
See also Talks, presentations and other communications about GHDL and Target projects for synthesis.
Moreover, the following repositories (in case insensitive alphabetical order) might be useful for searching solutions to common designs/problems:
The text was updated successfully, but these errors were encountered: