1 \documentclass[slidestop
]{beamer
}
2 \usepackage{beamerthemesplit
}
8 \title{Using the ECP5 for Libre-SOC prototyping
}
16 \huge{Using the ECP5 for Libre-SOC prototyping
}\\
18 \Large{Verification of the Libre-SOC core
}\\
19 \Large{using an OrangeCrab feather form factor dev board
}\\
20 \Large{and gram to drive the ddr3 ram and booting Linux
}\\
24 \large{Sponsored by NLnet
}\\
31 \frame{\frametitle{Why using an ECP5 and OrangeCrab?
}
34 \item ECP5 and ICE40 have libre toolchains (Yosys, nextpnr)
\vspace{6pt
}
35 \item Microwatt already supports the OrangeCrab using LiteDRAM: \\
36 LiteDRAM depens on original Migen and does not fit into ls2\\
37 I was unable to rebuild the original one from Microwatt\\
38 and decided to continue working on (nMigen based) gram
40 \item ECP5 is big enough for prototyping the Libre-SOC core\\
41 When I started porting ls2 to the OrangeCrab I was able to\\
42 run coldboot.c and began adding support for gram
44 \item Because for
5 years I Always Wanted To Design A GPU
46 \item ICE40 also used by Valve and Bitcraze in several SteamVR
47 products and the Lighthouse positioning deck
52 \frame{\frametitle{Why nMigen and gram?
}
57 \item nMigen+LambdaSoC port of the LiteDRAM core\\
58 avoiding using old Migen and LiteX\\
59 only using nMigen used by Libre-SOC
\vspace{10pt
}
60 \item nMigen is much more powerful than Verilog and VHDL\\
61 and easier to use for anyone that knows python\\
62 (and works with yosys/nextpnr/gcc)
\vspace{10pt
}
63 \item gram is simplified, it only supports ECP5 atm\\
64 and maybe some Xilinx FPGAs in the future
\vspace{10pt
}
65 \item Wanting to learn how to use the dram phy that comes\\
66 with the ECP5. Then booting linux using the Libre-SOC core
74 \frame{\frametitle{How do DRAM interfaces work
}
77 \item Multiple generarions of DDR-SDRAM interfaces\\
78 POWER9: DDR4-SDRAM POWER10: DDR5-SDRAM
80 \item OrangeCrab has DDR3L Memory,
128 Mbytes (
1Gbit)\\
81 64M x16,
1.35V low voltage operation (can boot linux)
83 \item See nmigen-boards for OrangeCrab pins
\vspace{3pt
}
84 \item Controller are found in gram and lite-dram
\vspace{3pt
}
85 \item Ideally gram and lite-dram should show identical behaviour\\
86 Reality: only lite-dram works out of the box
88 \item If it does not work debugging is hard\\
89 Found out that burstdet signal is not asserted on read
93 \frame{\frametitle{The ECP5 DRAM controller
}
96 \item see manual for ECP5 and ECP5-
5G High-Speed I/O Interface\\
97 comes with many built-in blocks: DQSBUFM, DDRDLLA, ...\\
98 \textit{DQSBUFM
} is the most interesting one\\
100 \item FPGA-TN-
02035-
1.3 documents DQSBUF \\
101 Data Strobe Control Block : Generates a BURSTDET output\\
102 that can be used to validate the READ pulse positioning\\
104 \item DQSBUFM element is used for all the DDR Memory\\
105 interfaces on ECP5 only. Other blocks used on Xilinx
107 \item Python implementation of DDR PHY for ECP5\\
108 git.libre-soc.org / gram.git / gram / phy / ecp5ddrphy.py\\
109 github.com / enjoy-digital / litedram / phy / ecp5ddrphy.py
116 \frame{\frametitle{Typical DDR2/DDR3/DDR3L Memory Interface
}
118 \includegraphics[width=
0.9\textwidth]{interface1.png
}
122 \frame{\frametitle{DQSBUFM -- Inputs
}
124 \includegraphics[width=
0.9\textwidth]{DQSBUFM_P1.png
}
128 \item BURSTDET used for read leveling
129 \item DATAVALID controls dfi.phases
[0] and dfi.phases
[1] latch
133 \frame{\frametitle{DQSBUFM -- Outputs
}
135 \includegraphics[width=
0.9\textwidth]{DQSBUFM_P2.png
}
139 \item PAUSE controlled by init.pause and dqsbufm
\_manager.pause
140 \item READCLKSEL used to set read leveling delay (
3 bits)
144 \frame{\frametitle{How to use libgram
}
146 \item struct gramCtx with base addresses and user data
147 \item must call gram
\_init(ctx, profile, ddr
\_base, core
\_base, phy
\_base)
149 \item first phy is set to software control
150 \item init seq is peformed
151 \item then calibration is loaded
152 \item phy is set to hardware control back again
154 \item finally memtest must run, we can boot linux if passed
156 \item calibration is different from litedram
160 \frame{\frametitle{Read leveling in litedram
}
162 \item only read leveling used by ECP5
163 \item leveling must be done for each phy module
165 \item inner loop for bitslip
166 \item A test each read window (bitslip)
167 \item B find min/max delays
168 \item take bitslip with best score
170 \item Re-do leveling on best read window
172 \item Sync all DQSBUFM's before scan(A) / level(B)
173 \item Live demo using Microwatt
177 \frame{\frametitle{Write/readback test under software control
}
179 \item Generate pseudo-random sequence
180 \item Activate test row
181 \item Write pseudo-random sequence
183 \item ECP5: reset burstdet for current module
184 \item Read/Check pseudo-random sequence
187 \item Read back test pattern
188 \item Verify bytes matching current module
189 \item ECP5: check burstdet for current module
191 \item DQSBUFM's not synced if burstdet is
0
192 \item not yet implemented in gram
196 \frame{\frametitle{Debugging with BeagleWire
}
198 \item Fully Open iCE40 FPGA BeagleBone Cape
199 \item 32 MB SDRAM and controller written in Verilog
200 \item GPMC port access from the BeagleBone
202 \item no port to nMigen yet, toolchain on BBB
203 \item connect to ECP5 to exchange data with host PC
204 \item use SPI or I2CSlave for debugging
206 \item use iCE40/BBB as ROM emulator
207 \item intercept read/write to SDRAM
208 \item run gdbserver on BeagleBoneBlack
210 \item Long term: make EOMA68 card with Solid Silicon X1
211 \item Two FPGAs and
512MB of DDR3 RAM
215 \frame{\frametitle{Porting nMigen to BeagleWire
}
217 \item There is only a LiteX port ATM
218 \item Toolchain (yosys/arachne-pnr) running on BeagleBone
219 \item Use python to control cross compile
221 \item run yosys on host PC, replace arachne-pnr
222 \item generate bitstring for multiple FPGAs if needed
223 \item control flashing via ssh, upload bitstring via scp
225 \item Unrelated to Libre-SOC: plans to make Lighthouse PMOD
226 \item LibrePlanet
2022: The LibreVR Project
227 \item http://librevr.isengaara.de
229 \item VR Headset will depend on Libre-SOC GPU
230 \item run DOOM on iCE40/ECP5 FPGA -\> VGA output needed
234 \frame{\frametitle{Summary
}
237 \item Microwatt can boot linux+buildroot on the OrangeCrab using LiteDRAM.
238 Libre-SOC using ls2 needs more work on gram, including porting to
240 \item High speed interfaces differ between FPGA models and vendors and are hard to debug
241 without using a simulator.
242 \item Software gets more complex for larger designs, development becomes
243 more expensive. Changes easily break everything.
244 \item Once DRAM is working we can add other interfaces.
245 \item Larger FPGA may be needed to prototype advanced features including
246 GPU und display controller
247 \item We can use the BeagleWire as a host computer interface
254 {\Huge The end
\vspace{12pt
}\\
255 Thank you
\vspace{12pt
}\\
256 Questions?
\vspace{12pt
}
261 \item Discussion: http://lists.libre-soc.org
262 \item Freenode IRC \#libre-soc
263 \item http://libre-soc.org/
264 \item http://nlnet.nl/PET
265 \item https://libre-soc.org/nlnet/\#faq