README: add link to online docs
[litex.git] / README.md
1 ### Migen (Milkymist generator)
2 #### A Python toolbox for building complex digital hardware
3
4 Despite being faster than schematics entry, hardware design with Verilog and
5 VHDL remains tedious and inefficient for several reasons. The event-driven
6 model introduces issues and manual coding that are unnecessary for synchronous
7 circuits, which represent the lion's share of today's logic designs. Counter-
8 intuitive arithmetic rules result in steeper learning curves and provide a
9 fertile ground for subtle bugs in designs. Finally, support for procedural
10 generation of logic (metaprogramming) through "generate" statements is very
11 limited and restricts the ways code can be made generic, reused and organized.
12
13 To address those issues, we have developed the **Migen FHDL** library that
14 replaces the event-driven paradigm with the notions of combinatorial and
15 synchronous statements, has arithmetic rules that make integers always behave
16 like mathematical integers, and most importantly allows the design's logic to
17 be constructed by a Python program. This last point enables hardware designers
18 to take advantage of the richness of the Python language - object oriented
19 programming, function parameters, generators, operator overloading, libraries,
20 etc. - to build well organized, reusable and elegant designs.
21
22 Other Migen libraries are built on FHDL and provide various tools such as a
23 system-on-chip interconnect infrastructure, a dataflow programming system, a
24 more traditional high-level synthesizer that compiles Python routines into
25 state machines with datapaths, and a simulator that allows test benches to be
26 written in Python.
27
28 See the doc/ folder for more technical information.
29
30 Migen is designed for Python 3.3. Note that Migen is **not** spelled MiGen.
31
32 #### Quick Links
33
34 Code repository:
35 https://github.com/m-labs/migen
36
37 System-on-chip design based on Migen:
38 https://github.com/m-labs/misoc
39
40 Online documentation:
41 http://m-labs.hk/gateware.html
42
43 #### Quick intro
44 ```python
45 from migen.fhdl.std import *
46 from mibuild.platforms import m1
47 plat = m1.Platform()
48 led = plat.request("user_led")
49 m = Module()
50 counter = Signal(26)
51 m.comb += led.eq(counter[25])
52 m.sync += counter.eq(counter + 1)
53 plat.build_cmdline(m)
54 ```
55
56 #### License
57 Migen is released under the very permissive two-clause BSD license. Under the
58 terms of this license, you are authorized to use Migen for closed-source
59 proprietary designs.
60 Even though we do not require you to do so, those things are awesome, so please
61 do them if possible:
62 * tell us that you are using Migen
63 * put the Migen logo (doc/migen_logo.svg) on the page of a product using it,
64 with a link to http://m-labs.hk
65 * cite Migen in publications related to research it has helped
66 * send us feedback and suggestions for improvements
67 * send us bug reports when something goes wrong
68 * send us the modifications and improvements you have done to Migen. The use
69 of "git format-patch" is recommended. If your submission is large and
70 complex and/or you are not sure how to proceed, feel free to discuss it on
71 the mailing list or IRC (#m-labs on Freenode) beforehand.
72
73 See LICENSE file for full copyright and license info. You can contact us on the
74 public mailing list devel [AT] lists.m-labs.hk.
75
76 "Electricity! It's like magic!"