• Stars
    star
    1,092
  • Rank 42,434 (Top 0.9 %)
  • Language
    Python
  • License
    Other
  • Created almost 13 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python toolbox for building complex digital hardware

Migen (Milkymist generator)

migen logo

A Python toolbox for building complex digital hardware

Despite being faster than schematics entry, hardware design with Verilog and VHDL remains tedious and inefficient for several reasons. The event-driven model introduces issues and manual coding that are unnecessary for synchronous circuits, which represent the lion's share of today's logic designs. Counter- intuitive arithmetic rules result in steeper learning curves and provide a fertile ground for subtle bugs in designs. Finally, support for procedural generation of logic (metaprogramming) through "generate" statements is very limited and restricts the ways code can be made generic, reused and organized.

To address those issues, we have developed the Migen FHDL library that replaces the event-driven paradigm with the notions of combinatorial and synchronous statements, has arithmetic rules that make integers always behave like mathematical integers, and most importantly allows the design's logic to be constructed by a Python program. This last point enables hardware designers to take advantage of the richness of the Python language - object oriented programming, function parameters, generators, operator overloading, libraries, etc. - to build well organized, reusable and elegant designs.

Other Migen libraries are built on FHDL and provide various tools such as a system-on-chip interconnect infrastructure, a dataflow programming system, a more traditional high-level synthesizer that compiles Python routines into state machines with datapaths, and a simulator that allows test benches to be written in Python.

See the doc/ folder for more technical information.

Migen is designed for Python 3.5. Note that Migen is not spelled MiGen.

Quick Links

Code repository: https://github.com/m-labs/migen

System-on-chip design based on Migen: https://github.com/m-labs/misoc

Online documentation: https://m-labs.hk/migen/manual/

Quick intro

from migen import *
from migen.build.platforms import m1
plat = m1.Platform()
led = plat.request("user_led")
m = Module()
counter = Signal(26)
m.comb += led.eq(counter[25])
m.sync += counter.eq(counter + 1)
plat.build(m)

License

Migen is released under the very permissive two-clause BSD license. Under the terms of this license, you are authorized to use Migen for closed-source proprietary designs. Even though we do not require you to do so, those things are awesome, so please do them if possible:

  • tell us that you are using Migen
  • put the Migen logo (doc/migen_logo.svg) on the page of a product using it, with a link to http://m-labs.hk
  • cite Migen in publications related to research it has helped
  • send us feedback and suggestions for improvements
  • send us bug reports when something goes wrong
  • send us the modifications and improvements you have done to Migen. The use of "git format-patch" is recommended. If your submission is large and complex and/or you are not sure how to proceed, feel free to discuss it on the mailing list or IRC (#m-labs on Freenode) beforehand.

See LICENSE file for full copyright and license info. You can contact us on the public mailing list devel [AT] lists.m-labs.hk.

"Electricity! It's like magic!"

More Repositories

1

nmigen

A refreshed Python toolbox for building complex digital hardware. See https://gitlab.com/nmigen/nmigen
Python
630
star
2

artiq

A leading-edge control system for quantum information experiments
Python
426
star
3

misoc

The original high performance and small footprint system-on-chip based on Migenâ„¢
C
290
star
4

milkymist

SoC design for Milkymist One - LM32, DDR SDRAM, 2D TMU, PFPU
Verilog
145
star
5

lm32

LatticeMico32 soft processor
Verilog
96
star
6

pythonparser

Python
71
star
7

rust-atomic_ring_buffer

Atomic ring buffer is a fixed-size multi-producer multi-consumer queue that works on bare-metal systems.
Rust
49
star
8

tdc-core

A 26ps RMS time-to-digital converter (TDC) core for Spartan-6 FPGAs
Verilog
46
star
9

VexRiscv-verilog

Using VexRiscv without installing Scala
Verilog
32
star
10

dslite2svd

Converter of register descriptions from the TI DSLite format to CMSIS SVD format
Rust
32
star
11

jesd204b

JESD204B core for Migen/MiSoC
Python
31
star
12

flickernoise

Video synthesis software for the Milkymist One
C
30
star
13

nmigen-boards

Board and connector definition files for nMigen
Python
27
star
14

uclibc-lm32

uClibc with LM32 architecture support
C
19
star
15

nmigen-soc

System on Chip toolkit for nMigen
Python
17
star
16

ionpak

A modern, low-cost universal controller for hot-cathode ionization vacuum gauges. (WIP)
Rust
16
star
17

liboscparse

Liblo (OSC library) without GNU/Autocrap and network dependent non-portable code
C
13
star
18

microscope

Finding the bacteria in rotting FPGA designs.
Python
13
star
19

mtk

The Milkymist GUI toolkit (Genode FX based), because X11 sucks!
C
13
star
20

nmigen-stdio

Industry standard I/O for nMigen
Python
11
star
21

sipyco

Simple Python Communications
Python
9
star
22

openwrt-milkymist

OpenWRT with Milkymist support
C
9
star
23

ek-tm4c1294xl-demo

An example of programming the TI EK-TM4C1294XL development board in Rust
Rust
9
star
24

rtems-yaffs2

YAFFS2 with RTEMS support (new API)
C
7
star
25

llvm-lm32

LLVM with LatticeMico32 support patch (JPBonn tree)
C++
7
star
26

scripts

Various script files and Makefiles to build Milkymist One software
Shell
7
star
27

mixxeo-soc

System-on-chip design and software for the Mixxeo
C
7
star
28

fjmem-m1

FJMEM core for flashing Mixxeo and Milkymist One
Verilog
6
star
29

clang-lm32

Clang with LatticeMico32 support
C++
6
star
30

board-m1

Milkymist One PCB design files
Prolog
6
star
31

lwip

lwip mirror
C
5
star
32

adc2tcp

Rust
4
star
33

cairoplot3

Python 3 port of Cairoplot
Python
4
star
34

nu-servo

Novogorny Urukul Servo
Python
4
star
35

artiq-comtools

Lightweight ARTIQ communication tools
Python
4
star
36

bugs

Old Milkymist repos. Only kept for historical purposes :)
4
star
37

autotest-m1

Automated testing program for the Milkymist One
C
4
star
38

misp

Milkymist Software Platform (experimental)
C
4
star
39

extras-m1

JTAG adapter, leaflet, case CAD files, ...
Prolog
4
star
40

elf2flt-lm32

elf2flt with LM32 architecture support
Shell
4
star
41

datasheets-m1

Datasheets for the parts of the "Milkymist One" board
3
star
42

compiler-rt-lm32

LLVM compiler-rt with LM32 support
C
3
star
43

flickernoise-handbook

Handbook for the Flickernoise VJ application
3
star
44

clang-demos

Sample programs to demonstrate Clang/LLVM on LM32
Assembly
3
star
45

buildbot-config

Internal Buildbot configuration for M-Labs projects. Superseded by https://git.m-labs.hk/m-labs/nix-scripts
Python
3
star
46

drtio_transceiver_test

Transceiver test and demonstration for ARTIQ DRTIO
Python
3
star
47

phaser

Jupyter Notebook
2
star
48

mixxeo-mech

Mixxeo mechanical design
IDL
2
star
49

bscan_spi_kc705

Gateware to allow JTAG serial flash programming on KC705 with xc3sprog
VHDL
2
star
50

artiq-hardware

ARTIQ hardware project
TeX
2
star
51

migen-extradoc

More Migen documentation and tutorials
TeX
2
star
52

novatech409b

ARTIQ controller for the Novatech 409B DDS
Python
1
star
53

aq_ni6733

ARTIQ NDSP for NI 6733 DAC systems (untested/experimental)
Python
1
star
54

conda-recipes

Recipes for conda packages required by M-Labs software
Batchfile
1
star
55

thorlabs_tcube

ARTIQ controller for Thorlabs Tcube devices
Python
1
star
56

cossin

cos(z), sin(z) generator in migen using block ROM and linear interpolation
Jupyter Notebook
1
star
57

ethernet-yakshaving

Python
1
star
58

sayma_test

Test designs for Sayma boards (ddr3, drtio, amc-rtm link, jesd204b)
Python
1
star