Merge pull request #95 from cr1901/lm32-lite
[litex.git] / README
1 __ _ __ _ __
2 / / (_) /____ | |/_/
3 / /__/ / __/ -_)> <
4 /____/_/\__/\__/_/|_|
5 Migen inside
6
7 Build your hardware, easily!
8 Copyright 2012-2018 / EnjoyDigital
9
10 [> Intro
11 --------
12 LiteX is a FPGA design/SoC builder that can be used to build cores, create
13 SoCs and full FPGA designs.
14
15 Typical LiteX design flow:
16 --------------------------
17
18 +---------------+
19 |FPGA toolchains|
20 +----^-----+----+
21 | |
22 +--+-----v--+
23 +-------+ | |
24 | Migen +--------> |
25 +-------+ | | Your design
26 | LiteX +---> ready to be used!
27 | |
28 +----------------------+ | |
29 |LiteX Cores Ecosystem +--> |
30 +----------------------+ +-^-------^-+
31 (Eth, SATA, DRAM, USB, | |
32 PCIe, Video, etc...) + +
33 board target
34 file file
35
36
37 LiteX already supports various softcores CPUs: LM32, Mor1kx, PicoRV32, VexRiscv
38 and is compatible with the LiteX's Cores Ecosystem:
39
40 - LiteDRAM: https://github.com/enjoy-digital/litedram
41 - LiteEth: https://github.com/enjoy-digital/liteeth
42 - LitePCIe: https://github.com/enjoy-digital/litepcie
43 - LiteSATA: https://github.com/enjoy-digital/litesata
44 - LiteUSB: https://github.com/enjoy-digital/liteusb
45 - LiteSDCard: https://github.com/enjoy-digital/litesdcard
46 - LiteICLink: https://github.com/enjoy-digital/liteiclink
47 - LiteJESD204B: https://github.com/enjoy-digital/litejesd204b
48 - LiteVideo: https://github.com/enjoy-digital/litevideo
49 - LiteScope: https://github.com/enjoy-digital/litescope
50
51
52 [> Sub-packages
53 ---------------
54 gen:
55 Provides specific or experimental modules to generate HDL that are not integrated
56 in Migen.
57
58 build:
59 Provides tools to build FPGA bitstreams (interface to vendor toolchains) and to
60 simulate HDL code or full SoCs.
61
62 soc:
63 Provides definitions/modules to build cores (bus, bank, flow), cores and tools
64 to build a SoC from such cores.
65
66 boards:
67 Provides platforms and targets for the supported boards. All Migen's platforms
68 can also be used in LiteX.
69
70 [> Very Quick start guide (for newcomers)
71 -----------------------------------------
72 TimVideos.us has done an awesome job for setting up a LiteX environment easily in
73 the litex-buildenv repo: https://github.com/timvideos/litex-buildenv
74
75 It's recommended for newcomers to go this way. Various FPGA boards are supported
76 and multiple examples provided! You can even run Linux on your FPGA using LiteX
77 very easily!
78
79 Migen documentation can be found here: https://m-labs.hk/migen/manual
80
81 FPGA lessons/tutorials can be found at: https://github.com/enjoy-digital/fpga_101
82
83 [> Medium Quick start guide with Conda
84 -----------------------------------------
85
86 0. Get miniconda by following instructions at https://conda.io/miniconda.html
87
88 1. Clone LiteX
89 git clone --recurse-submodules https://github.com/enjoy-digital/litex.git
90
91 2. Create a LiteX environment from environment.yml
92 conda env create -f environment.yml
93
94 3. Enter conda environment
95 conda activate litex
96
97 4. Build the target of your board...:
98 Go to boards/targets and execute the target you want to build
99
100
101 [> Quick start guide (for advanced users)
102 -----------------------------------------
103 0. Install Python 3.5+ and FPGA vendor's development tools.
104
105 1. Get litex_setup.py script and execute:
106 ./litex_setup.py init install
107 This will clone and install Migen, LiteX and LiteX's cores.
108 To update all repositories execute:
109 ./litex_setup.py update
110
111 2. Compile and install binutils. Take the latest version from GNU.
112 mkdir build && cd build
113 ../configure --target=lm32-elf
114 make
115 make install
116
117 3. (Optional, only if you want to use a lm32 CPU in you SoC)
118 Compile and install GCC. Take gcc-core and gcc-g++ from GNU
119 (version 4.5 or >=4.9).
120 rm -rf libstdc++-v3
121 mkdir build && cd build
122 ../configure --target=lm32-elf --enable-languages="c,c++" --disable-libgcc \
123 --disable-libssp
124 make
125 make install
126
127 4. Build the target of your board...:
128 Go to boards/targets and execute the target you want to build
129
130 5. ... and/or install Verilator and test LiteX on your computer:
131 Download and install Verilator: http://www.veripool.org/
132 Install libevent-devel / json-c-devel packages
133 Go to boards/targets
134 ./sim.py
135
136 6. Run a terminal program on the board's serial port at 115200 8-N-1.
137 You should get the BIOS prompt.
138
139 [> Contact
140 ----------
141 E-mail: florent [AT] enjoy-digital.fr