(no commit message)
[libreriscv.git] / resources.mdwn
1 # Resources and Specifications
2
3 This page aims to collect all the resources and specifications we need
4 in one place for quick access. We will try our best to keep links here
5 up-to-date. Feel free to add more links here.
6
7 [[!toc ]]
8
9 # Getting Started
10
11 This section is primarily a series of useful links found online
12
13 * [FSiC2019](https://wiki.f-si.org/index.php/FSiC2019)
14 * Fundamentals to learn to get started [[3d_gpu/tutorial]]
15
16 ## Is Open Source Hardware Profitable?
17 [RaptorCS on FOSS Hardware Interview](https://www.youtube.com/watch?v=o5Ihqg72T3c&feature=youtu.be)
18
19 # OpenPOWER ISA
20
21 * [3.0 PDF](https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0)
22 * [2.07 PDF](https://openpowerfoundation.org/?resource_lib=ibm-power-isa-version-2-07-b)
23
24 ## Overview of the user ISA:
25
26 [Raymond Chen's PowerPC series](https://devblogs.microsoft.com/oldnewthing/20180806-00/?p=99425)
27
28 ## OpenPOWER OpenFSI Spec (2016)
29
30 * [OpenPOWER OpenFSI Spec](http://openpowerfoundation.org/wp-content/uploads/resources/OpenFSI-spec-100/OpenFSI-spec-20161212.pdf)
31
32 * [OpenPOWER OpenFSI Compliance Spec](http://openpowerfoundation.org/wp-content/uploads/resources/openpower-fsi-thts-1.0/openpower-fsi-thts-20180130.pdf)
33
34 # JTAG
35
36 * [Useful JTAG implementation reference: Design Of IEEE 1149.1 TAP Controller IP Core by Shelja, Nandakumar and Muruganantham, DOI:10.5121/csit.2016.60910](https://web.archive.org/web/20201021174944/https://airccj.org/CSCP/vol6/csit65610.pdf)
37
38 Abstract
39
40 "The objective of this work is to design and implement a TAP controller IP core compatible with IEEE 1149.1-2013 revision of the standard. The test logic architecture also includes the Test Mode Persistence controller and its associated logic. This work is expected to serve as a ready to use module that can be directly inserted in to a new digital IC designs with little modifications."
41
42 # RISC-V Instruction Set Architecture
43
44 **PLEASE UPDATE** - we are no longer implementing full RISCV, only user-space
45 RISCV
46
47 The Libre RISC-V Project is building a hybrid CPU/GPU SoC. As the name
48 of the project implies, we will be following the RISC-V ISA I due to it
49 being open-source and also because of the huge software and hardware
50 ecosystem building around it. There are other open-source ISAs but none
51 of them have the same momentum and energy behind it as RISC-V.
52
53 To fully take advantage of the RISC-V ecosystem, it is important to be
54 compliant with the RISC-V standards. Doing so will allow us to to reuse
55 most software as-is and avoid major forks.
56
57 * [Official compiled PDFs of RISC-V ISA Manual]
58 (https://github.com/riscv/riscv-isa-manual/releases/latest)
59 * [Working draft of the proposed RISC-V Bitmanipulation extension](https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-draft.pdf)
60 * [RISC-V "V" Vector Extension](https://riscv.github.io/documents/riscv-v-spec/)
61 * [RISC-V Supervisor Binary Interface Specification](https://github.com/riscv/riscv-sbi-doc/blob/master/riscv-sbi.md)
62
63 Note: As far as I know, we aren't using the RISC-V V Extension directly
64 at the moment. However, there are many wiki pages that make a reference
65 to the V extension so it would be good to include it here as a reference
66 for comparative/informative purposes with regard to Simple-V.
67
68 # Radix MMU
69 - [Qemu emulation](https://github.com/qemu/qemu/commit/d5fee0bbe68d5e61e2d2beb5ff6de0b9c1cfd182)
70
71 # D-Cache
72
73 ## D-Cache Possible Optimizations papers and links
74 - [ACDC: Small, Predictable and High-Performance Data Cache](https://dl.acm.org/doi/10.1145/2677093)
75
76 # BW Enhancing Shared L1 Cache Design research done in cooperation with AMD
77 - [Youtube video PACT 2020 - Analyzing and Leveraging Shared L1 Caches in GPUs](https://m.youtube.com/watch?v=CGIhOnt7F6s)
78 - [Url to PDF of paper on author's website (clicking will download the pdf)](https://adwaitjog.github.io/docs/pdf/sharedl1-pact20.pdf)
79
80
81 # RTL Arithmetic SQRT, FPU etc.
82
83 ## Sqrt
84 * [Fast Floating Point Square Root](https://pdfs.semanticscholar.org/5060/4e9aff0e37089c4ab9a376c3f35761ffe28b.pdf)
85 * [Reciprocal Square Root Algorithm](http://www.acsel-lab.com/arithmetic/arith15/papers/ARITH15_Takagi.pdf)
86
87 ## CORDIC and related algorithms
88
89 * <https://bugs.libre-soc.org/show_bug.cgi?id=127> research into CORDIC
90 * <https://bugs.libre-soc.org/show_bug.cgi?id=208>
91 * [BKM (log(x) and e^x)](https://en.wikipedia.org/wiki/BKM_algorithm)
92 * [CORDIC](http://www.andraka.com/files/crdcsrvy.pdf)
93 - Does not have an easy way of computing tan(x)
94 * [zipcpu CORDIC](https://zipcpu.com/dsp/2017/08/30/cordic.html)
95 * [Low latency and Low error floating point TCORDIC](https://ieeexplore.ieee.org/document/7784797) (email Michael or Cole if you don't have IEEE access)
96 * <http://www.myhdl.org/docs/examples/sinecomp/> MyHDL version of CORDIC
97
98 ## IEEE Standard for Floating-Point Arithmetic (IEEE 754)
99
100 Almost all modern computers follow the IEEE Floating-Point Standard. Of
101 course, we will follow it as well for interoperability.
102
103 * IEEE 754-2019: <https://standards.ieee.org/standard/754-2019.html>
104
105 Note: Even though this is such an important standard used by everyone,
106 it is unfortunately not freely available and requires a payment to
107 access. However, each of the Libre RISC-V members already have access
108 to the document.
109
110 * [Lecture notes - Floating Point Appreciation](http://pages.cs.wisc.edu/~markhill/cs354/Fall2008/notes/flpt.apprec.html)
111
112 Among other things, has a nice explanation on arithmetic, rounding modes and the sticky bit.
113
114 * [What Every Computer Scientist Should Know About Floating-Point Arithmetic](https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html)
115
116 Nice resource on rounding errors (ulps and epsilon) and the "table maker's dilemma".
117
118 ## Past FPU Mistakes to learn from
119
120 * [Intel Underestimates Error Bounds by 1.3 quintillion on
121 Random ASCII – tech blog of Bruce Dawson ](https://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/)
122 * [Intel overstates FPU accuracy 06/01/2013](http://notabs.org/fpuaccuracy)
123
124 # Khronos Standards
125
126 The Khronos Group creates open standards for authoring and acceleration
127 of graphics, media, and computation. It is a requirement for our hybrid
128 CPU/GPU to be compliant with these standards *as well* as with IEEE754,
129 in order to be commercially-competitive in both areas: especially Vulkan
130 and OpenCL being the most important. SPIR-V is also important for the
131 Kazan driver.
132
133 Thus the [[zfpacc_proposal]] has been created which permits runtime dynamic
134 switching between different accuracy levels, in userspace applications.
135
136 [**SPIR-V Main Page Link**](https://www.khronos.org/registry/spir-v/)
137
138 * [SPIR-V 1.5 Specification Revision 1](https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html)
139 * [SPIR-V OpenCL Extended Instruction Set](https://www.khronos.org/registry/spir-v/specs/unified1/OpenCL.ExtendedInstructionSet.100.html)
140 * [SPIR-V GLSL Extended Instruction Set](https://www.khronos.org/registry/spir-v/specs/unified1/GLSL.std.450.html)
141
142 [**Vulkan Main Page Link**](https://www.khronos.org/registry/vulkan/)
143
144 * [Vulkan 1.1.122](https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/index.html)
145
146 [**OpenCL Main Page**](https://www.khronos.org/registry/OpenCL/)
147
148 * [OpenCL 2.2 API Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_API.html)
149 * [OpenCL 2.2 Extension Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_Ext.html)
150 * [OpenCL 2.2 SPIR-V Environment Specification](https://www.khronos.org/registry/OpenCL/specs/2.2/html/OpenCL_Env.html)
151
152 * OpenCL released the proposed OpenCL 3.0 spec for comments in april 2020
153
154 * [Announcement video](https://youtu.be/h0_syTg6TtY)
155 * [Announcement video slides (PDF)](https://www.khronos.org/assets/uploads/apis/OpenCL-3.0-Launch-Apr20.pdf)
156
157 Note: We are implementing hardware accelerated Vulkan and
158 OpenCL while relying on other software projects to translate APIs to
159 Vulkan. E.g. Zink allows for OpenGL-to-Vulkan in software.
160
161 # Graphics and Compute API Stack
162
163 I found this informative post that mentions Kazan and a whole bunch of
164 other stuff. It looks like *many* APIs can be emulated on top of Vulkan,
165 although performance is not evaluated.
166
167 <https://synappsis.wordpress.com/2017/06/03/opengl-over-vulkan-dev/>
168
169 * Pixilica is heading up an initiative to create a RISC-V graphical ISA
170
171 * [Pixilica 3D Graphical ISA Slides](https://b5792ddd-543e-4dd4-9b97-fe259caf375d.filesusr.com/ugd/841f2a_c8685ced353b4c3ea20dbb993c4d4d18.pdf)
172
173 # 3D Graphics Texture compression software and hardware
174
175 * [Proprietary Rad Game Tools Oddle Texture Software Compression](https://web.archive.org/web/20200913122043/http://www.radgametools.com/oodle.htm)
176
177 * [Blog post by one of the engineers who developed the proprietary Rad Game Tools Oddle Texture Software Compression and the Oodle Kraken decompression software and hardware decoder used in the ps5 ssd](https://archive.vn/oz0pG)
178
179 # Various POWER Communities
180 - [An effort to make a 100% Libre POWER Laptop](https://www.powerpc-notebook.org/en/)
181 The T2080 is a POWER8 chip.
182 - [Power Progress Community](https://www.powerprogress.org/campaigns/donations-to-all-the-power-progress-community-projects/)
183 Supporting/Raising awareness of various POWER related open projects on the FOSS
184 community
185 - [OpenPOWER](https://openpowerfoundation.org)
186 Promotes and ensure compliance with the Power ISA amongst members.
187 - [OpenCapi](https://opencapi.org)
188 High performance interconnect for POWER machines. One of the big advantages
189 of the POWER architecture. Notably more performant than PCIE Gen4, and is
190 designed to be layered on top of the physical PCIE link.
191 - [OpenPOWER “Virtual Coffee” Calls](https://openpowerfoundation.org/openpower-virtual-coffee-calls/)
192 Truly open bi-weekly teleconference lines for anybody interested in helping
193 advance or adopting the POWER architecture.
194
195 # Conferences
196
197 ## Free Silicon Conference
198
199 The conference brought together experts and enthusiasts who want to build
200 a complete Free and Open Source CAD ecosystem for designing analog and
201 digital integrated circuits. The conference covered the full spectrum of
202 the design process, from system architecture, to layout and verification.
203
204 * <https://wiki.f-si.org/index.php/FSiC2019#Foundries.2C_PDKs_and_cell_libraries>
205
206 * LIP6's Coriolis - a set of backend design tools:
207 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
208
209 Note: The rest of LIP6's website is in French, but there is a UK flag
210 in the corner that gives the English version.
211
212 * KLayout - Layout viewer and editor: <https://www.klayout.de/>
213
214 # The OpenROAD Project
215
216 OpenROAD seeks to develop and foster an autonomous, 24-hour, open-source
217 layout generation flow (RTL-to-GDS).
218
219 * <https://theopenroadproject.org/>
220
221 # Other RISC-V GPU attempts
222
223 * <https://fossi-foundation.org/2019/09/03/gsoc-64b-pointers-in-rv32>
224
225 * <http://bjump.org/manycore/>
226
227 * <https://resharma.github.io/RISCV32-GPU/>
228
229 TODO: Get in touch and discuss collaboration
230
231 # Tests, Benchmarks, Conformance, Compliance, Verification, etc.
232
233 ## RISC-V Tests
234
235 RISC-V Foundation is in the process of creating an official conformance
236 test. It's still in development as far as I can tell.
237
238 * //TODO LINK TO RISC-V CONFORMANCE TEST
239
240 ## IEEE 754 Testing/Emulation
241
242 IEEE 754 has no official tests for floating-point but there are
243 well-known third party tools to check such as John Hauser's TestFloat.
244
245 There is also his SoftFloat library, which is a software emulation
246 library for IEEE 754.
247
248 * <http://www.jhauser.us/arithmetic/>
249
250 Jacob is also working on an IEEE 754 software emulation library written
251 in Rust which also has Python bindings:
252
253 * Source: <https://salsa.debian.org/Kazan-team/simple-soft-float>
254 * Crate: <https://crates.io/crates/simple-soft-float>
255 * Autogenerated Docs: <https://docs.rs/simple-soft-float/>
256
257 A cool paper I came across in my research is "IeeeCC754++ : An Advanced
258 Set of Tools to Check IEEE 754-2008 Conformity" by Dr. Matthias Hüsken.
259
260 * Direct link to PDF:
261 <http://elpub.bib.uni-wuppertal.de/servlets/DerivateServlet/Derivate-7505/dc1735.pdf>
262
263 ## Khronos Tests
264
265 OpenCL Conformance Tests
266
267 * <https://github.com/KhronosGroup/OpenCL-CTS>
268
269 Vulkan Conformance Tests
270
271 * <https://github.com/KhronosGroup/VK-GL-CTS>
272
273 MAJOR NOTE: We are **not** allowed to say we are compliant with any of
274 the Khronos standards until we actually make an official submission,
275 do the paperwork, and pay the relevant fees.
276
277 ## Formal Verification
278
279 Formal verification of Libre RISC-V ensures that it is bug-free in
280 regards to what we specify. Of course, it is important to do the formal
281 verification as a final step in the development process before we produce
282 thousands or millions of silicon.
283
284 * Possible way to speed up our solvers for our formal proofs <https://web.archive.org/web/20201029205507/https://github.com/eth-sri/fastsmt>
285
286 * Algorithms (papers) submitted for 2018 International SAT Competition <https://web.archive.org/web/20201029205239/https://helda.helsinki.fi/bitstream/handle/10138/237063/sc2018_proceedings.pdf> <https://web.archive.org/web/20201029205637/http://www.satcompetition.org/>
287
288 Some learning resources I found in the community:
289
290 * ZipCPU: <http://zipcpu.com/> ZipCPU provides a comprehensive
291 tutorial for beginners and many exercises/quizzes/slides:
292 <http://zipcpu.com/tutorial/>
293 * Western Digital's SweRV CPU blog (I recommend looking at all their
294 posts): <https://tomverbeure.github.io/>
295 * <https://tomverbeure.github.io/risc-v/2018/11/19/A-Bug-Free-RISC-V-Core-without-Simulation.html>
296 * <https://tomverbeure.github.io/rtl/2019/01/04/Under-the-Hood-of-Formal-Verification.html>
297
298 ## Automation
299
300 * <https://www.ohwr.org/project/wishbone-gen>
301
302 # LLVM
303
304 ## Adding new instructions:
305
306 * <https://archive.fosdem.org/2015/schedule/event/llvm_internal_asm/>
307
308 # Branch Prediction
309
310 * <https://danluu.com/branch-prediction/>
311
312 # Python RTL Tools
313
314 * [Migen - a Python RTL](https://jeffrey.co.in/blog/2014/01/d-flip-flop-using-migen/)
315 * [LiTeX](https://github.com/timvideos/litex-buildenv/wiki/LiteX-for-Hardware-Engineers)
316 An SOC builder written in Python Migen DSL. Allows you to generate functional
317 RTL for a SOC configured with cache, a RISCV core, ethernet, DRAM support,
318 and parameterizeable CSRs.
319 * [Migen Tutorial](http://blog.lambdaconcept.com/doku.php?id=migen:tutorial>)
320 * There is a great guy, Robert Baruch, who has a good
321 [tutorial](https://github.com/RobertBaruch/nmigen-tutorial) on nMigen.
322 He also build an FPGA-proven Motorola 6800 CPU clone with nMigen and put
323 [the code](https://github.com/RobertBaruch/n6800) and
324 [instructional videos](https://www.youtube.com/playlist?list=PLEeZWGE3PwbbjxV7_XnPSR7ouLR2zjktw)
325 online.
326 * [Minerva](https://github.com/lambdaconcept/minerva)
327 An SOC written in Python nMigen DSL
328 * [Using our Python Unit Tests(old)](http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-March/000705.html)
329 * <https://chisel.eecs.berkeley.edu/api/latest/chisel3/util/DecoupledIO.html>
330 * <http://www.clifford.at/papers/2016/yosys-synth-formal/slides.pdf>
331
332 # Other
333
334 * <https://wiki.f-si.org/index.php/FSiC2019>
335 * <https://fusesoc.net>
336 * <https://www.lowrisc.org/open-silicon/>
337 * <http://fpgacpu.ca/fpga/Pipeline_Skid_Buffer.html> pipeline skid buffer
338 * <https://pyvcd.readthedocs.io/en/latest/vcd.gtkw.html> GTKwave
339 * <http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_Resets.pdf>
340 Synchronous Resets? Asynchronous Resets? I am so confused! How will I
341 ever know which to use? by Clifford E. Cummings
342 * <http://www.sunburst-design.com/papers/CummingsSNUG2008Boston_CDC.pdf>
343 Clock Domain Crossing (CDC) Design & Verification Techniques Using
344 SystemVerilog, by Clifford E. Cummings
345 In particular, see section 5.8.2: Multi-bit CDC signal passing using
346 1-deep / 2-register FIFO synchronizer.
347 * <http://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/EECS-2016-143.pdf>
348 Understanding Latency Hiding on GPUs, by Vasily Volkov
349 * Efabless "Openlane" <https://github.com/efabless/openlane>
350 * Co-simulation plugin for verilator, transferring to ECP5
351 <https://github.com/vmware/cascade>
352 * Multi-read/write ported memories
353 <https://tomverbeure.github.io/2019/08/03/Multiport-Memories.html>
354 * Data-dependent fail-on-first aka "Fault-tolerant speculative vectorisation"
355 <https://arxiv.org/pdf/1803.06185.pdf>
356 * OpenPOWER Foundation Membership
357 <https://openpowerfoundation.org/membership/how-to-join/membership-kit-9-27-16-4/>
358 * Clock switching (and formal verification)
359 <https://zipcpu.com/formal/2018/05/31/clkswitch.html>
360
361
362 # Real/Physical Projects
363
364 * [Samuel's KC5 code](http://chiselapp.com/user/kc5tja/repository/kestrel-3/dir?ci=6c559135a301f321&name=cores/cpu)
365 * <https://chips4makers.io/blog/>
366 * <https://hackaday.io/project/7817-zynqberry>
367 * <https://github.com/efabless/raven-picorv32>
368 * <https://efabless.com>
369 * <https://efabless.com/design_catalog/default>
370 * <https://wiki.f-si.org/index.php/The_Raven_chip:_First-time_silicon_success_with_qflow_and_efabless>
371 * <https://mshahrad.github.io/openpiton-asplos16.html>
372
373 # ASIC tape-out pricing
374
375 * <https://europractice-ic.com/wp-content/uploads/2020/05/General-MPW-EUROPRACTICE-200505-v8.pdf>
376
377 # Funding
378
379 * <https://toyota-ai.ventures/>
380 * [NLNet Applications](http://bugs.libre-riscv.org/buglist.cgi?columnlist=assigned_to%2Cbug_status%2Cresolution%2Cshort_desc%2Ccf_budget&f1=cf_nlnet_milestone&o1=equals&query_format=advanced&resolution=---&v1=NLnet.2019.02)
381
382 # Good Programming/Design Practices
383
384 * [Liskov Substitution Principle](https://en.wikipedia.org/wiki/Liskov_substitution_principle)
385 * [Principle of Least Astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment)
386 * <https://peertube.f-si.org/videos/watch/379ef007-40b7-4a51-ba1a-0db4f48e8b16>
387 * [Rust-Lang Philosophy and Consensus](http://smallcultfollowing.com/babysteps/blog/2019/04/19/aic-adventures-in-consensus/)
388
389 * <https://youtu.be/o5Ihqg72T3c>
390 * <http://flopoco.gforge.inria.fr/>
391 * Fundamentals of Modern VLSI Devices
392 <https://groups.google.com/a/groups.riscv.org/d/msg/hw-dev/b4pPvlzBzu0/7hDfxArEAgAJ>
393
394 # 12 skills summary
395
396 * <https://www.crnhq.org/cr-kit/>
397
398 # Analog Simulation
399
400 * <https://github.com/Isotel/mixedsim>
401 * <http://www.vlsiacademy.org/open-source-cad-tools.html>
402 * <http://ngspice.sourceforge.net/adms.html>
403 * <https://en.wikipedia.org/wiki/Verilog-AMS#Open_Source_Implementations>
404
405 # Libre-SOC Standards
406
407 This list auto-generated from a page tag "standards":
408
409 [[!inline pages="tagged(standards)" actions="no" archive="yes" quick="yes"]]
410
411 # Server setup
412
413 * [[resources/server-setup/web-server]]
414 * [[resources/server-setup/git-mirroring]]
415 * [[resources/server-setup/nagios-monitoring]]
416
417 # Testbeds
418
419 * <https://www.fed4fire.eu/testbeds/>
420
421 # Really Useful Stuff
422
423 * <https://github.com/im-tomu/fomu-workshop/blob/master/docs/requirements.txt>
424 * <https://github.com/im-tomu/fomu-workshop/blob/master/docs/conf.py#L39-L47>
425
426 # Digilent Arty
427
428 * https://store.digilentinc.com/pmod-sf3-32-mb-serial-nor-flash/
429 * https://store.digilentinc.com/arty-a7-artix-7-fpga-development-board-for-makers-and-hobbyists/
430 * https://store.digilentinc.com/pmod-vga-video-graphics-array/
431 * https://store.digilentinc.com/pmod-microsd-microsd-card-slot/
432 * https://store.digilentinc.com/pmod-rtcc-real-time-clock-calendar/
433 * https://store.digilentinc.com/pmod-i2s2-stereo-audio-input-and-output/
434
435 # CircuitJS experiments
436
437 * [[resources/high-speed-serdes-in-circuitjs]]
438
439 # ASIC Timing and Design flow resources
440
441 * <https://www.linkedin.com/pulse/asic-design-flow-introduction-timing-constraints-mahmoud-abdellatif/>
442 * <https://www.icdesigntips.com/2020/10/setup-and-hold-time-explained.html>
443 * <https://www.vlsiguide.com/2018/07/clock-tree-synthesis-cts.html>
444 * <https://en.wikipedia.org/wiki/Frequency_divider>